[antlr-interest] Jump over nodes in tree construction

marc schellens m_schellens at hotmail.com
Mon Mar 14 06:06:36 PST 2005


Hello,

could somebody please point out to me what is wrong with the following rule?
Ie. How to skip nodes in the output tree properly?

unbrace_expr!
	: ex:expr
		{
            // remove last pair of braces
            if( #ex->getType()==EXPR)
                #unbrace_expr= #( NULL, ex->getFirstChild());
            else
                #unbrace_expr= #( NULL, ex);
		}

Thanks,
marc




More information about the antlr-interest mailing list