diff options
Diffstat (limited to 'ast.h')
| -rw-r--r-- | ast.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#pragma once + +enum NodeKind +{ + NODE_CHAR, + TYPE_DECLTYPE, + VALUE_DIFFERENCE, + STMT_EMIT +}; + +struct Node +{ + enum NodeKind kind; + int line; + char character; + struct Node* first; + struct Node* second; + struct Node* next; +}; + +struct Node* node_leaf(enum NodeKind kind); +struct Node* node_char(char character); +struct Node* node_unary(enum NodeKind kind, struct Node* first); +struct Node* node_binary(enum NodeKind kind, struct Node* first, struct Node* second); + +struct Node* node_append(struct Node* list, struct Node* node); +void node_free(struct Node* node); |
