[antlr-interest] ANTLR v3.1.1 released

Randall R Schulz rschulz at sonic.net
Thu Oct 2 10:25:49 PDT 2008


On Thursday 02 October 2008 10:06, Randall R Schulz wrote:
> On Thursday 02 October 2008 09:57, Terence Parr wrote:
> > On Oct 2, 2008, at 7:08 AM, Randall R Schulz wrote:
> > > On Thursday 02 October 2008 06:48, Randall R Schulz wrote:
> > >> On Wednesday 01 October 2008 14:36, Terence Parr wrote:
> > >>> 3.1.1 released:
> > >>
> > >> I'm starting a new parser and upgraded (to 3.1, yesterday and
> > >> then to 3.1.1, later yesterday...). Anyway, I was wondering if
> > >> the ANTLR command-line interface (org.antlr.Tool#main(), i.e.)
> > >> gives a non-zero exit code when there was an error during
> > >> processing of the ".g" files?
> > >>
> > >> ...
> > >
> > > Empirical testing suggests the answer is "no."
> > >
> > > Wasn't this going to be addressed a long time ago? It's very
> > > kludgey to
> >
> > I thought so...did you get a error or warning?
>
> Regardless of whether ANTLR liked the grammar specification or not,
> the exit status is always 0.

It just got worse.

I've got a rule that refers ambiguously to itself in a tree building 
construct:

op790Formula
    :   (op780Formula -> op780Formula)
        (
            Or rDisjunct = op790Formula
        ->  ^(Or $op790Formula $rDisjunct)
        ) ?
    ;

ANTLR tells me this:

error(132): P9.g:581:11: reference $op790Formula is ambiguous;
	rule op790Formula is enclosing rule and referenced in the production
	(assuming enclosing rule)


Now it says it assumed the enclosing rule, which is what I want, so I 
figure the resulting code would be OK (and it does generate the usual 
complement of Java source files), but since this is labelled as an 
error, not a warning, my script thinks it cannot go on to run Ant to 
build the class files.


Randall Schulz


More information about the antlr-interest mailing list