[antlr-interest] discrepancy between antlrworks and antlr generated parser
Gavin Lambert
antlr at mirality.co.nz
Thu Apr 9 01:20:50 PDT 2009
At 19:10 9/04/2009, Indhu Bharathi wrote:
>WS: (' ' | '\n' | '\r' )+ {$channel=HIDDEN};
>
>This should give you compile error. There must be a ';'
>immediately after 'HIDDEN'. ( {$channel=HIDDEN;} )
Python doesn't require semicolon statement terminators, does
it? If not, then what the OP had is correct -- assuming that the
code generator gets the indentation right :)
>Are you using tab instead of space in input?
Another possibility is some kind of interpreter vs. debugger
weirdness. ANTLR's interpreter mode is fairly useless (in that it
often does the wrong thing); you should use the Debug Remote
option to test your grammars from ANTLRworks. (Or Debug, but that
only works for Java-target grammars.)
More information about the antlr-interest
mailing list