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