[antlr-interest] heterogeneous trees and importing vocabularies (v2.7.x)

Bryan Ewbank ewbank at gmail.com
Mon Feb 13 06:26:57 PST 2006


Have a C++ code-generation question (but have a bad feeling about it :-)...

I am using importVocab for my parser and all the tree parsers; I am
now starting to consider using a heterogeneous tree.  My problem, and
the question, is

Are heterogeneous trees and the importVocab option mutually exclusive?
 The error I get when I add a tokens{} section to a grammar seems to
imply that is so.

To push a bit further, is there any way folks have come up with to use
templated types as the AST types?
   // this goes boom (error "excepting CLOSE_ELEMENT_OPTION, found '<' ")
   tokens {
      PLUS<AST=Node<PLUS> >;
   };

Stumped,
- Bryan


More information about the antlr-interest mailing list