[antlr-interest] rule classDef trapped: unexpected token: IDENTIFIER

Sohail Somani sohail at taggedtype.net
Sun Nov 6 09:55:38 PST 2005


On Sun, 2005-06-11 at 12:35 -0400, Peter-Frank Spierenburg wrote:
> Greetings,
> 
> The TreeParser in the following grammar is giving me some problems. I
> would actually prefer to have resourceTypeIdentifier in place of
> IDENTIFIER in the toSQL rule, but
> 
> "The root of a tree pattern must be a token reference, but the children
> elements can even be subrules." from
> http://www.antlr.org/doc/sor.html#_bb1

> class QueryTreeWalker extends TreeParser;
> toSQL : #( IDENTIFIER ) ;

replace toSQL with 

toSQL : IDENTIFIER;

You can't have a tree with no children afaik.



More information about the antlr-interest mailing list