예제 #1
0
        private void ProcessRET()
        {
            m_stackFunctionFrames.Pop();

            if (m_stackFunctionFrames.Count == 0)
            {
                m_bTerminated = true;
                return;
            }

            m_variableDictionaryLocal
                = m_stackFunctionFrames.Peek().m_variableDictionary;
        }
예제 #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);
        }
예제 #3
0
 /// <summary>
 /// Creates a variable dictionary with a local scope
 /// using the given script variable dictionary reference.
 /// </summary>
 /// <param name="variableDicitonaryScript"></param>
 /// <returns></returns>
 public static VariableDictionary CreateLocalDictionary(
     VariableDictionary variableDicitonaryScript)
 {
     return(new VariableDictionary(
                VariableScope.Local, variableDicitonaryScript.m_variableDicitonaryGlobal, variableDicitonaryScript));
 }
예제 #4
0
 /// <summary>
 /// Creates a variable dictionary with a script scope
 /// using the given global variable dictionary reference.
 /// </summary>
 /// <param name="variableDicitonaryGlobal">Global variable
 /// dictionary reference.</param>
 /// <returns></returns>
 public static VariableDictionary CreateScriptDictionary(
     VariableDictionary variableDicitonaryGlobal)
 {
     return(new VariableDictionary(VariableScope.Script, variableDicitonaryGlobal, null));
 }