summaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ast.h b/ast.h
index e77c779..8611aaa 100644
--- a/ast.h
+++ b/ast.h
@@ -78,6 +78,11 @@ struct paren_node {
struct expr_list_node* expr_list;
};
+struct cast_node {
+ struct type type;
+ struct expr_node* expr;
+};
+
struct expr_node {
enum {
EXPR_INT_LIT,
@@ -90,6 +95,7 @@ struct expr_node {
EXPR_UNARY,
EXPR_BINARY,
EXPR_PAREN,
+ EXPR_CAST,
} type;
union {
struct int_lit_node int_lit;
@@ -102,6 +108,7 @@ struct expr_node {
struct unary_node unary;
struct binary_node binary;
struct paren_node paren;
+ struct cast_node cast;
} inner;
const struct type* resolved_type;