public StatementInterpreter()
 {
     Evaluator = new DefaultEvaluator()
     {
         DoEvalVariable = EvaluateVariable,
         DoEvalFunction = EvalFunction
     };
     /*
     DecompilerTemplate = new MSILDecompilerTemplate()
     {
         GenerateThisVariable = true
     };
      * */
 }
Example #2
0
        public StatementInterpreter()
        {
            Evaluator = new DefaultEvaluator()
            {
                DoEvalVariable = EvaluateVariable,
                DoEvalFunction = EvalFunction
            };

            /*
             * DecompilerTemplate = new MSILDecompilerTemplate()
             * {
             *  GenerateThisVariable = true
             * };
             * */
        }
Example #3
0
 /// <summary>
 /// Converts this instance to a fixed array reference.
 /// </summary>
 public FixedArrayRef AsFixed()
 {
     LiteralReference lr = ArrayExpr as LiteralReference;
     if (lr == null)
         return null;
     object obj;
     if (!lr.ReferencedObject.IsConst(out obj))
         return null;
     Array array = obj as Array;
     if (array == null)
         return null;
     long[] constIndices = new long[Indices.Length];
     IEvaluator eval = new DefaultEvaluator();
     for (int i = 0; i < Indices.Length; i++)
     {
         Expression index = Indices[i];
         if (!index.IsConst())
         {
             constIndices = null;
             break;
         }
         constIndices[i] = TypeConversions.ToLong(index.Eval(eval));
     }
     return new FixedArrayRef(lr.ReferencedObject, array, constIndices);
 }