public void visit(IfCommand that) { Console.Write("if ("); that.Expression.visit(this); Console.WriteLine(")"); that.If.visit(this); Console.WriteLine("else"); that.Else.visit(this); }
public void visit(IfCommand that) { that.Expression.visit(this); if (that.Expression.Type.Kind != TypeKind.Boolean) throw new CheckerError(that.Position, "Boolean expression expected in 'if' statement"); that.If.visit(this); that.Else.visit(this); }