[antlr-interest] Problem duplicating nodes

v r soth1985 at yahoo.com
Mon Nov 26 06:50:55 PST 2007


I have a rule
   
  struct_declaration
 : fs=fully_specified_type struct_declarator ( COMMA struct_declarator )* SEMICOLON ->^(STRUCT_FIELD $fs struct_declarator)+
 ;
   
  which should duplicate types for every identifier in a list (like 'int x,y,z[]')
  the problem is that type subtree appears only in the first node 'x',
  but if i write
  struct_declaration
 : fs=fully_specified_type struct_declarator ( COMMA struct_declarator )* SEMICOLON ->^(STRUCT_FIELD {$fs.tree} struct_declarator)+
 ;
   
  all goes as expected. Aren`t these two rules supposed to be equivalent?

       
---------------------------------

Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071126/f3efa9d7/attachment.html 


More information about the antlr-interest mailing list