private Expr Conditional() { Expr expression = Equality(); if (Match(TokenType.Question)) { Expr thenBranch = Expression(); Consume(TokenType.Colon, "Expect ':' after then branch of conditional expression."); Expr elseBranch = Conditional(); expression = new Expr.Conditional(expression, thenBranch, elseBranch); } return(expression); }
string Expr.IVisitor <string> .Visit(Expr.Conditional conditional) { return(Parenthesize("Conditional", conditional.thenBranch, conditional.elseBranch)); }
public object Visit(Expr.Conditional _conditional) { return(null); }
public object Visit(Expr.Conditional conditional) { throw new NotImplementedException(); }