Clashing keywords and identifiers
1 posts in topic
Flat View  Flat View

Posted By:   Jono_Ward
Posted On:   Monday, November 5, 2001 12:48 PM

Hi all

I'm writing a parser for an old version of BASIC , where variable/function/array names can be the same as keywords that form the statements . Does anyone know how I can do this correctly . I wanted to just put in a semantic predicate that checks a global boolean , if true , tests for literals in my IDENTIFIER token in the lexer , else doesn't . Now I try to simply set this to false when I check for an expression , so that the identifiers in the expression can be anything (keywords) . But this does not actually work , when antlr looks ahead it does not set my boolean , so I'm a bit stuck , has anyone had this same problem ?? Thanks in advance..

Re: Clashing keywords and identifiers

Posted By:   Ric_Klaren  
Posted On:   Tuesday, November 6, 2001 12:28 AM

See this FAQ entry by Monty.
About | Sitemap | Contact