[antlr-interest] Tokens as keywords

Johannes Luber jaluber at gmx.de
Sun May 4 07:35:14 PDT 2008


Jim Idle schrieb:
> statement :  FIND tableName whereClause? orderByClause?;
> 
> tableName
>    : Identifier
>    | (keywords)=>keywords
>    ;

Just one additional comment: Order alternatives in such way that the 
last alternative is the one without a syntactic predicate. Thinking 
about it further, as one would order the lexer rules in such way that 
the keywords are recognized as such, no Identifier will match a keyword 
anyway. So you can remove that predicate anyway.

Johannes


More information about the antlr-interest mailing list