[antlr-interest] Expr example in Wiki compile error Eclipseusing ANTLRworks
Terence Parr
parrt at cs.usfca.edu
Sat Dec 16 16:43:17 PST 2006
On Dec 16, 2006, at 4:35 PM, Foolish Ewe wrote:
> Hello All:
>
> Thanks Ter, my initial thought was I had made some sort of error,
> but was just too dense to see it.
> Given the amount of improved functionality the ANTLR folks are
> introducing in ANTLR3
> and ANTLRworks, I am actually pleased with how robust the
> environment is and how fast
> fixes are applied in when something is discovered.
Thanks! we are getting closer and closer to a final release, but I'm
fixing bugs only when they interfere with what I am typing in the
book. ;) My deadline is essentially end of January for the book in
order to get it published and in stores by May. then I will devote
full time to getting a full 3.0 release out.
> I have an additional question about the example grammar, the lexer
> and perhaps Eclipse itself.
> The example, Expr appears to hang when I run it in Eclipse, and
> I've added debugging
> output and actions to all non terminals (Please see attached
> source for details).
> In the trace for Expr in the wiki, it appears to read until it
> reaches EOF, I've tried entering
> ^D (control D) into the Eclipse console window but that doesn't
> seem to trigger the EOF
> condition, nor do I see any of the expected output. Running it in
> the debugger seems to indicate
> that the ANTLRInputStream constructor does not terminate. Why is
> that?
>
> My questions are:
> 1) Have I somehow screwed things up that the symptoms I'm seeing
> are my own fault?
I think eclipse probably does not know how to say EOF. Convert to
use ANTLRFileStream and pass it a file name with that input.
> 2) In Eclipse, is it possible to pass an EOF to System.in? (not an
> Antlr question, but maybe I'll
> get lucky).
Some eclipse guy can tell, but I cannot ;)
> 3) If I want to limit buffering to one line of input at a time, is
> there some other input class
> I should be using in ANTLR.
Right now, ANTLR sucks everything in by default. I believe people are
working on some on-demand stuff.
Ter
More information about the antlr-interest
mailing list