Пример #1
0
 public void visit(WhileCommand that)
 {
     Console.Write("while (");
     that.Expression.visit(this);
     Console.WriteLine(")");
     that.Command.visit(this);
 }
Пример #2
0
        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");
        }