[antlr-interest] Lexer syntactic predicate bug

Gavin Lambert antlr at mirality.co.nz
Fri Mar 16 13:56:22 PDT 2007


At 07:40 17/03/2007, Allen Short wrote:
 >LT:
 >       '<' ' '*
 >   |  ('<' IDENT) =>
 >       '<' IDENT '>';
 >
 >IDENT:    'a'+;
 >
 >
 >Produces the following error:
 >
 >error(100): x.g:0:0: syntax error: buildnfa: <AST>:5:8: 
unexpected
 >AST node: synpred1

Actually I half agree with it :)  It seems a bit odd to me to use 
a synpred as the final alt, especially when there shouldn't be any 
ambiguity with the first alt.

Probably shouldn't produce an error, though.



More information about the antlr-interest mailing list