This commit is contained in:
2025-12-08 11:08:08 +11:00
parent 6e733910ec
commit bd1a47d118
7 changed files with 165 additions and 3 deletions

View File

@@ -10,6 +10,10 @@ typedef enum GroundRuntimeError {
ARG_TYPE_MISMATCH, TOO_FEW_ARGS, TOO_MANY_ARGS, UNKNOWN_LABEL, UNKNOWN_VARIABLE, LIST_ERROR, STRING_ERROR, MATH_ERROR, RETURN_TYPE_MISMATCH, FIXME
} GroundRuntimeError;
typedef enum GroundDebugInstructionType {
DUMP, INSPECT, EVAL, CONTINUE, EXIT, HELP, UNKNOWN
} GroundDebugInstructionType;
typedef struct GroundLabel {
char id[MAX_ID_LEN];
int lineNum;
@@ -27,6 +31,11 @@ typedef struct GroundScope {
GroundVariable** variables;
} GroundScope;
typedef struct GroundDebugInstruction {
GroundDebugInstructionType type;
char* arg;
} GroundDebugInstruction;
GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope);
GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scope);