[antlr-interest] Bug in antlr.g?

Ingo Maier i.maier at gmx.de
Mon Aug 2 06:53:28 PDT 2004


Hi there,

in the ACTION lexer rule a CommonToken is instantiated directly:

CommonToken t = new CommonToken(_ttype,$getText);
t.setLine(actionLine);
t.setColumn(actionColumn);
$setToken(t);

Shouldn't this be:

Token t = makeToken(_ttype);
t.setText($getText);
t.setLine(actionLine);
t.setColumn(actionColumn);
$setToken(t);

?

Otherwise, different token types cannot be used, e.g. with
TokenStreamRewriteEngine which needs TokenWithIndex.

Thanks,
Ingo




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list