Function calling
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include "include/uthash.h"
|
||||
|
||||
typedef enum GroundRuntimeError {
|
||||
ARG_TYPE_MISMATCH, TOO_FEW_ARGS, TOO_MANY_ARGS, UNKNOWN_LABEL, UNKNOWN_VARIABLE, LIST_ERROR, STRING_ERROR, MATH_ERROR, FIXME
|
||||
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 struct GroundLabel {
|
||||
@@ -22,28 +22,9 @@ typedef struct GroundVariable {
|
||||
UT_hash_handle hh;
|
||||
} GroundVariable;
|
||||
|
||||
typedef struct GroundFunctionArgs {
|
||||
GroundValueType type;
|
||||
char* name;
|
||||
} GroundFunctionArgs;
|
||||
|
||||
typedef struct GroundFunction {
|
||||
GroundFunctionArgs* args;
|
||||
size_t argSize;
|
||||
GroundValueType returnType;
|
||||
GroundProgram program;
|
||||
} GroundFunction;
|
||||
|
||||
typedef struct GroundFunctionWrapper {
|
||||
char id[MAX_ID_LEN];
|
||||
GroundFunction function;
|
||||
UT_hash_handle hh;
|
||||
} GroundFunctionWrapper;
|
||||
|
||||
typedef struct GroundScope {
|
||||
GroundLabel** labels;
|
||||
GroundVariable** variables;
|
||||
GroundFunctionWrapper** functions;
|
||||
} GroundScope;
|
||||
|
||||
GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope);
|
||||
|
||||
Reference in New Issue
Block a user