[antlr-interest] Newbie Question

Behdad Forghani behdad.forghani at samsarasol.com
Mon Mar 16 16:01:20 PDT 2009


Hello,

I am trying to built AST from a rule with an optional part.
The rule is:

type :
	builtinType  constraint?;


I want the constraint node to be the child of builtinType. So, I add:

type :
   builtinType  constraint?->^(builtinType constraint?);

I also tried:

type :
   builtinType ^ constraint?;


But, none of them seem to work. Can you tell me what I am doing wrong?


Thanks



More information about the antlr-interest mailing list