Compare commits

...

2 Commits

Author SHA1 Message Date
e8cfd059cc new main 2025-01-22 14:09:27 +01:00
00298d6d83 move compiler/ to compiler/old/ 2025-01-22 13:53:05 +01:00
32 changed files with 25 additions and 37 deletions

View File

@ -1,34 +0,0 @@
Mnemonic Arg Arg description
----------------------------------------
Nop
PushNull
PushInt int initial value
PushString string initial value
PushArray
PushStruct
PushPtr ptr pointer value
Pop
LoadLocal int stack position
StoreLocal int stack position
Call int arg count
Return
Jump
JumpIfNotZero
Add
Subtract
Multiply
Divide
Remainder
Equal
LessThan
And
Or
Xor
Not

View File

@ -1,5 +1,22 @@
import { Compiler } from "./compiler.ts";
type Pack = {
rootMod: Mod;
};
const { program } = await new Compiler(Deno.args[0]).compile();
type Mod = null;
await Deno.writeTextFile("out.slgbc", JSON.stringify(program));
interface PackEmitter {
emit(pack: Pack): void;
}
class PackCompiler {
public constructor(
private entryFilePath: string,
private emitter: PackEmitter,
) {}
public compile() {
}
}
class ModResolver {
}

5
compiler/old/main.ts Normal file
View File

@ -0,0 +1,5 @@
import { Compiler } from "./compiler.ts";
const { program } = await new Compiler(Deno.args[0]).compile();
await Deno.writeTextFile("out.slgbc", JSON.stringify(program));