Upgrading from v3.2 to v3.3, I started loosing the leaves in some of my
rules.  All affected rule-pairs have the same structure: The results of
called rule becomes the root of the AST returned by the rule doing the
calling AND the calling rule adds more nodes to the AST (not just returning
the results of the called rule).  In the example below, the result of
matching the "call" rule is truncated to just its root when it is referred
to in the construction of the AST for "callTarget."  I feel like I am
missing something simple, but I can't figure out what part of the v3.3
release notes covers this circumstance.

3.2 output: (FUNCTION first second third PACK)
3.3 output: (FUNCTION PACK)

-Joseph A. Cottam


input------------------------
first second third

grammar-------------------
grammar Error;

options {
  language = Java;
  output=AST;
}

tokens {FUNCTION; PACK;}

callTarget
 : call
    -> ^(call PACK)
 ;

call
  : one=ID two=ID three=ID
    -> ^(FUNCTION $one $two $three)
  ;

ID    : ('a'..'z' | 'A'..'Z' | '_') ('.'? ('a'..'z' | 'A'..'Z' | '_' |
'0'..'9'))*;
WS  : (' '|'\r'|'\t'|'\u000C'|'\n')+ {skip();};

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to