Example #1
0
        public static bool IsNull(E expr, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForIsNull <V, E> v = decoder.IsNullVisitor;
            bool res = Decode(expr, v, decoder);

            return(res);
        }
Example #2
0
        public static bool IsVariable(E expr, out V var, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForVariable <V, E> visitor = decoder.VariableVisitor;
            bool res = Decode(expr, visitor, decoder);

            var = visitor.variable;
            return(res);
        }
Example #3
0
        public static bool IsSizeOf(E expr, out TypeNode type, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForSizeOf <V, E> v = decoder.SizeOfVisitor;
            bool res = Decode(expr, v, decoder);

            type = v.result;
            return(res);
        }
Example #4
0
        public static bool IsIsInst(E expr, out TypeNode type, out E arg, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForIsInst <V, E> v = decoder.IsInstVisitor;
            bool res = Decode(expr, v, decoder);

            arg  = v.argument;
            type = v.type;
            return(res);
        }
Example #5
0
        public static bool IsUnary(E expr, out UnaryOperator op, out E arg, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForIsUnaryExpression <V, E> v = decoder.UnaryExpressionVisitor;
            bool res = Decode(expr, v, decoder);

            op  = v.Operator;
            arg = v.Argument;
            return(res);
        }
Example #6
0
        public static bool IsConstant(E expr, out object value, out TypeNode type, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForValueOf <V, E> v = decoder.ValueOfVisitor;
            bool res = Decode(expr, v, decoder);

            value = v.Value;
            type  = v.Type;
            return(res);
        }
Example #7
0
 protected static bool Decode <Visitor> (E expr, Visitor visitor, FullExpressionDecoder <V, E> decoder)
     where Visitor : QueryVisitor <V, E>
 {
     return(decoder.ContextProvider.ExpressionContext.Decode <Dummy, bool, Visitor> (expr, visitor, Dummy.Value));
 }
Example #8
0
 public static void AddFreeVariables(E expr, ISet <E> set, FullExpressionDecoder <V, E> decoder)
 {
     decoder.VariablesInVisitor.Recurse(expr, set);
 }
        public static bool IsBinary(E expr, out BinaryOperator bop, out E left, out E right, FullExpressionDecoder <V, E> decoder)
        {
            VisitorForIsBinaryExpression <V, E> v = decoder.BinaryExpressionVisitor;
            bool res = Decode(expr, v, decoder);

            bop   = v.op;
            left  = v.left;
            right = v.right;
            return(res);
        }