hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 13:47:08 +0200
committerhachem <im@hachem.wtf>2026-09-19 13:47:08 +0200
commitd0ca03c84bcad3dc42fd173b0baf3a15e9b52f9b (patch)
tree89fa494129849e23b1d760466e87ef6046cbfcb4 /ast.h
parenta79c97e04562b171780a24cba2cb1a71acfa4bbb (diff)
feat: add conditionals
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ast.h b/ast.h
index c25e118..d993c2e 100644
--- a/ast.h
+++ b/ast.h
@@ -9,6 +9,7 @@ enum NodeKind
TYPE_SIZE,
TYPE_REMOVE_CV,
TYPE_ARRAY,
+ TYPE_CONDITIONAL,
TYPE_DECLTYPE,
VALUE_DIFFERENCE,
VALUE_SUM,
@@ -17,6 +18,12 @@ enum NodeKind
VALUE_EXTENT,
VALUE_TUPLE_SIZE,
VALUE_INTEGRAL_CONSTANT,
+ VALUE_CONDITIONAL,
+ COND_TRUE,
+ COND_FALSE,
+ COND_IS_SAME,
+ COND_EQUAL,
+ COND_LESS,
STMT_EMIT
};
@@ -27,6 +34,7 @@ struct Node
char character;
struct Node* first;
struct Node* second;
+ struct Node* third;
struct Node* next;
};
@@ -34,6 +42,8 @@ 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_ternary(enum NodeKind kind, struct Node* first, struct Node* second,
+ struct Node* third);
struct Node* node_append(struct Node* list, struct Node* node);
void node_free(struct Node* node);