[antlr-interest] Interpreter output inconsistent for"Cstylemethod calls"

Thomas Brandon tbrandonau at gmail.com
Wed Jul 25 08:51:42 PDT 2007


Sorry yes, this does appear to be a bug (or at least a limitation),
either in ANTLR's interpreter stuff or in ANTLRWorks' display stuff.
Though I think you are incorrect that one case works correctly in the
interpreter. I gather here you mean starting with method generates
identical results, but (for me) this is not so. While it gets further
it still terminates early, with the closing RPAREN of the arguments
for MODULUS not being matched.
While there are errors in your grammar these do not appear to be the cause.
Your grammar does not properly handle the whitespace you have used
(note the errors in the debugger) but the interpreter, like the
debugger, just ignores lexer errors and continues from the next
character and when started from method gets past these, so they aren't
the problem.
There is also a lack of a well defined start rule which ANTLR warns
about but adding:
start
	:	expression+ EOF
	;
does not fix the interpreter. Running start rule proceeds identically
to the debugger but when running method or statement the interpreter
terminates early.
So this does appear to be either a bug or limitation in the interpreter.

Tom.
On 7/26/07, Jim Idle <jimi at temporal-wave.com> wrote:
> If you genuinely believe it to be so, then you should use the feedback
> menu option and submit the grammar and an explanation.
>
> Jim
>
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> > bounces at antlr.org] On Behalf Of Buck, Robert
> > Sent: Wednesday, July 25, 2007 8:00 AM
> > To: Thomas Brandon; antlr-interest at antlr.org
> > Subject: Re: [antlr-interest] Interpreter output inconsistent
> > for"Cstylemethod calls"
> >
> > If you "Display as Graph" in the interpreter and run the input through
> > 'expression' and 'method' you get different graphs showing up. The
> > graphs should ordinarily look identical to what shows up under the
> > debugger, and in one case it is identical. But this is a bug, so it
> > would appear.
>
>
>


More information about the antlr-interest mailing list