Did some work today, including function parsing
This commit is contained in:
parent
85192bb4c1
commit
3bf4a73c2e
4 changed files with 275 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
|||
#define FLUP_INTERPRETER_H
|
||||
|
||||
#include "../submodules/utilitiec/src/dynamicarray/dynamicarray.h"
|
||||
#include "../submodules/utilitiec/src/Scratchpad/Scratchpad.h"
|
||||
|
||||
#include "tokenizer.h"
|
||||
#include <stdint.h>
|
||||
|
@ -15,13 +16,14 @@ typedef struct FlupFunctionAlternative_s {
|
|||
} FlupFunctionAlternative;
|
||||
|
||||
typedef struct ParameterDefinition_s {
|
||||
StringView name;
|
||||
StringView type;
|
||||
StringView name;
|
||||
struct ParameterDefinition_s* next;
|
||||
} ParameterDefinition;
|
||||
|
||||
typedef struct FlupFunction_s {
|
||||
StringView name;
|
||||
DynamicArray argument_defs; // ParameterDefinition
|
||||
ParameterDefinition* parameters;
|
||||
StringView return_type;
|
||||
FlupFunctionAlternative* alternative;
|
||||
} FlupFunction;
|
||||
|
@ -43,8 +45,13 @@ typedef struct Value_s {
|
|||
|
||||
typedef struct CallFrame_s {
|
||||
size_t instruction_pointer;
|
||||
/* ip = condition start : start
|
||||
* ip = condition_end + 1 : done
|
||||
*
|
||||
*/
|
||||
FlupFunctionAlternative* function;
|
||||
DynamicArray stack; // Value
|
||||
Scratchpad memory_pad;
|
||||
} CallFrame;
|
||||
|
||||
typedef struct Interpreter_s {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue