public virtual bool check() { if (!ReserveType.IsBoolean(First.Type) || !ReserveType.IsBoolean(Second.Type)) { return(false); } return(true); }
public void Init(Stmt s, Expr x) { Expr = x; Stmt = s; if (!ReserveType.IsBoolean(Expr.Type)) { throw new TypeMisMatchException(this.lexline, Expr.Type, "Boolean"); } }
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"); } }
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"); } }