At 00:21 22/01/2010, =?koi8-r?B?4NLV28vJziDtycjBycw=?= wrote:
 >type_declaration_stmt
 >   : label? declaration_type_spec ( (T_COMMA  attr_spec )*
 >T_COLON_COLON )?
 >     entity_decl (T_COMMA entity_decl)* end_of_stmt           
 >     -> ^(T_TYPE_DECLARATION_STMT declaration_type_spec 
attr_spec*
 >entity_decl)+
 >   ;
[...]
 >BUT declaration_type_spec subtree isn't dublicated (only the 
root
 >of subtree).
 >
 >Where is mistake?

IIRC, when you use a rule name in a rewrite rule, it represents 
"the first unused instance of this rule in the input" (which is 
why entity_decl is doing what it is).  So the second and 
subsequent times it appears (during the + loop) the value is empty 
since it didn't occur any more times in the input.  To duplicate 
nodes you need to use a label.


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