feat: ast structs deinitions

This commit is contained in:
Gu://em_ 2026-01-08 18:17:02 +01:00
parent 919ea7b1ba
commit 7d7acbea67

View file

@ -1,22 +1,37 @@
#ifndef AST_H #ifndef AST_H
#define AST_H #define AST_H
#include "lists.h"
enum ast_type enum ast_type
{ {
AST_NULL = 0, AST_END = 0,
ATS_IF, ATS_IF,
AST_CMD AST_CMD
}; };
union ast_union union ast_node
{ {
struct ast_if;
struct ast_cmd;
}; };
struct ast struct ast
{ {
enum ast_type type; 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 */ #endif /* ! AST_H */