aboutsummaryrefslogtreecommitdiff
path: root/inc/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/context.h')
-rw-r--r--inc/context.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/inc/context.h b/inc/context.h
new file mode 100644
index 0000000..3f7b686
--- /dev/null
+++ b/inc/context.h
@@ -0,0 +1,32 @@
+#ifndef CONTEXT_H
+#define CONTEXT_H
+
+#include <stddef.h>
+
+typedef struct {
+ size_t start, end;
+} ctx_string;
+
+struct ctx {
+ size_t line;
+ size_t column;
+ const char *path;
+
+ char *raw;
+ char *data;
+ size_t size;
+
+ size_t token_count;
+ struct token *tokens;
+
+ struct {
+ struct tree *head;
+ struct node *current;
+ } tree;
+};
+
+struct ctx *context_create(const char *path);
+void context_destroy(struct ctx *ctx);
+void context_rewind(struct ctx *ctx);
+
+#endif