Example #1
0
        public void TestJumpDifferentSymbolSameName()
        {
            string test = @"
                        f() {
                            @a;
                            jump a;
                        }

                        g() {
                            @a;
                            jump a;
                        }
                    
                        default
                        {
                            touch_start(integer num) {
                            }
                        }";

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"), true);
            CompiledScript    script       = testFrontend.Compile(test);

            string byteCode = testFrontend.GeneratedByteCode;

            Console.WriteLine(byteCode);

            Assert.IsTrue(listener.HasErrors() == false);
            Assert.AreEqual(new Regex("a_usrlbl__0").Matches(byteCode).Count, 2);
            Assert.AreEqual(new Regex("a_usrlbl__1").Matches(byteCode).Count, 2);
            Assert.AreEqual(new Regex("jmp a_usrlbl__0").Matches(byteCode).Count, 1);
            Assert.AreEqual(new Regex("jmp a_usrlbl__1").Matches(byteCode).Count, 1);
        }
        public void TestSubscriptIncrement()
        {
            string test = @"
                            .globals 1
                            .statedef default
                            vconst <1.1,1.2,1.3>
                            gstore 0
                            fpreinc.g.sub 0,1
                            trace
                            gload 0
                            trace
                            halt

                            .evt default/state_entry: args=0, locals=0
                            ret
                            ";

            Compiler.Compile(new ANTLRStringStream(test));
            CompiledScript script = Compiler.Result;

            Assert.IsNotNull(script);

            Interpreter i = new Interpreter(script, null);

            i.TraceDestination = Listener.TraceDestination;
            while (i.ScriptState.RunState == RuntimeState.Status.Running)
            {
                i.Tick();
            }

            Assert.IsTrue(i.ScriptState.Operands.Count == 0); //stack should be empty
            Console.WriteLine(Listener.TraceDestination.ToString());
            Assert.IsTrue(Listener.MessagesContain($"2.2{Environment.NewLine}<1.1, 2.2, 1.3>"));
        }
Example #3
0
        public void Compile(ICharStream input)
        {
            try
            {
                AssemblerLexer lex = new AssemblerLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lex);
                AssemblerParser p = new AssemblerParser(tokens);
                BytecodeGenerator gen = new BytecodeGenerator(Defaults.SystemMethods.Values);
                
                p.SetGenerator(gen);
                p.TraceDestination = _traceDestination;
                p.program();

                if (p.NumberOfSyntaxErrors > 0 && _listener != null)
                {
                    _listener.Error(Convert.ToString(p.NumberOfSyntaxErrors) + " syntax error(s)");
                    return;
                }

                _result = gen.Result;
            }
            catch (GenerationException ex)
            {
                _listener.Error(ex.Message);
            }
        }
Example #4
0
        public virtual CompiledScript compile(ScriptEngine scriptEngine, string language, string src)
        {
            if (scriptEngine is Compilable && !scriptEngine.Factory.LanguageName.equalsIgnoreCase("ecmascript"))
            {
                Compilable compilingEngine = (Compilable)scriptEngine;

                try
                {
                    CompiledScript compiledScript = compilingEngine.compile(src);

                    LOG.debugCompiledScriptUsing(language);

                    return(compiledScript);
                }
                catch (ScriptException e)
                {
                    throw new ScriptCompilationException("Unable to compile script: " + e.Message, e);
                }
            }
            else
            {
                // engine does not support compilation
                return(null);
            }
        }
Example #5
0
        public void TestBuildList()
        {
            string test = @"
                            .globals 1
                            .statedef default
                            fconst 1.1
                            fconst 3.2
                            sconst ""hi""
                            sconst ""\""""
                            iconst 5
                            buildlist 5
                            trace
                            halt

                            .evt default/state_entry: args=0, locals=0
                            ret
                            ";

            Compiler.Compile(new ANTLRStringStream(test));
            CompiledScript script = Compiler.Result;

            Assert.IsNotNull(script);

            Interpreter i = new Interpreter(script, null);

            i.TraceDestination = Listener.TraceDestination;
            while (i.ScriptState.RunState == RuntimeState.Status.Running)
            {
                i.Tick();
            }

            Assert.IsTrue(i.ScriptState.Operands.Count == 0); //stack should be empty
            Console.WriteLine(Listener.TraceDestination.ToString());
            Assert.IsTrue(Listener.MessagesContain("[1.1,3.2,hi,\",5]"));
        }
Example #6
0
        public void TestPromotionForStorage()
        {
            string test
                = @"integer g() { return 0; }
                    f() { 
                        integer i;
                        float f = 1;
                        float h = g();
                        float j = i;
                        float l = i++;
                        float k = i - 5;

                        f = 1;
                        h = g();
                        j = i;
                        l = i++;
                        k = i - 5;
                    }

                    default { state_entry() {} }
                    ";

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"), true);
            CompiledScript    script       = testFrontend.Compile(test);

            string byteCode = testFrontend.GeneratedByteCode;

            Console.WriteLine(byteCode);
            int castCount = new Regex("fcast").Matches(byteCode).Count;

            Assert.IsTrue(listener.HasErrors() == false);
            Assert.AreEqual(castCount, 10);
        }
Example #7
0
        public void TestPromotionForFunctionCalls()
        {
            string test
                = @"g(float parm) { }
                    integer intfunc() { return 0; }

                    f() { 
                        integer i;
                        
                        g(1);
                        g(i);
                        g(i++);
                        g(i - 3);
                        g(intfunc());
                    }

                    default { state_entry() {} }
                    ";

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"), true);
            CompiledScript    script       = testFrontend.Compile(test);

            string byteCode = testFrontend.GeneratedByteCode;

            Console.WriteLine(byteCode);
            int castCount = new Regex("fcast").Matches(byteCode).Count;

            Assert.IsTrue(listener.HasErrors() == false);
            Assert.AreEqual(castCount, 5);
        }
Example #8
0
        public void TestDoGenerateBooleanEval()
        {
            string test
                = @"string strfunc() { return """"; }

                    f() { 
                        if (strfunc()) {
                        }

                        while (0.0) {
                        }

                        for (;"""";) {
                        }
                        
                        key k;
                        do {
                        } while (k);
                    }

                    default { state_entry() {} }
                    ";

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"), true);
            CompiledScript    script       = testFrontend.Compile(test);

            string byteCode = testFrontend.GeneratedByteCode;

            Console.WriteLine(byteCode);
            int evalCount = new Regex("booleval").Matches(byteCode).Count;

            Assert.IsTrue(listener.HasErrors() == false);
            Assert.AreEqual(evalCount, 4);
        }
Example #9
0
        public void RunScript()
        {
            if (!srm.HasStdOutputListener(this))
            {
                srm.AddStdOutputListener(this);
            }

            try
            {
                CompiledScript cs = srm.Compile(editor.Text);
                object         v  = srm.RunCompiledScript(cs);

                if (ScriptExecuted != null)
                {
                    ScriptExecuted(this, null);
                }

                timer.Enabled = true;
                //LogValue(v);
            }
            catch (Exception ex)
            {
                Log("error: " + ex.Message);
            }
        }
Example #10
0
        public void TestImplicitCastForSubscriptAssignment()
        {
            string test
                = @"g(float parm) { }
                    integer intfunc() { return 0; }

                    f() { 
                        vector v;
                        v.x = intfunc();
                        float f = (v.y = 1);
                        
                    }

                    default { state_entry() {} }
                    ";

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"), true);
            CompiledScript    script       = testFrontend.Compile(test);

            string byteCode = testFrontend.GeneratedByteCode;

            Console.WriteLine(byteCode);
            int castCount = new Regex("fcast").Matches(byteCode).Count;

            Assert.IsTrue(listener.HasErrors() == false);
            Assert.AreEqual(castCount, 2);
        }
Example #11
0
        public static ScriptType FromScript(CompiledScript script)
        {
            var        name       = script.Name;
            var        _namespace = $"{script.Name}.{script.Methods[0].Name}";
            var        type       = script.Methods[0].Type;
            ScriptType tpc        = new ScriptType(name, _namespace, type);

            return(tpc);
        }
Example #12
0
        private static string GetGlobalIL(string code)
        {
            var script = CompiledScript.Compile(new StringScriptSource(code),
                                                new Jurassic.Compiler.CompilerOptions {
                EnableILAnalysis = true
            });

            return(NormalizeText(script.DisassembledIL));
        }
Example #13
0
        /// <inheritdoc />
        public override async Task <object> Execute(WorkflowInstanceState state, CancellationToken token)
        {
            CompiledScript script = await compiler.CompileScriptAsync(Name);

            IDictionary <string, object> arguments = await Arguments.EvaluateArguments(state.Variables, token);

            state.Logger.Info($"Executing script '{script.Name}'", string.Join("\n", arguments.Select(p => $"{p.Key}: {p.Value}")));
            return(await script.Instance.ExecuteAsync(new VariableProvider(state.Variables, arguments), token));
        }
Example #14
0
                                         // a reference must be kept to make a delegate callable from unmanaged world

        public PreludeScript(
            string script, string fileName, Func<string, Tuple<string, string>> getModuleSourceAndFileName,
            Action<string> logger = null)
        {
            _logDelegate = LogHandler;
            _loadModuleDelegate = GetModule;
            _getModuleSourceAndFileName = getModuleSourceAndFileName;
            _logger = logger;
            _script = CompileScript(script, fileName);
        }
        /// <inheritdoc />
        public object Execute(IDictionary <string, object> arguments)
        {
            arguments.TranslateDictionary();
            arguments["log"] = logger;

            CompiledScript script = compiler.CompileScriptAsync(name, revision).GetAwaiter().GetResult();
            object         result = script.Instance.Execute(arguments);

            return(result);
        }
Example #16
0
        /// <summary>
        /// Reserializes a compiled script into a form again usable to pass over the wire or write to disk
        /// </summary>
        /// <param name="compiledScript"></param>
        /// <returns></returns>
        private byte[] ReserializeScript(CompiledScript compiledScript)
        {
            SerializedScript script = SerializedScript.FromCompiledScript(compiledScript);

            using (MemoryStream memStream = new MemoryStream())
            {
                ProtoBuf.Serializer.Serialize(memStream, script);
                return(memStream.ToArray());
            }
        }
        public static void DisplayCompilationOutput(OutputPanel output, CompiledScript compiledScript)
        {
            output.CDSWriteLine(
                $"{compiledScript.CompilationOutput.ErrorCount} error(s), " +
                $"{compiledScript.CompilationOutput.WarningCount} warning(s)");

            foreach (var message in compiledScript.CompilationOutput.Messages)
            {
                output.CDSWriteLine(message);
            }
        }
Example #18
0
        /// <summary>
        /// This example shows how to get the information about functions and variables that
        /// is written in script from .NET program.
        ///
        /// ReoScript provides the ability to get functions and variables information after
        /// script is compiling.
        ///
        /// To use this feature you have to use the following namespaces:
        ///
        /// - Unvell.ReoScript
        /// - Unvell.ReoScript.Reflection
        ///
        /// The script's instruction information returned in a tree-style:
        ///
        ///     CompiledScript
        ///         +- Functions
        ///             +- Functions
        ///                 +- Functions
        ///                 +- Variables
        ///             +- Variables
        ///         +- Variables
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            string script = @"

				function normal() {
					return 'normal function';
				}

				function outer(p1, p2, p3, p4) {
					
					function inner(key, value) { 
            var local = 10;

						function inner2(param) {
            }
					}

					return function(a, b) { return a + b; } ();
				}

				var af = function(x, y) { return x * y; };

				var result = af(2, 5);
		        
			"            ;

            ScriptRunningMachine srm = new ScriptRunningMachine();
            CompiledScript       cs  = srm.Compile(script, true);

            Console.WriteLine("Functions: ");
            Console.WriteLine();

            foreach (FunctionInfo fi in cs.DeclaredFunctions)
            {
                IterateFunction(fi, 0);
            }

            Console.WriteLine("Global Variables: ");
            Console.WriteLine();

            foreach (VariableInfo vi in cs.DeclaredVariables)
            {
                PrintOutLine("Variable Name", vi.Name, 0);
                PrintOutLine("  Has Initial Value", vi.HasInitialValue.ToString(), 0);
                PrintOutLine("  Position", vi.Line + ":" + vi.CharIndex, 0);
                Console.WriteLine();
            }


#if DEBUG
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
#endif
        }
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new ScriptData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("CompiledScript", false, out subEle))
            {
                if (CompiledScript == null)
                {
                    CompiledScript = new SimpleSubrecord <Byte[]>();
                }

                CompiledScript.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ScriptSource", false, out subEle))
            {
                if (ScriptSource == null)
                {
                    ScriptSource = new SimpleSubrecord <Char[]>();
                }

                ScriptSource.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("LocalVariables", false, out subEle))
            {
                if (LocalVariables == null)
                {
                    LocalVariables = new List <LocalVariable>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    LocalVariable temp = new LocalVariable();
                    temp.ReadXML(e, master);
                    LocalVariables.Add(temp);
                }
            }

            ReadReferencesXML(ele, master);


            ReadLocalReferenceXML(ele, master);


            ReadGlobalReferenceXML(ele, master);
        }
Example #20
0
        public void CheckScript(string read)
        {
            if (read == "Clear")
            {
                Console.Clear();
                return;
            }
            if (read == "Save")
            {
                CODE_INFO.SaveAssembly("DarkLanguageAssembly");
                Console.WriteLine("This Assembly Was Saved!!!");
                Console.ReadKey();
                return;
            }
            var            scr    = ScriptCompiler.GetScriptCode("../Script");
            CompiledScript script = ScriptCompiler.CompileScript(scr);

            Console.WriteLine("///////////////Script////////////////");
            foreach (var method in script.Methods)
            {
                foreach (var e in method.Events)
                {
                    foreach (var condition in e.Conditions)
                    {
                        foreach (var action in condition.Actions)
                        {
                            Console.WriteLine(action.Code);
                        }
                        Console.WriteLine(condition.Condition);
                    }
                    Console.WriteLine(e.Type);
                }
                Console.WriteLine(method.Type);
            }
            Console.ReadKey(true);

            //CODE_EXEC.AutoExecuteCode(read);

            //Console.WriteLine("///////////FIELDS///////////////");
            //foreach(var field in CODE_EXEC.Fields)
            //{
            //	Console.WriteLine(field);
            //}
            //Console.WriteLine("///////////METHOD//////////////");
            //CODE_READER.CheckLanguageRoutines(read);
            //var rs = CODE_READER.GetReads(read);
            //foreach(var r in rs)
            //{
            //	Console.WriteLine(r);
            //}
        }
Example #21
0
        public static CompiledScript CompileScript(string script, string name = "")
        {
            Output = new CompilationOutput();
            script = script.Replace("\r\n", "");
            var compiled = new CompiledScript(script);

            compiled.Name = name;
            if (!CODE_INFO.Scripts.Contains(compiled))
            {
                CODE_INFO.Scripts.Add(compiled);
            }

            return(compiled);
        }
Example #22
0
 public void SetOnLaserHitScript(string code)
 {
     try
     {
         _onLaserHitScript = code;
         _onLaserHit       = CCL.ScriptUtility.CompileScript(code, typeof(Box));
         _onLaserHit.SetContext(this);
     }
     catch (System.Exception e)
     {
         Debug.Log(e);
         _onLaserHit = null;
     }
 }
Example #23
0
        private static void SaveScript(CompiledScript script)
        {
            SerializedScript serScript = SerializedScript.FromCompiledScript(script);

            using (var file = File.Create("script.plx"))
            {
                ProtoBuf.Serializer.Serialize(file, serScript);
            }

            using (var file = File.OpenRead("script.plx"))
            {
                SerializedScript readscript = ProtoBuf.Serializer.Deserialize <SerializedScript>(file);
                CompiledScript   compiled   = readscript.ToCompiledScript();
            }
        }
Example #24
0
        public void TestLauksLarrowScript()
        {
            string test;

            using (StreamReader rdr = File.OpenText("..\\..\\..\\..\\grammar\\test_files\\Lauks_Larrow_Main.lsl"))
            {
                test = rdr.ReadToEnd();
            }

            TestListener      listener     = new TestListener();
            MCompilerFrontend testFrontend = new MCompilerFrontend(listener, "..\\..\\..\\..\\grammar");
            CompiledScript    script       = testFrontend.Compile(test);

            Assert.IsTrue(listener.HasErrors() == false);
        }
Example #25
0
        private void CacheCompiledScript(CompiledScript comp)
        {
            string scriptCacheDir = this.LookupDirectoryFromId(PhloxConstants.COMPILE_CACHE_DIR, comp.AssetId);

            Directory.CreateDirectory(scriptCacheDir);
            string scriptPath = Path.Combine(scriptCacheDir, comp.AssetId.ToString() + PhloxConstants.COMPILED_SCRIPT_EXTENSION);

            SerializedScript script = SerializedScript.FromCompiledScript(comp);

            using (FileStream f = File.Open(scriptPath, FileMode.Create))
            {
                ProtoBuf.Serializer.Serialize(f, script);
                f.Close();
            }
        }
Example #26
0
        public void TestGeneratesFinalRetForEvent()
        {
            string test
                = @"default 
                    {
                        state_entry()
                        {
                            llSay(0, ""Script Running"");
                        }
                    }";

            MCompilerFrontend testFrontend = new MCompilerFrontend(new TestListener(), Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "grammar"));
            CompiledScript    script       = testFrontend.Compile(test);

            Assert.Contains(93, script.ByteCode);
        }
Example #27
0
        public void TestGeneratesFinalRetForEvent()
        {
            string test
                = @"default 
                    {
                        state_entry()
                        {
                            llSay(0, ""Script Running"");
                        }
                    }";

            MCompilerFrontend testFrontend = new MCompilerFrontend(new TestListener(), "../../../../grammar");
            CompiledScript    script       = testFrontend.Compile(test);

            Assert.Contains(93, script.ByteCode);
        }
Example #28
0
        public void TestCallWithParams()
        {
            string test = @"
                            .globals 0
                            .statedef default
                            iconst 20
                            call func1()
                            trace
                            sconst ""oh hai""
                            call func2()
                            halt
                            
                            .def func1: args=1, locals=1
                            load 0
                            trace
                            iconst 2
                            ret

                            .def func2: args=1, locals=1
                            load 0
                            store 1
                            sconst ""gnarly""
                            call func1()
                            pop
                            ret
                            
                            .evt default/state_entry: args=0, locals=0
                            ret
                            ";

            Compiler.Compile(new ANTLRStringStream(test));
            CompiledScript script = Compiler.Result;

            Assert.IsNotNull(script);

            Interpreter i = new Interpreter(script, null);

            i.TraceDestination = Listener.TraceDestination;
            while (i.ScriptState.RunState == RuntimeState.Status.Running)
            {
                i.Tick();
            }

            Assert.IsTrue(i.ScriptState.Operands.Count == 0); //stack should be empty
            Console.WriteLine(Listener.TraceDestination.ToString());
            Assert.IsTrue(Listener.MessagesContain($"20{Environment.NewLine}2{Environment.NewLine}gnarly{Environment.NewLine}"));
        }
Example #29
0
        public void TestSubscriptAccess()
        {
            string test = @"
                            .globals 2
                            .statedef default
                            vconst <1.1,1.2,1.3>
                            gstore 0
                            gload.sub 0,0
                            trace
                            gload.sub 0,1
                            trace
                            gload.sub 0,2
                            trace
                            rconst <1.1,1.2,1.3,1.4>
                            gstore 1
                            gload.sub 1,0
                            trace
                            gload.sub 1,1
                            trace
                            gload.sub 1,2
                            trace
                            gload.sub 1,3
                            trace
                            halt

                            .evt default/state_entry: args=0, locals=0
                            ret
                            ";

            Compiler.Compile(new ANTLRStringStream(test));
            CompiledScript script = Compiler.Result;

            Assert.IsNotNull(script);

            Interpreter i = new Interpreter(script, null);

            i.TraceDestination = Listener.TraceDestination;
            while (i.ScriptState.RunState == RuntimeState.Status.Running)
            {
                i.Tick();
            }

            Assert.IsTrue(i.ScriptState.Operands.Count == 0); //stack should be empty
            Console.WriteLine(Listener.TraceDestination.ToString());
            Assert.IsTrue(Listener.MessagesContain("1.1\r\n1.2\r\n1.3\r\n1.1\r\n1.2\r\n1.3\r\n1.4"));
        }
Example #30
0
        public QueryScript(PreludeScript prelude, string script, string fileName)
        {
            _commandHandlerRegisteredCallback = CommandHandlerRegisteredCallback;
            _reverseCommandHandlerDelegate = ReverseCommandHandler;

            _script = CompileScript(prelude, script, fileName);

            try
            {
                GetSources();
            }
            catch
            {
                Dispose();
                throw;
            }
        }
Example #31
0
        public ushort GetScriptId(string name, ScriptType type)
        {
            CompiledScript scr = Context.Djn?.FindByName <CompiledScript>(name);

            if (scr == null)
            {
                scr = new CompiledScript();
                scr.Resource.Flags      = (type == ScriptType.Script) ? ResourceFlags.None : ResourceFlags.Private;
                scr.Resource.Name       = name;
                scr.Resource.OnlyDesign = true;
                scr.Resource.Subtype    = (type == ScriptType.AIProfile) ? ResourceSubtype.AIProfile : ResourceSubtype.Unknown;
                Context.Djn?.Add(scr);

                TemporaryScripts.Add(scr);
            }

            return(scr.Resource.ID);
        }
Example #32
0
 private IntPtr GetModule(string moduleName)
 {
     try
     {
         var moduleSourceAndFileName = GetModuleSourceAndFileName(moduleName);
         var compiledModuleHandle = Js1.CompileModule(
             GetHandle(), moduleSourceAndFileName.Item1, moduleSourceAndFileName.Item2);
         CompiledScript.CheckResult(compiledModuleHandle, disposeScriptOnException: true);
         var compiledModule = new CompiledScript(compiledModuleHandle, moduleSourceAndFileName.Item2);
         _modules.Add(compiledModule);
         return compiledModuleHandle;
     }
     catch (Exception)
     {
         //TODO: this is not a good way to report missing module and other exceptions back to caller
         return IntPtr.Zero;
     }
 }
Example #33
0
        /// <summary>
        /// Try to load a script from disk and start it up
        /// </summary>
        /// <param name="scriptAssetId"></param>
        /// <param name="lrq"></param>
        /// <returns></returns>
        private bool TryStartCachedScript(UUID scriptAssetId, LoadUnloadRequest lrq)
        {
            //check in the cache directory for compiled scripts
            if (ScriptIsCached(scriptAssetId))
            {
                CompiledScript script = LoadScriptFromDisk(scriptAssetId);

                _log.InfoFormat("[Phlox]: Starting cached script {0} in item {1} owner {2} part {3}", scriptAssetId, lrq.ItemId, lrq.Prim.ParentGroup.OwnerID, lrq.Prim.LocalId);

                BeginScriptRun(lrq, script);
                _loadedScripts[scriptAssetId] = new LoadedScript {
                    Script = script, RefCount = 1
                };
                return(true);
            }

            return(false);
        }
Example #34
0
        public CompiledScript CompileScript(String text, StringTable stringTable, Type self = null)
        {
            var machineInfo = m_StateMachineParser.ParseStateMachineInfo(text);
            var nodeList = new List<ScriptNode>();

            foreach(var node in machineInfo.Nodes)
            {
                var scriptNode = CompileScriptNode(node.Name, node.Text, stringTable, self);
                nodeList.Add(scriptNode);
            }

            // var stringTable = ScriptNode.StringTable;
            var rv = new CompiledScript(nodeList, self);

            return rv;
        }
Example #35
0
 public ScriptCompiledEventArgs(CompiledScript compiledScript)
 {
     this.CompiledScript = compiledScript;
 }