[antlr-interest] Simple expression grammar

Felix Dorner felix_do at web.de
Wed May 14 04:59:23 PDT 2008


Maciej Bakalarz wrote:
> I need to parse expressions which are using nested parenthesis, like:
> "( a>=3 || b<=4 ) && c>=4" or "((a>=3 || b<=4) && c>=4) || a>=3 )"
>
What happens if you change this:
>
> expression
>     : ALFANUM
>     ;

to this:

  expression
       : ALFANUM | '(' prog ')'

Felix




More information about the antlr-interest mailing list