I have a tree walker like this:
function:
^(FUNCTION_TOK fcname=IDENTIFIER param=functionParameters*){
a_param_arrayList.add(param);
}
;
functionParameters returns [Object sth]:
^(PARAM_TOK value=IDENTIFIER){ sth = $value.getText();}
;
This is a simple scenario,I just want to add the parameters to an arraylist, but the code above(a_param_arrayList.add(param)) will only collects the first parameter and ignores the others.But functionParameters actually parases multiple parameters.
Does anyone know how to fix this tree walker?
Thanks very much!
I solve this problem by using arguments of rules.