예제 #1
0
        /// <summary>
        /// Resets execution of the script context.
        /// </summary>
        public void Reset()
        {
            m_stackFunctionFrames.Clear();
            FunctionFrame functionFrame = new FunctionFrame();

            functionFrame.m_scriptFunction = m_scriptFunction;
            functionFrame.m_variableDictionary
                = VariableDictionary.CreateLocalDictionary(
                      m_scriptExecutable.ScriptDictionary);
            functionFrame.m_iNextInstruction = (int)m_scriptFunction.EntryPoint.Address;
            m_stackFunctionFrames.Push(functionFrame);

            m_stackParameters.Clear();

            m_scriptInstruction       = null;
            m_variableDictionaryLocal = functionFrame.m_variableDictionary;

            // release all locks held by this context
            foreach (object objectLock in m_dictLocks.Keys)
            {
                m_script.Manager.Locks.Remove(objectLock);
            }
            m_dictLocks.Clear();

            m_bTerminated = false;
            m_bInterruped = false;
        }
예제 #2
0
        private void ProcessCALL()
        {
            // get function
            ScriptFunction scriptFunction
                = m_scriptInstruction.Operand0.ScriptFunctionRef;
            ScriptInstruction scriptInstructionTarget
                = scriptFunction.EntryPoint;

            FunctionFrame functionFrame = new FunctionFrame();

            functionFrame.m_scriptFunction = scriptFunction;
            functionFrame.m_variableDictionary
                = VariableDictionary.CreateLocalDictionary(
                      m_scriptExecutable.ScriptDictionary);
            m_variableDictionaryLocal = functionFrame.m_variableDictionary;
            functionFrame.m_iNextInstruction
                = (int)scriptInstructionTarget.Address;

            m_stackFunctionFrames.Push(functionFrame);
        }