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.