[antlr-interest] Custom ast factory

Jim Crafton jim.crafton at gmail.com
Sat Oct 22 10:46:34 PDT 2005


I am trying to get my custom ast factory to work as the creator of new
AST nodes. However I don't see how to make this happen. I do the
following in my constructor :


CppASTNodeFactory() :
ASTFactory("CppASTNodeFactory",CppASTNode::factory),
nodeFactory(&CppASTNode::factory) {}

>From tracing the code, what this means is that the "factory" method
for creating node is actually the  CppASTNode::factory, which is a
static method. Is there a way to get the parser to call a member
method on the ast factory that I can then override in my custom ast
class?

Thanks!

Jim


More information about the antlr-interest mailing list