示例#1
0
文件: CodeGen.cs 项目: bencz/Beryl
 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);
 }
示例#2
0
文件: Checker.cs 项目: bencz/Beryl
        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);
        }