diff options
author | standenboy <standenboy@seacrossedlovers.xyz> | 2024-05-06 09:32:48 +0100 |
---|---|---|
committer | standenboy <standenboy@seacrossedlovers.xyz> | 2024-05-06 09:32:48 +0100 |
commit | 319e7ea0a724cd97041c1aaf1281c4ca6aa688d1 (patch) | |
tree | 7411f4636ce9ce9733760666f3311a17b6e4d17c /comp/lucas-standen-NEA/code/proto/ast/astg.h | |
parent | 0ca35b27de52a5d3acf5f2eb877a440c1103e928 (diff) |
added a load of stuff, and fixed a git conflict
Diffstat (limited to 'comp/lucas-standen-NEA/code/proto/ast/astg.h')
-rw-r--r-- | comp/lucas-standen-NEA/code/proto/ast/astg.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code/proto/ast/astg.h b/comp/lucas-standen-NEA/code/proto/ast/astg.h new file mode 100644 index 0000000..16250b2 --- /dev/null +++ b/comp/lucas-standen-NEA/code/proto/ast/astg.h @@ -0,0 +1,19 @@ +typedef struct ast_node ast_node; + +typedef enum op { + ADD = 0, + SUB = 1, + MUL = 2, + DIV = 3, +} op; + +typedef struct ast_node { + op operation; + int realLeft; + int realRight; + ast_node *right; + ast_node *left; +} ast_node; + +int exec(ast_node *exp); +void freeAst(ast_node *head); |