[antlr-interest] Inject Lexer Tokens before parsing further

Gavin Lambert antlr at mirality.co.nz
Fri Apr 10 04:19:04 PDT 2009


At 12:45 10/04/2009, Des Hartman wrote:
>1) =-5+4
>2) -5+4
[...]
>cell
>: formula EOF
>| EOF
>;
>
>formula
>: EQ expression
>| PLUS expression
>| MINUS expression
>;

Instead just use this:

cell
   : formula? EOF
   ;

formula
   : EQ? expression
   ;



More information about the antlr-interest mailing list