[antlr-interest] Bug in antlr.g?

Terence Parr parrt at cs.usfca.edu
Mon Aug 2 09:44:15 PDT 2004


Hi. :)

Well, this is antlr itself, right?  so it is fine using purely 
commontoken...it's in the generated parsers that it needs to be 
sensitive I would say.

Ter

On Aug 2, 2004, at 6:53 AM, Ingo Maier wrote:

> 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
>
>
>
>
>





 
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