[antlr-interest] Possible problem with lists after upgrade to 3.1

Terence Parr parrt at cs.usfca.edu
Tue Aug 12 18:17:51 PDT 2008


On Aug 12, 2008, at 6:10 PM, Grzegorz Cieslewski wrote:

> Hi,
>
> In 3.1b2 (as included in antlrworks 1.2b5) the following seem to work:
>
> Case1:
> (listA+=number | listA+=id)+ -> ^(EXPR $listA+)
>
> On the other hand this syntax properly compiles but crashes on runtime
> Case2:
> (listA+=(number | id))+ -> ^(EXPR $listA+)
> Exception in thread "main"  
> org.antlr.runtime.tree.RewriteEarlyExitException
> 	at G4Parser.expr(G4Parser.java:238)
> 	at __Test__.main(__Test__.java:14)

Weird...i thought sets were always broken (still)...hmm...oh, syntax  
is ok but runtime not yet.

so, for now, manually add to list :(

>
>
> When compiled with 3.1 I get errors:
> In Case1:
> ANTLR Parser Generator  Version 3.1 (August 12, 2008)  1989-2008
> G4Parser.java:88: incompatible types
> found   : G4Parser.number_return
> required: G4Parser.id_return
>            	    listA=number();

Oh shit...i changed that to be more specific but now it's tied to what  
rule you call; for += you actually only care it's a rule. crap!  That  
is an issue.

Ter


More information about the antlr-interest mailing list