summaryrefslogtreecommitdiff
path: root/Orchestrator
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
parent94ddc02e03ab942d0c881e29053e8df3d2940c30 (diff)
fixed bugs and revolutionized the universe
Diffstat (limited to 'Orchestrator')
-rw-r--r--Orchestrator/Orchestrator.csproj20
-rw-r--r--Orchestrator/Program.cs47
2 files changed, 67 insertions, 0 deletions
diff --git a/Orchestrator/Orchestrator.csproj b/Orchestrator/Orchestrator.csproj
new file mode 100644
index 0000000..4701bf4
--- /dev/null
+++ b/Orchestrator/Orchestrator.csproj
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="CommandLineParser" Version="2.9.1" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Assembler\Assembler.csproj" />
+ <ProjectReference Include="..\Compiler\Compiler.csproj" />
+ <ProjectReference Include="..\Emulator\Emulator.csproj" />
+ </ItemGroup>
+
+</Project>
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