[antlr-interest] Re: saving the token stream

marcschellens m_schellens at hotmail.com
Tue Aug 19 03:28:36 PDT 2003


Sounds like what I need. Please post it (or mail it to me).
I use C++ but probably it won't be a probelm nevertheless.
thanks,
marc


--- In antlr-interest at yahoogroups.com, "Rodrigo B. de Oliveira"
<rodrigobamboo at a...> wrote:
> I have achieved something similar with a custom TokenStream
implementation
> that just records the token it receives for later playback (a
> TokenStreamRecorder).
> 
> The playback is done with a TokenStreamSelector.push(recorder). When the
> TokenStreamRecorder runs out of tokens it just pops
> (TokenStreamSelector.pop) to the previous lexer/parser.
> 
> I'm gonna post the entire sample to the antlr website later today
but I can
> email it to you privately if you want. It's C# based but you should
have no
> problems converting it to java.
> 
> Regards,
> Rodrigo
> 
> 
> ----- Original Message ----- 
> From: "marcschellens" <m_schellens at h...>
> To: <antlr-interest at yahoogroups.com>
> Sent: Monday, August 18, 2003 5:43 AM
> Subject: [antlr-interest] saving the token stream
> 
> 
> > I have a string which is parsed, but in some cases the
> > last few parsed 'commands' (within the string) must be repeated.
> > Is there a simple way to save the token stream for this purpose.
> > Of course I could write a tree parser, but for this relatively simple
> > issue, I would prefer to reuse the token stream and do all necessary
> > actions in the parser.
> > Thanks,
> > marc
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
> >


 

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




More information about the antlr-interest mailing list