I missed out that the implementing class should be abstract. Then you get what you ask for below. You don't want the .g file to generate an abstract class, you implement your methods in the abstract class, derive that from TreeParser, then derive your generated class from the abstract class.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Christian Pontesegger > Sent: Friday, February 26, 2010 3:07 AM > To: [email protected] > Subject: Re: [antlr-interest] Abstract tree parser > > On 25.02.2010 21:47, Jim Idle wrote: > > tree grammar IScriptTreeParser; > > options { > > language = Java; > > tokenVocab = IScript; > > ASTLabelType = CommonTree; > > SuperClass = AbstractIScriptTreeParser; > > } > > > > Still not what I'd like to have. I think I'll give it one more try: > > When finished I want to have following inheritance > > TreeParser <-- IScriptTreeParser <-- ConcreteTreeParser > TreeParser <-- IScriptTreeParser <-- AnotherConcreteTreeParser > > TreeParser > * is the ANTLR base class > > IScriptTreeParser is: > * automatically generated from my treegrammar file > * abstract public class IScriptCompiler extends TreeParser {... > } > ----^^^ > * has some abstract methods defined in @members > > ConcreteTreeParser is: > * some class I am doing on my own > * implements abstract stuff from IScriptTreeParser > > AnotherConcreteTreeParser is: > * some class I am doing on my own > * different implementation of abstract methods > > > so far I did not get a recommendation how to do that. > > any ideas? > Christian > > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
