예제 #1
0
        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);
        }
예제 #2
0
 public BslTreeInterpreter(ScriptingAssembly assembly, string mapName, DecompilerLookup decompilerLookup) : base(assembly)
 {
     m_mapName          = mapName;
     m_decompilerLookup = decompilerLookup;
 }
 public TemplateVisitorProcessor(ScriptingAssembly assembly) : base(assembly)
 {
 }
예제 #4
0
 public PslOutputGenerator(ScriptingAssembly assembly) : base(assembly)
 {
     m_state.Indent   = 0;
     m_output         = new StringBuilder();
     m_tierStateStack = new Stack <PslInspectionTierState>();
 }
예제 #5
0
 protected VisitorProcessorBase(ScriptingAssembly assembly)
 {
     m_assembly         = assembly;
     m_engineDefinition = assembly.EngineDefinition;
 }