[antlr-interest] AST node

Henry Butowsky henryb at ntlworld.com
Mon Jun 18 08:44:54 PDT 2007


Hi Guys,
I need my tree parser to add the child node "NORET" to  an expression

text :  a0=cos(pi=3.14159));
tree:             ( EXPR ( = a0 ( cos ( func_arg ( = pi 3.14159 ) ) ) ) )
New Tree :   ( EXPR ( = a0 NORET ( cos ( func_arg ( = pi 3.14159 ) ) ) ) )



text:  f1[$lon]={1,2,3,4.0}
tree:  ( EXPR ( = ( f1 ( dmn_list lon ) ) ( value_list 1 2 3 4.0 ) ) )
New Tree: ( EXPR ( = ( f1 ( dmn_list lon ) NORET ) ( value_list 1 2 3 
4.0 ) ) )

How do I create the child node & how do I add it to the tree.
I've looked at all the create methods in ASTFactory but they seem to 
require some ASTPair thing.
All the methods in AST.hpp are for an existing Ref

Help please

Regards Henry






More information about the antlr-interest mailing list