public static ScriptingAssembly Decompile(byte[] scriptNodeData, ScriptEngineDefinition engineDefinition, string[] tagList, ScenarioBase scnr) { s_nodeDataReader = new BinaryReader(new MemoryStream(scriptNodeData, 56, scriptNodeData.Length - 56, false)); s_globals = new List <NodeBase>(); s_scripts = new List <NodeBase>(); s_engineDefinition = engineDefinition; s_tagList = tagList; s_scnr = scnr; ScenarioScriptGlobal[] scnrGlobals = s_scnr.GetScriptGlobals(); ScenarioScript[] scnrScripts = s_scnr.GetScripts(); foreach (ScenarioScriptGlobal g in scnrGlobals) { CompiledScriptNode cnode = new CompiledScriptNode(g.InitialisationExpressionIndex, s_nodeDataReader); s_globals.Add(new VariableNode(g.Name, g.Type, DecompileNode(cnode))); } foreach (ScenarioScript s in scnrScripts) { CompiledScriptNode cnode = new CompiledScriptNode(s.RootExpressionIndex, s_nodeDataReader); s_scripts.Add(new ScriptNode(s.Name, (ScriptType)s.ScriptType, s.ReturnType, DecompileNode(cnode).Children)); } ScriptingAssembly assembly = new ScriptingAssembly(s_engineDefinition, s_globals, s_scripts); s_nodeDataReader = null; s_globals = null; s_scripts = null; s_engineDefinition = null; s_tagList = null; s_scnr = null; return(assembly); }
public BslTreeInterpreter(ScriptingAssembly assembly, string mapName, DecompilerLookup decompilerLookup) : base(assembly) { m_mapName = mapName; m_decompilerLookup = decompilerLookup; }
public TemplateVisitorProcessor(ScriptingAssembly assembly) : base(assembly) { }
public PslOutputGenerator(ScriptingAssembly assembly) : base(assembly) { m_state.Indent = 0; m_output = new StringBuilder(); m_tierStateStack = new Stack <PslInspectionTierState>(); }
protected VisitorProcessorBase(ScriptingAssembly assembly) { m_assembly = assembly; m_engineDefinition = assembly.EngineDefinition; }