Monday, November 5, 2001 12:48 PM
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..