[antlr-interest] super grammar surprise

Lloyd Dupont lloyd at nova-mind.com
Wed May 25 17:02:43 PDT 2005


Good idea!
...
For C program.....!! :(

----- Original Message ----- 
From: "Bryan Ewbank" <ewbank at gmail.com>
To: "ANTLR Interest" <antlr-interest at antlr.org>
Sent: Thursday, May 26, 2005 9:57 AM
Subject: Re: [antlr-interest] super grammar surprise


Trust in the #include to preserve behaviors...

class MyBlurfl extends MyParser
{
#include "commoncruft.foo"
}

T'would be nice if there were either true class inheritance, or
multiple inheritance to capture non-production behaviors.


On 5/25/05, Lloyd Dupont <lloyd at nova-mind.com> wrote:
>
> mmhh... I guess it's a feature, as it let you 'override' the declared 
> code.
> well I have to copy paste I suppose....
>
> BTW if I don't declare any class code in my subgrammar the supergrammar
> class code is used, sweet ;)
>
>
> ----- Original Message ----- 
> From: Lloyd Dupont
> To: antlr-interest at antlr.org
> Sent: Thursday, May 26, 2005 9:24 AM
> Subject: [antlr-interest] super grammar surprise
>
>
> I'm writting a subgrammar of the GNU-C grammar.
> I don't know if my problem is due to a 4 level inheritance (Parser ->
> StdCParser -> GnuCParser -> ObjectiveCParser) but anyway, I had the 
> surprise
> that the class code (as in:
>     class MyParser extends Parser;
>     {
>         // class code
>     }
>     idList : ( ID )+;   // parser rule definition
> ) is not passed on the subclass?!
> Is it a bug or a feature? 



More information about the antlr-interest mailing list