Compare commits
2 Commits
09c3c3277b
...
e8cfd059cc
Author | SHA1 | Date | |
---|---|---|---|
e8cfd059cc | |||
00298d6d83 |
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
5
compiler/old/main.ts
Normal 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));
|
Loading…
x
Reference in New Issue
Block a user