[antlr-interest] Custom token set up from lexer rules

Bertalan Fodor lilypondtool at organum.hu
Thu Feb 21 15:54:32 PST 2008


Thanks, I'll also do that.

Bert

> ------- Original Message -------
> From: Johannes Luber <jaluber at gmx.de>
> To: Bertalan Fodor <lilypondtool at organum.hu>
> Sent: 08/02/22/, 0:20:25
> Subject: Re: [antlr-interest] Custom token set up from lexer rules
> 
> Bertalan Fodor schrieb:
> > Hello,
> > 
> > I would like to set up my custom token object from the lexer rules. 
> > Until now I only found one solution: set some member field in the lexer 
> > actions, then use that field in the overridden emit method. Isn't there 
> > a more elegant way for this?
> 
> Use
> 
> options {TokenLabelType=MyToken;}
> 
> instead. MyToken is a class probably derived from CommonToken.
> 
> Johannes
> 
> 


More information about the antlr-interest mailing list