private void ProcessRET() { m_stackFunctionFrames.Pop(); if (m_stackFunctionFrames.Count == 0) { m_bTerminated = true; return; } m_variableDictionaryLocal = m_stackFunctionFrames.Peek().m_variableDictionary; }
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); }
/// <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)); }
/// <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)); }