[antlr-interest] Composing tree grammars

Andreas Meyer Andreas.Meyer at smartshift.de
Fri Feb 6 11:01:29 PST 2009


Hi!

 

I am using ANTLR 3.1 and I want to compose tree grammars in a way, that I
have one "base" grammar that contains all rules, in order to define a
traversal, but without actions/rewrites. Then, a second grammar imports the
"base" grammar, and overrides only some rules. Now, if I try to use the
second grammar on the input, the ANTLR runtimes complain about mismatched
input: it seems that internally, the walker does not consume enough tokens,
so that it expects the tokens "behind" the current token. FYI, I used the
java/simplecTreeWalker example from the antlr 3.1 distribution and basically
copied the walker, spelled "import ." and removed all but one rule from the
copy.

 

Did I use composite tree grammars in a wrong way? If so, how can I define
multiple tree grammars for only small parts of the grammar?

Andreas Meyer
Developer
_____
smartShift
smartShift GmbH
Willy-Brandt-Platz 6
68161 Mannheim
T +49 (0)621 / 400 676-09
F +49 (0)621 / 400 676-06
E:  <mailto:katja.reinig at smarshift.de> andreas.meyer at smartShift.de

 <http://www.smartshift.de/> smartshift.de

Information contained in this message is confidential and may be legally
privileged. If you are not the addressee indicated in this message (or
responsible for the delivery of the message to such person), you may not
copy, disclose or deliver this message or any part of it to anyone, in any
form. In such case, you should delete this message and kindly notify the
sender by reply Email. 
Opinions, conclusions and other information in this message that does not
relate to the official business of smartShift shall be understood as neither
given nor endorsed by it.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090206/e2dc768b/attachment.html 


More information about the antlr-interest mailing list