Example #1
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 #2
0
 public FullExpressionDecoder(IMetaDataProvider metaDataProvider, IExpressionContextProvider <E, V> contextProvider)
 {
     ContextProvider                = contextProvider;
     this.MetaDataProvider          = metaDataProvider;
     this.VariableVisitor           = new VisitorForVariable <V, E> ();
     this.UnderlyingVariableVisitor = new VisitorForUnderlyingVariable <V, E> ();
     this.UnaryExpressionVisitor    = new VisitorForIsUnaryExpression <V, E> ();
     this.BinaryExpressionVisitor   = new VisitorForIsBinaryExpression <V, E> ();
     this.VariablesInVisitor        = new VisitorForVariablesIn <V, E> (contextProvider);
     this.ValueOfVisitor            = new VisitorForValueOf <V, E> ();
     this.SizeOfVisitor             = new VisitorForSizeOf <V, E> ();
     this.IsInstVisitor             = new VisitorForIsInst <V, E> ();
     this.IsNullVisitor             = new VisitorForIsNull <V, E> ();
 }
Example #3
0
 public bool IsConstant(E expr, out object value, out TypeNode type)
 {
     return(VisitorForValueOf <V, E> .IsConstant(expr, out value, out type, this));
 }