override protected CompilerPipeline CreatePipeline() { CompilerPipeline pipeline = base.CreatePipeline(); pipeline.Replace(typeof(BooParsingStep), new WSABooParsingStep()); return(pipeline); }
public static CompilerPipeline AdjustBooPipeline(CompilerPipeline pipeline) { pipeline.Insert(0, new PreProcess()); pipeline.Replace(typeof(Parsing), new UnityScript.Steps.Parse()); pipeline.Replace(typeof(IntroduceGlobalNamespaces), new IntroduceUnityGlobalNamespaces()); pipeline.InsertAfter(typeof(PreErrorChecking), new ApplySemantics()); pipeline.InsertAfter(typeof(ApplySemantics), new ApplyDefaultVisibility()); pipeline.InsertBefore(typeof(ExpandDuckTypedExpressions), new ProcessAssignmentToDuckMembers()); pipeline.Replace(typeof(ProcessMethodBodiesWithDuckTyping), new ProcessUnityScriptMethods()); pipeline.InsertAfter(typeof(ProcessUnityScriptMethods), new AutoExplodeVarArgsInvocations()); pipeline.InsertAfter(typeof(ProcessUnityScriptMethods), new ProcessEvalInvocations()); pipeline.ReplaceOptional(typeof(ExpandDuckTypedExpressions), new ExpandUnityDuckTypedExpressions()); pipeline.InsertBefore(typeof(EmitAssembly), new Lint()); pipeline.InsertBefore(typeof(EmitAssembly), new EnableRawArrayIndexing()); pipeline.InsertAfter(typeof(BindBaseTypes), new CheckBaseTypes()); return(pipeline); }
public static CompilerPipeline AdjustPipeline(EvaluationContext context, CompilerPipeline pipeline) { pipeline.InsertAfter(typeof(IntroduceUnityGlobalNamespaces), new IntroduceScriptingNamespace(context)); pipeline.InsertAfter(typeof(IntroduceScriptingNamespace), new IntroduceImports(context)); pipeline.InsertAfter(typeof(ApplySemantics), new IntroduceEvaluationContext(context)); pipeline.Replace(typeof(ProcessUnityScriptMethods), new ProcessScriptingMethods(context)); pipeline.InsertAfter(typeof(ProcessScriptingMethods), new IntroduceReturnValue()); return(pipeline); }
private CodeCompileUnit DoParse(params ICompilerInput[] inputs) { DoParseLocals53 DoParseLocals = new DoParseLocals53(); BooCompiler booCompiler = new BooCompiler(); booCompiler.Parameters.Pipeline = new ResolveExpressions(); CompilerPipeline pipeline = booCompiler.Parameters.Pipeline; pipeline.BreakOnErrors = false; // TODO //pipeline.AfterStep += $adaptor$__BooCodeParser$callable2$27_25__$CompilerStepEventHandler$0.Adapt(this.$DoParse$closure$5); pipeline.Replace(typeof(ProcessMethodBodiesWithDuckTyping), new FakeProcessMethodBodies()); booCompiler.Parameters.Input.AddRange(inputs); AppDomain.CurrentDomain.GetAssemblies(); HashSet <string> hashSet = new HashSet <string>(this._references); hashSet.Add("System.Windows.Forms"); hashSet.Add("System.Drawing"); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); int i = 0; Assembly[] array = assemblies; for (int length = array.Length; i < length; i = checked (i + 1)) { if (RuntimeServices.op_Member(array[i].GetName().Name, hashSet)) { hashSet.Remove(array[i].GetName().Name); booCompiler.Parameters.References.Add(array[i]); } } DoParseLocals.context = booCompiler.Run(); if (DoParseLocals.context.Errors.Count > 0) { throw ((Boo.Lang.List <Boo.Lang.Compiler.CompilerError>)DoParseLocals.context.Errors)[0]; } DoParseLocals.converter = new BooCodeDomConverter(); ActiveEnvironment.With(new InstantiatingEnvironment(), new DoParseClosure6(DoParseLocals).Invoke); return(DoParseLocals.converter.CodeDomUnit); }