MiniDevil As beautiful as a shell
ast.h
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* ast.h :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: baelgadi <baelgadi@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2025/12/07 18:19:21 by zotaj-di #+# #+# */
9 /* Updated: 2026/03/11 02:54:26 by baelgadi ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #ifndef AST_H
14 # define AST_H
15 
16 # include "structs.h"
17 
18 /* ────────────── ast.c ──────────────── */
19 
20 t_ast *create_cmd_node(char **args, int argc);
21 
22 t_ast *create_pipe_node(t_ast *left, t_ast *right);
23 
24 t_ast *create_redir_node(t_node_type type, char *file, t_ast *cmd, int quote);
25 
26 /* ────────────── ast_utils.c ──────────────── */
27 
28 void free_ast(t_ast *node);
29 
30 /* ────────────── B O N U S ──────────────── */
31 
34 t_ast *create_and_or_node(t_node_type type, t_ast *left, t_ast *right);
35 
36 t_ast *create_subshell_node(t_ast *child);
37 
40 #endif
void free_ast(t_ast *node)
Recursively free an entire AST tree.
Definition: ast_utils.c:46
t_ast * create_cmd_node(char **args, int argc)
Create a NODE_COMMAND AST node.
Definition: ast.c:23
t_ast * create_pipe_node(t_ast *left, t_ast *right)
Create a pipe AST node connecting 2 subtrees.
Definition: ast.c:43
t_ast * create_redir_node(t_node_type type, char *file, t_ast *cmd, int quote)
Create a redirection AST node.
Definition: ast.c:71
Central type definitions for mandatory part.
t_node_type
AST node types.
Definition: structs.h:51
AST node (union based ↑)
Definition: structs.h:151