private void ExecutePass(ICompilerPass pass, CompilationUnit unit) { if (PrePassExecution != null) { PrePassExecution(this, pass, unit, container.ErrorReportService); } pass.ExecutePass(unit); if (PostPassExecution != null) { PostPassExecution(this, pass, unit, container.ErrorReportService); } }
private bool RunPasses(CompilationUnit cunit) { if (!container.ErrorReportService.HasErrors) { ICompilerPass builderSkeleton = container[typeof(CreateBuilderSkeleton)] as ICompilerPass; ExecutePass(builderSkeleton, cunit); } if (!container.ErrorReportService.HasErrors) { ICompilerPass scopePass = container[typeof(ScopePass)] as ICompilerPass; ExecutePass(scopePass, cunit); } if (!container.ErrorReportService.HasErrors) { ICompilerPass typeResPass = container[typeof(TypeResolutionPass)] as ICompilerPass; ExecutePass(typeResPass, cunit); } if (!container.ErrorReportService.HasErrors) { ICompilerPass emission = container[typeof(Emission)] as ICompilerPass; emission.ExecutePass(cunit); } return(!container.ErrorReportService.HasErrors); }