[antlr-interest] passing parts of the parse around as parameters(newbie)

Carter Cheng carter_cheng at yahoo.com
Sun Jan 25 14:23:46 PST 2009


Thanks I will try the wildcard solution it might work well enough for what i am trying. One more question w.r.t. parameter passing in rules with the C runtime.

Can I do something like the following?

rule1: type idlist[type];

idlist[.... t]: var[type] (COMMA var[type])*;

var[... t]: ID -> ^(ID $t);

I tried using ANTLR3_BASE_TREE but the last construct does not seem to work properly. What is the default return type for a rule in buildAST mode?
I apologize for the deluge of questions.

Thanks in advance,

Carter.



  




      


More information about the antlr-interest mailing list