[antlr-interest] AST cardinality from called rules

Graham Mer gd.antlr at gmail.com
Tue Apr 5 19:58:57 PDT 2011


Problem solved. Thanks for the replies, the parameterized version does
exactly what I need:


localVariableDeclaration:
  :  LOCAL! variableDeclarationList[LOCAL]
  ;

variableDeclarationList[int type]
  :  variableDcl ( ',' variableDcl )*
    -> {type == LOCAL}? ^(LOCAL variableDcl)+
    -> // others
  ;


More information about the antlr-interest mailing list