[antlr-interest] Newbie questions: How to traverse the AST ...

Agnisys agnisys at yahoo.com
Sun Dec 31 14:38:48 PST 2006


Andy thanks, that was helpful. I have a follow up question (very elementary again):

I need to parse text like the following:

LHS1=ABC LHS2=EFG=123 LHS3=345 

The value of LHS2 should be "EFG=123". The problem is with the "=" sign in the value. I can
understand why Antrl complains, but I'm not sure how to fix it. How to tell Antlr that the value
can contain "=" sign.

The lexer has the following:

IDENT :
 ( 'a'..'z'|'A'..'Z'|'_'|'0'..'9'|'.'|'-'|':'|'/'|','|'^'|'+'|'=' )+ 

EQUAL   : '=' ;

other code
--------------------

Any help or pointers would be appreciated.
Thanks,
Anupam.





More information about the antlr-interest mailing list