[antlr-interest] (no subject)
Jan Vlegels
jan_vlegels at hotmail.com
Thu Nov 16 08:06:01 PST 2006
Hello,
I created my own AST node type, which extends the default CommonAST node
type. In the documentation i read that i should set the ASTLabelType option
in my grammar so the generated parser knows which type of nodes he should
create.
When i check the generated code of the parser after compiling my grammar, i
can't find where the parser sets the ASTFactory to make nodes of the type i
created. The parser just casts the nodes of type CommonAST created by the
ASTFactory to my node type. But, the problem in that case is that the
ASTFactory does not call the initialize methods of my node type, which
execute some extra logic, but the initialize methods of CommonAST node type.
So at the end, i think, there is an AST with nodes of my type, but they
will not contain the correct information because neither of the initialize
methods from my node type were used. Am i right?
Thank you for helping me,
JV
_________________________________________________________________
In 2 tellen een GRATIS online foto dagboek http://spaces.live.com/
More information about the antlr-interest
mailing list