[antlr-interest] Heterogenous nodes

Liviu U liviu.u at gmail.com
Mon Feb 23 05:09:02 PST 2009


Hi all, i am back to antlr after version 3, an i have a program
regarding heterogenous trees.

I am using C# targets. If i use a REAL token with a custom node name
the tree is fine.
If i use a Virtual Node the tree is broken:

tokens
{
 USING='using';
 USING_VNODE;
....
}

Ok:
           USING  identifier (ASSIGN identifierStar)? SEMI
		->
		^(USING<NodeUsing> identifier identifierStar?)

Broken:
     USING  identifier (ASSIGN identifierStar)? SEMI
		->
		^(USING_VNODE<NodeUsing> identifier identifierStar?)

the NodeUsing is just a descendant of CommonTree

Am i missing something. There is no information on this...


More information about the antlr-interest mailing list