[antlr-interest] antlr & pipe

Richard Clark rdclark at gmail.com
Fri Mar 7 21:35:58 PST 2008


My trick is to create a new TokenSource wrapping the original source that
always returns EOF for any attempt to read past the end. That way, if the
parser runs out of input tokens (and more can't be had from the tokenizer),
the parser will get an EOF.
...Richard

2008/3/7 Alexandru Mosoi <brtzsnr at gmail.com>:

> I'm trying to write a program that parses gdb output as it's displayed.
> The gdb's output is sent to a pipe, from where it's read by my program.
> However the parser, after reading gdb's output hangs wainting for another
> token or EOF. But, gdb doesn't close the pipe (no EOF) and doesn't send any
> extra token. I read somewhere that I should disable lookahead, but how do I
> do that?
>
> --
> Alexandru Moşoi
> http://alexandru.mosoi.googlepages.com
>
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080307/36b62f85/attachment-0001.html 


More information about the antlr-interest mailing list