Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools Pccts > Antlr 2.7.6 gra...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 112 of 134
Post > Topic >>

Antlr 2.7.6 grammar inheritance combined with class inheritance

by "Boris" <boris.partensky@[EMAIL PROTECTED] > Feb 27, 2006 at 10:07 AM

I am trying to extend a grammar by using Antlr grammar inheritance. The
class I am trying to extend has a rich set of ANTLR rules as well as
non-ANTLR C++  methods. Ideally I would like to inherit non-ANTLR
methods and override some of them (have my CPP class derive from
superclass). At the same time I would like to preserve ANTLR sup****t
for grammar inheritance.
Now, seems like classDef antlr rule does not allow for that. One can
either do grammar inheritance:

class MySubClassTreeParser extends SuperclassTreeParser;

or C++ inheritance:

class MySubClassTreeParser extends TreeParser("SuperclassTreeParser");

but not both. If I have

class MySubClassTreeParser extends
SuperclassTreeParser("SuperclassTreeParser");

I get:

ANTLR Parser Generator   Version 2.7.6 (2005-12-22)   1989-2005
..\expandedrewrite_query_oracle.g:13:39: rule classDef trapped:
..\expandedrewrite_query_oracle.g:13:39: expecting "Parser", found '('
error: aborting grammar 'unknown grammar' due to errors
Exiting due to errors.

Thanks in advance.
 




 1 Posts in Topic:
Antlr 2.7.6 grammar inheritance combined with class inheritance
"Boris" <bor  2006-02-27 10:07:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 1:11:30 CDT 2008.