Ejemplo n.º 1
0
        private BinaryCmpExpr processBinaryCmpExpr(BinaryCmpExpr result, Expression left, Expression right, Location loc)
        {
            if (left.DataType == DataType.Bool || left.DataType == DataType.String ||
                right.DataType == DataType.Bool || right.DataType == DataType.String)
            {
                kernel.IssueError(ErrorType.OprandTypeError, loc);
                return(null);
            }
            else
            {
                result.DataType = DataType.Bool;
            }


            result.FirstOp  = left;
            result.SecondOp = right;
            result.Location = loc;
            return(result);
        }
        private BinaryCmpExpr processBinaryCmpExpr(BinaryCmpExpr result, Expression left, Expression right, Location loc)
        {
            if (left.DataType == DataType.Bool || left.DataType == DataType.String
                || right.DataType == DataType.Bool || right.DataType == DataType.String)
            {
                kernel.IssueError(ErrorType.OprandTypeError, loc);
                return null;
            }
            else
            {
                result.DataType = DataType.Bool;
            }

            result.FirstOp = left;
            result.SecondOp = right;
            result.Location = loc;
            return result;
        }