Thank you all.
My final solution is
#(IF_TOKEN t=boolean_expression thenAst:. elseAst:.)
{ val = this.expression(t ? thenAst : elseAst); }
where
- expression is the main rule and
- boolean_expression only casts expression to a boolean
Laurent.