[antlr-interest] "new CommonToken" issued in Java target in spite of setting TokenLabelType to something else

Terence Parr parrt at cs.usfca.edu
Thu Aug 2 12:44:25 PDT 2007


On Aug 2, 2007, at 11:06 AM, Hardy, Stephen wrote:

> There seems to be a bug in the Java target string template.  Even  
> though
> I set TokenLabelType = MyToken in the parser/lexer options, the lexer
> template is generating code like
>
>             MyToken DECIMAL_LITERAL1=null;
> 		...
>             DECIMAL_LITERAL1 = new CommonToken(input,
> Token.INVALID_TOKEN_TYPE,
>                  Token.DEFAULT_CHANNEL,
>                  DECIMAL_LITERAL1Start1480, getCharIndex()-1);		
>
> (which causes a type mismatch compile error) for .g file input like

Ack. added bug:

http://www.antlr.org:8888/browse/ANTLR-170

Ter


More information about the antlr-interest mailing list