Parsekit,使用ParserGenApp并包含创建的类失败。调用PKParserFactory并提供相同的语法

时间:2013-10-22 04:36:45

标签: parsekit

我有一个语法(包含在下面,但其他示例也是如此),我通过ParserGenApp运行并在我的应用程序中使用结果类。它失败并出现以下错误:

  Expected : }
  Line : 3
  Near : start - > 
  Found : start

然而,在同一个应用程序中,调用

PKParser   *parser = [[PKParserFactory factory] parserFromGrammar:bnr assembler:self error:&error];
PKAssembly *result = [parser parse:input error:&error];

工作正常。

语法是:

start              = graph;
graph              = strictOrEmpty graphType id '{' stmtList* '}';
strictOrEmpty      = 'strict' | Empty;
graphType          = 'digraph' | 'graph';
stmtList           = stmt (';' stmtList)* ;
stmt               = nodeDefinition | edgeDefinition;
id                 = Word;

nodeDefinition     = id '[' nodeAttributes ']';
nodeAttributes     = nodeAttribute (',' nodeAttributes)* ;
nodeAttribute      = nodeAttributeKey '=' nodeAttributeValue;
nodeAttributeKey   = Word;
nodeAttributeValue = Word;

edgeDefinition     = id edgeLinkSymbol id;
edgeLinkSymbol     = '->';

0 个答案:

没有答案