For left associative grammars use:
term := (prod sepratedBy: $+ asParser trim) foldLeft: [ :a :op :b |
...]
For correct associative grammars use:
raise := (prod sepratedBy: $^ asParser trim) foldRight: [ :a :op :b |
...]
Alternatively, you can see PPExpressionParserwhich automatically processes all the details. You simply say which operators are left-associative, right-associative, prefix or postfix operators. Take a look at the class comment for an in-depth discussion.