diff options
| author | hachem <im@hachem.wtf> | 2026-08-30 03:32:51 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-30 03:32:51 +0200 |
| commit | 5767110816ca9452ef77d15245d1a747bfdd896b (patch) | |
| tree | 1f7e5dec5f1fb4fe7a53c1c81f94043ba7db5676 /src/parser/ast.h | |
| parent | 6a6e79cb233e795b78c9ec750dbae9d26bd51654 (diff) | |
add: top level parser
Diffstat (limited to 'src/parser/ast.h')
| -rw-r--r-- | src/parser/ast.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/parser/ast.h b/src/parser/ast.h new file mode 100644 index 0000000..7079305 --- /dev/null +++ b/src/parser/ast.h @@ -0,0 +1,22 @@ +#pragma once + +#include <stddef.h> + +#include "lexer/lexer.h" + +struct ConstDecl +{ + struct Token name; + struct Token value; +}; + +struct Program +{ + struct ConstDecl* consts; + size_t const_count; + size_t const_capacity; +}; + +struct Program create_program(void); +void free_program(struct Program* program); +void add_const(struct Program* program, struct ConstDecl decl); |
