Beispiel #1
0
        public virtual void run(VSMXObject globalVariables)
        {
            lock (this)
            {
                prefix     = "";
                pc         = 0;
                exit       = false;
                callStates = new Stack <VSMXCallState>();
                pushCallState(VSMXNull.singleton, 0, false, true);
                this.globalVariables = globalVariables;

                VSMXBoolean.init(this);

                interpret();

                callStates.Clear();
                callState = null;
                prefix    = "";

                if (log.TraceEnabled)
                {
                    log.trace(string.Format("Global variables after run(): {0}", globalVariables));
                }
            }
        }
Beispiel #2
0
 private void pushCallState(VSMXBaseObject thisObject, int numberOfLocalVariables, bool returnThis, bool exitAfterCall)
 {
     if (callState != null)
     {
         callStates.Push(callState);
     }
     callState = new VSMXCallState(thisObject, numberOfLocalVariables, pc, returnThis, exitAfterCall);
     stack     = callState.Stack;
     prefix   += "  ";
 }
Beispiel #3
0
 private void popCallState()
 {
     if (callStates.Count == 0)
     {
         callState = null;
         stack     = null;
         prefix    = "";
     }
     else
     {
         callState = callStates.Pop();
         stack     = callState.Stack;
         prefix    = prefix.Substring(0, prefix.Length - 2);
     }
 }