42sh/src/utils/ast/ast.h
2026-01-09 16:05:41 +01:00

37 lines
407 B
C

#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 */