[antlr-interest] Duplicate members when generating code with 2 import levels in Java with ANTLR-3.1.1

Terence Parr parrt at cs.usfca.edu
Mon Oct 27 16:51:36 PDT 2008


was wondering that myself, but there is likely issues with the  
delegation impl. model I'm using.  We can start with an error and see  
what comes up.  I'm worried about lexers a bit.
Ter
On Oct 27, 2008, at 4:47 PM, Loring Craymer wrote:

> Ter--
>
> Should it be an error, though?  I do not see a strong likelihood of  
> circular dependencies, but if we extend Laurent's example to have  
> another subgrammar (imported by C) P3 that imports P1 but does not  
> overlap P2, shouldn't P2 and P3 use the same instance of P1 to avoid  
> a similar collision?  It seems to me that this would be quite common  
> when P1 is, say, an expression grammar and that the composition  
> machinery should make this "just work".
>
> Cheers!
>
> --Loring
>
>
>
> ----- Original Message ----
>> From: Terence Parr <parrt at cs.usfca.edu>
>> To: Loring Craymer <lgcraymer at yahoo.com>
>> Cc: Laurent Caillette <laurent.caillette at gmail.com>; antlr-interest  
>> Interest <antlr-interest at antlr.org>
>> Sent: Monday, October 27, 2008 4:09:53 PM
>> Subject: Re: [antlr-interest] Duplicate members when generating  
>> code with 2 import levels in Java with ANTLR-3.1.1
>>
>>
>> On Oct 27, 2008, at 4:04 PM, Loring Craymer wrote:
>>
>>> Ter--
>>>
>>> Just my 2 cents, but shouldn't duplicate imports be supported at the
>>> language level, as is true for Java, C#, and even C/C++ with the
>>> usual #ifdef wrapping?  It seems to me that leaving dependency
>>> management to the user limits the convenience of composition.
>>
>> hi. just haven't had a chance to write the graph dependency checker,
>> looking for duplicates. It should really give an error.
>>
>> Ter
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



More information about the antlr-interest mailing list