[antlr-interest] custom TokenLabelType and EOF/Error tokens

Gavin Lambert antlr at mirality.co.nz
Tue Nov 10 23:23:37 PST 2009


At 17:34 11/11/2009, David-Sarah Hopwood wrote:
 >On closer investigation, it seems that this problem is due to
 >CommonTokenStream using Token.EOF_TOKEN, which is hardcoded to a
 >CommonToken.

It's probably not too surprising that CommonTokenStream expects to 
have a stream of CommonTokens... :)

Does deriving your custom token type from CommonToken sort out the 
problem?  If so, then things are as I'd expect; if not, that might 
be a codegen bug.



More information about the antlr-interest mailing list