[antlr-interest] Re: Rewind one token?
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.
--- 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?
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest