summaryrefslogtreecommitdiff
path: root/src/core/parser.h
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2025-04-15 14:09:14 +0000
committerLinnnus <[email protected]>2025-04-15 14:09:14 +0000
commitdb682a9cea30ba5295fe160012e2c7593c8cee89 (patch)
tree6c73c9e4517a53ce4b528084a4d8c14ada938c9d /src/core/parser.h
parentf667ae8eff0f0e87130c7b5b934e32c9fdb9f957 (diff)
Diffstat (limited to 'src/core/parser.h')
-rw-r--r--src/core/parser.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/parser.h b/src/core/parser.h
new file mode 100644
index 0000000..d514341
--- /dev/null
+++ b/src/core/parser.h
@@ -0,0 +1,30 @@
+#ifndef SAND_PARSER_H
+#define SAND_PARSER_H
+
+#include "allocator.h"
+#include "tokenizer.h"
+#include "state.h"
+
+typedef enum {
+ SAND_AST_BINARY_OP,
+ SAND_AST_NUMBER,
+} SandAstKind;
+
+typedef struct {
+ SandToken op;
+ struct _SandAst *left;
+ struct _SandAst *right;
+} SandAstBinaryOp;
+
+typedef struct {
+ SandToken value;
+} SandAstNumber;
+
+typedef struct _SandAst {
+ SandAstKind kind;
+ SandLocation location;
+} SandAst;
+
+SandAst *sand_parse(SandState *, SandAllocator *, const char *source, size_t source_length, const char *filename);
+
+#endif