[antlr-interest] find and go back to same place.

Andrei Timisescu andreitim at yahoo.com
Mon Dec 22 01:28:53 PST 2003


I think I experienced something like this when I implemented a SIP/MGCP parser.
 
Try saving the lexer context with

int posInLexer = ((antlr::CharScanner*)(selector->getCurrentStream()))->mark();

and restore it when you want with

((antlr::CharScanner*)(selector->getCurrentStream()))->rewind(posInLexer);

See if the parser token stack has a valid state.
 
 
regards
Andrei

"Nijesh Panchratna, Noida" <nijesh at noida.hcltech.com> wrote:
Hi !!!
In the middle of file parsing,I need to search a word(let's say $ROLE) in
the same file,store the value of that word and again start the parsing from
the same location where I had left earlier.
Actually, right now after searching $ROLE, parsing gets start from this
word($ROLE) onwards.Thus skips some lines of file.
How can I go back to the same place which I had left for searching keyword?
I hope someone will definitely help me.

regards
Nijesh



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/ 



---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20031222/d0f0be6b/attachment.html


More information about the antlr-interest mailing list