public bool ContinueWith(SyntaxTree input) { if (input == null || input.Diagnostics.Any()) { if (chainDiagnostics) { diagnostics.AddDiagnostics(input.Diagnostics); } return(false); } if (interperatations == null) { interperatations = new List <Interperatation>(); } var interperatation = new Interperatation(input, CurrentInterpretation); if (interperatation.Diagnostics.Any()) { if (chainDiagnostics) { diagnostics.AddDiagnostics(interperatation.Diagnostics); } return(false); } else { interperatations.Add(interperatation); return(true); } }
public Interperatation(SyntaxTree input, Interperatation previous = null) { InputTree = input; diagnostics = new DiagnosticContainer(); CreateGlobalScope(input.Root, previous); CreateProgram(); }
private BoundGlobalScope CreateGlobalScope(CompilationUnitSyntax compilationUnit, Interperatation previous) { var prevScope = previous == null ? null : previous.GlobalScope; var binderResult = Binder.BindGlobalScope(prevScope, compilationUnit); Interlocked.CompareExchange(ref globalScope, binderResult.Value, null); diagnostics.AddDiagnostics(binderResult.Diagnostics); return(GlobalScope); }