internal override void Compile() { if (this.binaryCode == null) { JSParser parser = new JSParser(this.codeContext); if (base.ItemType == ((JSVsaItemType) 0x16)) { this.binaryCode = parser.ParseExpressionItem(); } else { this.binaryCode = parser.Parse(); } if (this.optimize && !parser.HasAborted) { this.binaryCode.ProcessAssemblyAttributeLists(); this.binaryCode.PartiallyEvaluate(); } if (base.engine.HasErrors && !base.engine.alwaysGenerateIL) { throw new EndOfFile(); } if (this.compileToIL) { this.compiledBlock = this.binaryCode.TranslateToILClass(base.engine.CompilerGlobals).CreateType(); } } }
internal override void CheckForErrors() { if (this.compiledClass == null) { JSParser p = new JSParser(this.codeContext); AST prog = (ScriptBlock)p.Parse(); //prog.PartiallyEvaluate(); } }
internal void Parse() { if ((this.block == null) && (this.compiledClass == null)) { GlobalScope item = (GlobalScope) base.engine.GetGlobalScope().GetObject(); item.evilScript = !item.fast || (base.engine.GetStaticCodeBlockCount() > 1); base.engine.Globals.ScopeStack.Push(item); try { JSParser parser = new JSParser(this.codeContext); this.block = parser.Parse(); if (parser.HasAborted) { this.block = null; } } finally { base.engine.Globals.ScopeStack.Pop(); } } }
internal void Parse() { if (this.block == null && this.compiledClass == null) { GlobalScope glob = (GlobalScope)this.engine.GetGlobalScope().GetObject(); //Provide for the possibility of forward references to declarations in code blocks yet to come. glob.evilScript = !glob.fast || this.engine.GetStaticCodeBlockCount() > 1; this.engine.Globals.ScopeStack.Push(glob); try{ JSParser p = new JSParser(this.codeContext); this.block = (ScriptBlock)p.Parse(); if (p.HasAborted) this.block = null; }finally{ this.engine.Globals.ScopeStack.Pop(); } } }