[antlr-interest] Another Parser skipping error

G R relationalalgebra at gmail.com
Sun Dec 9 23:43:32 PST 2007


Ok, I didn't know that EOF was an ANTLR define token.
Thank for your help, this works fine now :-)

G.R.

2007/12/9, Randall R Schulz <rschulz at sonic.net>:
>
> On Sunday 09 December 2007 11:16, G R wrote:
> > The problem is that with Java, you don't have any end of string char
> > like \0 with C (I know, C don't know strings, just a way to
> > illustrate it). My input comes from a JTextArea, then I don't know
> > how to define my EOF token.
>
> I forget at the moment, but isn't it necessary to construct some kind of
> java.io.XYZInputStream (or XYZReader) for the ANTLR parser? If so, it
> will generate the necessary end-of-file indication (even if the
> underlying byte or character source is not literally a file).
>
> Perhaps what you're missing is the fact that EOF is built in to ANTLR,
> not something you define or supply. You simply use that built-in
> pseudo-token in your grammar productions where you want to require that
> the complete input has been consumed.
>
>
> > ...
> >
> > Thanks
> > G.R.
>
>
> Randall Schulz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071210/5a3ceb69/attachment-0001.html 


More information about the antlr-interest mailing list