示例#1
0
文件: CodeGen.cs 项目: bencz/Beryl
 public void visit(WhileCommand that)
 {
     Console.Write("while (");
     that.Expression.visit(this);
     Console.WriteLine(")");
     that.Command.visit(this);
 }
示例#2
0
文件: Checker.cs 项目: bencz/Beryl
        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");
        }