using Compiler; const string fileName = "test.nub"; var file = File.ReadAllText(fileName); var tokens = Tokenizer.Tokenize(fileName, file, out var tokenizerDiagnostics); foreach (var diagnostic in tokenizerDiagnostics) { DiagnosticFormatter.Print(diagnostic, Console.Error); } if (tokenizerDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error)) { return 1; } var nodes = Parser.Parse(fileName, tokens, out var parserDiagnostics); foreach (var diagnostic in parserDiagnostics) { DiagnosticFormatter.Print(diagnostic, Console.Error); } if (parserDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error)) { return 1; } var typedNodes = TypeChecker.Check(fileName, nodes, out var typeCheckerDiagnostics); foreach (var diagnostic in typeCheckerDiagnostics) { DiagnosticFormatter.Print(diagnostic, Console.Error); } if (typeCheckerDiagnostics.Any(x => x.Severity == DiagnosticSeverity.Error)) { return 1; } var output = Generator.Emit(typedNodes); File.WriteAllText("C:/Users/oliste/repos/nub-lang/compiler/Compiler/out.c", output); return 0;