[antlr-interest] ANTLR3 grammar problem
Marco Ladermann
marco.ladermann at gmx.de
Sat Aug 6 04:45:56 PDT 2005
Hi,
I'm not sure, if the mailing list is also the bug reporting tool ...
While playing around with ANTLR3 I found the following problem in a lexer rule
(combined grammar PGNParser.g). From the definition of a comment in the PGN
(Portable Game Notation) for chess games:
COMMENT_STRING:
'{'
( ~( '}' ) )*
'}'
;
this is generated into the PGNParser.lexer.g file (line 24)
COMMENT_STRING : '{' (~ )* '}' ;
and this is the output from ANTLR:
ANTLR Parser Generator Early Access Version 3.0ea5 (July 5, 2005) 1989-2005
0:0: syntax error: assign.types: <AST>:101:17: unexpected AST node: BLOCK
0:0: syntax error: antlr.print: <AST>:101:17: unexpected AST node: BLOCK
0:0: syntax error: define: <AST>:101:17: unexpected AST node: BLOCK
24:25: syntax error: antlr: PgnParser.lexer.g:24:25: unexpected token: )
24:32: syntax error: antlr: PgnParser.lexer.g:24:32: expecting RPAREN, found
';'
internal error: PgnParser.g : java.lang.NullPointerException
org.antlr.tool.ANTLRParser.ebnf(ANTLRParser.java:3034)
org.antlr.tool.ANTLRParser.elementNoOptionSpec(ANTLRParser.java:2221)
org.antlr.tool.ANTLRParser.element(ANTLRParser.java:2001)
org.antlr.tool.ANTLRParser.alternative(ANTLRParser.java:1827)
org.antlr.tool.ANTLRParser.altList(ANTLRParser.java:1484)
org.antlr.tool.ANTLRParser.rule(ANTLRParser.java:1215)
org.antlr.tool.ANTLRParser.rules(ANTLRParser.java:599)
org.antlr.tool.ANTLRParser.grammar(ANTLRParser.java:269)
org.antlr.tool.Grammar.setGrammarContent(Grammar.java:372)
org.antlr.Tool.process(Tool.java:187)
org.antlr.Tool.main(Tool.java:62)
Marco
--
KISS - keep it small and simple
More information about the antlr-interest
mailing list