From 7d7acbea67b3d093ceddb02dd4a66ef079c17f3b Mon Sep 17 00:00:00 2001 From: "Gu://em_" Date: Thu, 8 Jan 2026 18:17:02 +0100 Subject: [PATCH] feat: ast structs deinitions --- src/ast/ast.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/ast/ast.h b/src/ast/ast.h index 4c14043..8bc510e 100644 --- a/src/ast/ast.h +++ b/src/ast/ast.h @@ -1,22 +1,37 @@ #ifndef AST_H #define AST_H +#include "lists.h" enum ast_type { - AST_NULL = 0, + AST_END = 0, ATS_IF, AST_CMD }; -union ast_union +union ast_node { + struct ast_if; + struct ast_cmd; }; struct ast { enum ast_type type; - union ast_union data; + union ast_node data; +}; + +struct ast_if +{ + struct ast* condition; + struct ast* then_clause; + struct ast* else_clause; +}; + +struct ast_cmd +{ + struct list* cmd; }; #endif /* ! AST_H */