problem Keyword token antlr

Posted by batman_for on Stack Overflow See other posts from Stack Overflow or by batman_for
Published on 2010-04-26T19:13:56Z Indexed on 2010/04/27 6:53 UTC
Read the original article Hit count: 306

Filed under:
|
|
|
|

If the 'for' is used both as a command and as "the English word":

for_statement: 'for' ...

id: 'for'
  | ID
  ;

ID: ...

right? My problem is how to differentiate the two cases. For example for_statement is only possible beginning of a line (only if preceded by ' ' or '\t').

Thanks.

© Stack Overflow or respective owner

Related posts about parser

Related posts about antlr