[antlr-interest] changing the input while parsing

Tarun Khanna tarunkhanna at gmail.com
Wed Jul 27 13:59:36 PDT 2005


Is there a way in ANTLR to change the input while still parsing it?

I am trying to implement auto-completion in expressions. eg

a.b.

now after this if the user hits a <TAB> the whole expression including the 
<TAB> are sent to the parser for evaluation. Currently this is achieved 
using exception to bail out of the parser.

However is there a way to get back to the same state where we left off, 
while parsing and send the new replaced token to the parser instead of the 
<TAB>.


Is there a way to at-least rewind the token stream to a previous position 
and then start a rule from there on-wards?

-- 
Tarun Khanna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050727/5b579806/attachment.html


More information about the antlr-interest mailing list