From db682a9cea30ba5295fe160012e2c7593c8cee89 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 15 Apr 2025 14:09:14 +0000 Subject: tmp --- src/core/parser.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/core/parser.h (limited to 'src/core/parser.h') 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 -- cgit v1.2.3