[antlr-interest] ast problem
Bryan Ewbank
ewbank at gmail.com
Thu Mar 10 02:43:10 PST 2005
We need more information. What is the root node to be, since it is
not the typedef?
If you have something like this:
statement
: ...
| TYPEDEF^ a:name b:type
;
Then a and b are children of the same node - the TYPEDEF node. So,
you can overwrite the name and type of that root node if you want, or
you can leave it.
The sequence you want is probably
#( #[TYPE,"NAME"], #a, #b );
but you already have that - with the TYPEDEF as the root of this small tree.
Hope this helps,
- B
On Thu, 10 Mar 2005 10:37:31 +0100, Koen Segers <koensegers at scarlet.be> wrote:
> I want to remove an astnode typedef with childeren a and b, and
> insert the a and b node. How do I do this?
>
> ##=#(null,#i); //gives only b (a removed)
> ##=#(##,#i); //gives a as child of b.
>
> I just want a and b to be childeren of the same root.
More information about the antlr-interest
mailing list