[antlr-interest] BUG (JAVA): Generics not permitted in Antlr rule parameter lists

Kay Röpke kroepke at classdump.org
Sun Nov 11 07:09:04 PST 2007


hi!

On Nov 11, 2007, at 12:35 PM, Johannes Luber wrote:

> Austin Hastings wrote:
>> testCase[String m1, String m2, List<TestCase> tests]
>>  produces a call like
>>
>> testCase(m1, m2,  , tests);
>>
>> and a build failure, etc.

> That's already known - at least for arrays. It could be also that the
> generated Java is only for 1.4. If it is the first cause then I'm not
> sure when it is fixed, though. It was planned for 3.1, but as Ter  
> won't
> release a 3.0-based ANTLR as soon as he thought, it may be a later  
> release.

This problem is strictly a problem with the ANTLR grammar itself.
It doesn't recognize the generic type and does the wrong thing.
Too much a pain to integrate into the existing v2 grammar, so Ter  
postponed it.

The generated code (without generics) works fine with 1.5, though.
I'd use the workaround Johannes mentioned.

cheers,
-k

-- 
Kay Röpke
http://classdump.org/








More information about the antlr-interest mailing list