Esempio n. 1
0
 public virtual bool check()
 {
     if (!ReserveType.IsBoolean(First.Type) || !ReserveType.IsBoolean(Second.Type))
     {
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
        public void Init(Stmt s, Expr x)
        {
            Expr = x;
            Stmt = s;

            if (!ReserveType.IsBoolean(Expr.Type))
            {
                throw new TypeMisMatchException(this.lexline, Expr.Type, "Boolean");
            }
        }
Esempio n. 3
0
        public If(Expr x, Stmt s) : base(x.lexline)
        {
            Expr = x;
            Stmt = s;

            if (!ReserveType.IsBoolean(Expr.Type))
            {
                throw new TypeMisMatchException(s.lexline, Expr.Type, "Boolean");
            }
        }
Esempio n. 4
0
 public Else(Expr x, Stmt s1, Stmt s2) : base(x.lexline)
 {
     Expr  = x;
     Stmt1 = s1;
     Stmt2 = s2;
     if (!ReserveType.IsBoolean(Expr.Type))
     {
         throw new TypeMisMatchException(x.lexline, Expr.Type, "Boolean");
     }
 }