[antlr-interest] Conditional tree parsing

VAUCHER Laurent VAUCHER at fermat.eu
Thu Nov 2 00:20:46 PST 2006


  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.



More information about the antlr-interest mailing list