[antlr-interest] Abstract tree parser

Terence Parr parrt at cs.usfca.edu
Tue Feb 23 12:15:58 PST 2010


You can either define abstract methods within @members and then subclass the parser or you can create a subclass of Parser with the abstract methods or concrete methods then use superClass. Also note you can create an interface for a delegate object.
Ter
On Feb 23, 2010, at 12:04 PM, Daniels, Troy (US SSA) wrote:

> 
> 
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org 
>> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of 
>> Christian Pontesegger
>> Sent: Tuesday, February 23, 2010 2:46 PM
>> To: antlr-interest at antlr.org
>> Subject: [antlr-interest] Abstract tree parser
>> 
>> Hi,
>> 
>> I am creating a treeparser in java which needs some methods. 
>> I do not want to put them into the @members section as the 
>> code is quite large.
>> Is there a way to create an abstract class for the parser? 
>> Then I could put the the abstract methods into the @members 
>> section and implement them in a subclass.
>> 
>> Is there a way to do that?
>> 
> 
> I don't think there's a way to do that.  However, you can write an abstract parser with your methods and then specify that as the parent class of the parser.  That should have the effect you desire.  Your class would need to extend a specific Antlr class.  Check the docs for more details.
> 
> Troy
> 
>> thanks
>> 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



More information about the antlr-interest mailing list