This commit is contained in:
2026-06-21 14:35:48 +10:00
parent f97cec4567
commit ff98aa63b4
11 changed files with 903 additions and 760 deletions

View File

@@ -32,6 +32,8 @@ GroundType _GroundNewType(enum GroundTypeType type, ...);
GroundIdentifier* _GroundNewIdentifier(const char* id);
GroundBytecode _GroundNewBytecode (GroundProgram* program, GroundState* state);
void _GroundFreeValue(GroundValue* in);
void _GroundFreeList(GroundList* in);
void _GroundFreeString(GroundString* in);
@@ -93,6 +95,13 @@ void _GroundLogWarning(const char* message);
void _GroundLogPrintErrors();
void _GroundBytecodeProgramExecute(GroundBytecodeProgram* program, GroundBytecodeHeap* heap);
void _GroundBytecodeProgramOptimise(GroundBytecodeProgram* program);
int64_t _GroundBytecodeInstructionExecute(GroundBytecodeInstruction* instruction, GroundBytecodeHeap* heap);
void _GroundBytecodeHeapSet(GroundBytecodeHeap* heap, GroundSize idx, GroundValue value);
GroundValue* _GroundBytecodeHeapGet(GroundBytecodeHeap* heap, GroundSize idx);
struct _Ground Ground = {
@@ -136,6 +145,8 @@ struct _Ground Ground = {
.Type = _GroundNewType,
.Identifier = _GroundNewIdentifier,
.Bytecode = _GroundNewBytecode,
},
.Free = {
@@ -210,4 +221,18 @@ struct _Ground Ground = {
.errors = NULL,
.warnings = NULL,
},
.Bytecode = {
.Program = {
.execute = _GroundBytecodeProgramExecute,
.optimise = _GroundBytecodeProgramOptimise,
},
.Instruction = {
.execute = _GroundBytecodeInstructionExecute,
},
.Heap = {
.set = _GroundBytecodeHeapSet,
.get = _GroundBytecodeHeapGet,
},
},
};