From 634681ce2bb36cd686943102a0f071cd6a09049f Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Wed, 27 Aug 2025 21:22:55 +1000 Subject: fixed bugs and revolutionized the universe --- Orchestrator/Program.cs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Orchestrator/Program.cs (limited to 'Orchestrator/Program.cs') diff --git a/Orchestrator/Program.cs b/Orchestrator/Program.cs new file mode 100644 index 0000000..837eac0 --- /dev/null +++ b/Orchestrator/Program.cs @@ -0,0 +1,47 @@ +namespace Orchestrator; + +using CommandLine; +using Q1.Assembler; +using Q1.Compiler; +using Q1.Emulator; + +class Program +{ + static void Main(string[] args) + { + Parser.Default.ParseArguments(args).WithParsed(Main); + } + + private static void Main(Options options) + { + string compiledFile = Path.ChangeExtension(options.InputFile, "asm"); + string assembledFile = Path.ChangeExtension(options.InputFile, "q1"); + + Q1.Compiler.Program.Main(new CompilerOptions + { + CommentCompilationMode = options.CommentCompilationMode, + InputFile = options.InputFile, + OutputFile = compiledFile + }); + + Q1.Assembler.Program.Main(new AssemblerOptions + { + InputFile = compiledFile, + OutputFile = assembledFile + }); + + Q1.Emulator.Program.Main(new EmulatorOptions + { + InputFile = assembledFile, + }); + } +} + +class Options +{ + [Option('i', "input", Required = true, HelpText = "Input file to process.")] + public string InputFile { get; set; } + + [Option('c', "comment-compilation", Required = false, HelpText = "Comments to preserve in the compiled result")] + public CommentCompilationMode CommentCompilationMode { get; set; } = CommentCompilationMode.UserDefined; +} \ No newline at end of file -- cgit v1.3.1