[antlr-interest] Syntax for token accumulation

Olivier Lefevre lefevrol at yahoo.com
Thu Mar 20 17:55:44 PDT 2008


Assume ID is a valid lexer token. (list+=ID)* works as you'd expect but 
(list+=(tok=ID))* does not, although it compiles: when the rule exits the 
list in question is null. I had a look at the Java code and the list is 
indeed not even initialized. Even merely parenthesizing ID as in: 
((list+=(ID))* gives the same null result. It would be useful for this 
syntax to be supported, though. Is it indeed an ANTLR limitation?

Thanks,

-- O.L.



More information about the antlr-interest mailing list