summaryrefslogtreecommitdiff
path: root/Orchestrator/Program.cs
diff options
context:
space:
mode:
authorMelodi <62381002+Melodi17@users.noreply.github.com>2025-08-27 21:22:55 +1000
committerMelodi <62381002+Melodi17@users.noreply.github.com>2025-08-27 21:22:55 +1000
commit634681ce2bb36cd686943102a0f071cd6a09049f (patch)
tree6710047aa231d50f57114bdd54a27c559fb20a73 /Orchestrator/Program.cs
parent94ddc02e03ab942d0c881e29053e8df3d2940c30 (diff)
fixed bugs and revolutionized the universe
Diffstat (limited to 'Orchestrator/Program.cs')
-rw-r--r--Orchestrator/Program.cs47
1 files changed, 47 insertions, 0 deletions
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<Options>(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