[antlr-interest] Re: Rewind one token?
lgcraymer
lgc at mail1.jpl.nasa.gov
Mon Aug 16 02:29:54 PDT 2004
The reasonable solution is probably to add a token buffer to both
lexers (same buffer). Take a look at the Python grammar (at
www.antlr.org) for an example of a token buffered lexer. For your
problem, a circular buffer with fixed length would make sense.
--Loring
--- In antlr-interest at yahoogroups.com, Ingo Maier <i.maier at g...> wrote:
> Am So, den 15.08.2004 schrieb Monty Zukowski um 22:49:
> > That mechanism is for the use of syntactic predicates. See the
> > documentation on that.
> >
> > Monty
>
> Well, my question seemed to be misleading. I don't want to know where
> mark/rewind is used (a call hierarchy check tells me that, I use eclipse
> :)). I want to know, if there is a possibility to
> rewind/backtrack/whatever an already read token?
>
> I use two lexers on the same stream with a multiplexer. First lexer
> starts. When it passes a specific token (sequence) to the parser, lexers
> will be switched. But the tokens already read by the first lexer and
> indicating the switch will be needed by the second one.
>
> Any ideas how to do that?
>
> 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