From 76cea79a46d42f8f59503d3bb421f0d298da66cb Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Thu, 28 Aug 2025 21:57:33 +1000 Subject: implemented standard library --- Orchestrator/Program.cs | 64 +++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 23 deletions(-) (limited to 'Orchestrator/Program.cs') diff --git a/Orchestrator/Program.cs b/Orchestrator/Program.cs index a59127b..213f5ee 100644 --- a/Orchestrator/Program.cs +++ b/Orchestrator/Program.cs @@ -13,32 +13,38 @@ class Program { with.CaseInsensitiveEnumValues = true; }); - + p.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, - }); + + if (!options.NoCompile) + Q1.Compiler.Program.Main( + new CompilerOptions + { + CommentCompilationMode = options.CommentCompilationMode, + InputFile = options.InputFile, + OutputFile = compiledFile + }); + + if (!options.NoAssemble) + Q1.Assembler.Program.Main( + new AssemblerOptions + { + InputFile = compiledFile, + OutputFile = assembledFile + }); + + if (!options.NoEmulate) + Q1.Emulator.Program.Main( + new EmulatorOptions + { + InputFile = assembledFile, + }); } } @@ -46,7 +52,19 @@ 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; + + [Option( + 'c', "comment-compilation", Required = false, + HelpText = "Comments to preserve in the compiled result")] + public CommentCompilationMode CommentCompilationMode { get; set; } = + CommentCompilationMode.UserDefined; + + [Option("no-compile", HelpText = "Skip compilation")] + public bool NoCompile { get; set; } = false; + + [Option("no-assemble", HelpText = "Skip assembling")] + public bool NoAssemble { get; set; } = false; + + [Option("no-emulate", HelpText = "Skip emulation")] + public bool NoEmulate { get; set; } = false; } \ No newline at end of file -- cgit v1.3.1