[antlr-interest] look ahead side effects on interactive parsers

Monty Zukowski monty at codetransform.com
Wed Jun 23 09:25:30 PDT 2004


I would recommend turning the input, up to and including the newline, 
into a string, make a stream out of that, and then call your parser.  
That way there will be an EOF from the stream and the parser will know 
it has all the input.

Monty

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html



On Jun 22, 2004, at 8:51 AM, clay_douglass_at_work wrote:

> I am implementing an expression parser for an interactive debugger.
> Unfortunately the generated parser causes underactivity issues. e.g.
> It doesn't return the command till I hit return twice. I guess this
> is an obvious side effect of the look-ahead k=2. I had though since
> each command pattern ended in NEWLINE that I would get command
> returned as soon as the parser saw the NEWLINE. Any helpful
> suggestion or is my plan to use ANTLR to parse the interactive
> commands just a bad idea?
>
> Thank,
>
> Clay
>
>



 
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