42sh/src/ast/ast.h
2026-01-09 13:46:37 +00:00

39 lines
453 B
C

#ifndef AST_H
#define AST_H
#include "../utils/lists/lists.h"
enum ast_type
{
AST_END = 0,
AST_IF,
AST_CMD
};
struct ast_cmd
{
struct list *cmd;
};
union ast_node;
struct ast
{
enum ast_type type;
union ast_node *data;
};
struct ast_if
{
struct ast *condition;
struct ast *then_clause;
struct ast *else_clause;
};
union ast_node
{
struct ast_if ast_if;
struct ast_cmd ast_cmd;
};
#endif /* ! AST_H */