feat: Merge branch 'ast-def' into dev

This commit is contained in:
Gu://em_ 2026-01-09 16:06:18 +01:00
commit 3a8ab44300
3 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,9 @@
lib_LIBRARIES = libast.a
libast_a_SOURCES = \
ast.c \
ast.h
libast_a_CPPFLAGS = -I$(top_srcdir)/src
noinst_LIBRARIES = libast.a

0
src/utils/ast/ast.c Normal file
View file

37
src/utils/ast/ast.h Normal file
View file

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