Updated Toy, added a couple util functions

This commit is contained in:
2022-10-15 00:04:58 +01:00
parent dfcdaf3b92
commit 2eb67d9bca
9 changed files with 107 additions and 9 deletions

View File

@@ -5,9 +5,10 @@
#include "literal_dictionary.h"
#include "interpreter.h"
#define OPAQUE_TAG_ENGINE_NODE 1
//forward declare
typedef struct _engineNode EngineNode;
typedef void (*EngineNodeCallback)(void*);
//the node object, which forms a tree
@@ -18,6 +19,13 @@ typedef struct _engineNode {
//toy functions, stored in a dict for flexibility
LiteralDictionary* functions;
//point to the parent
EngineNode* parent;
//my opaque type tag
int tag;
int _unused;
//use Toy's memory model
EngineNode** children;
int capacity;