summary refs log tree commit diff
path: root/cccl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cccl.h')
-rw-r--r--cccl.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/cccl.h b/cccl.h
index 48ad499..37b0970 100644
--- a/cccl.h
+++ b/cccl.h
@@ -6,8 +6,6 @@
 
 #define TOKENS_LIMIT 16384
 
-extern int verbose;
-
 struct cccl_File
 {
     char *buffer;
@@ -63,10 +61,40 @@ struct cccl_Node
     char value;
 };
 
+enum cccl_ExecutorStatus
+{
+    cccl_Executr_OK = 0,
+    cccl_Executor_ERROR,
+    cccl_EXECUTOR_CONTINUE,
+    cccl_Executor_END,
+};
+
+struct cccl_Variables
+{
+    short buffer[52];
+    char used[52];
+};
+
+struct cccl_Function
+{
+    struct cccl_Node **body;
+    size_t length;
+};
+
+struct cccl_Stack
+{
+    short *buffer;
+    size_t length;
+    size_t allocated;
+};
+
+extern int verbose;
+
 int cccl_allocfile(const char *path, struct cccl_File *file);
 
 void cccl(struct cccl_File file);
 size_t cccl_tokenize(const char *code, size_t size, struct cccl_Token tokens[], size_t tokens_length);
 struct cccl_Node *cccl_parse(struct cccl_Token tokens[], size_t tokens_length, enum cccl_NodeType type, char value);
+enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variables *scope);
 
 #endif /* __CCCL_H__ */