[antlr-interest] Need help regarding parser

Gavin Lambert antlr at mirality.co.nz
Fri Apr 4 12:41:46 PDT 2008


At 04:15 5/04/2008, elango m wrote:
>In our parser we used to convert the following expression
>NOT VAR1 = VAR2
>to
>NOT ( VAR1 = VAR2 )
>while parsing (since the earlier one is wrong).
>
>Now I want to do this with ANTLR. How do I do that?

Probably the easiest way to do it is to wait until you've 
generated the full AST and then scan it for erroneous constructs 
like the above and replace them with the correct versions.  After 
all, it's still valid syntax, it's the semantics that are wrong.



More information about the antlr-interest mailing list