diff options
| author | cuhlig | 2024-12-17 15:22:32 +0100 |
|---|---|---|
| committer | GitHub | 2024-12-17 15:22:32 +0100 |
| commit | a93558047c6d04ca4181fa84229d82b09dd7def2 (patch) | |
| tree | a0b67075c625731e1e1d526db46eb5dec81b5616 /include/ast.h | |
| parent | 8cbba6da72ddd04e358bdb893e700702f92adacd (diff) | |
| parent | ae5512ea0d6d8be833ca3a9b39f93239109f45b4 (diff) | |
| download | minishell-a93558047c6d04ca4181fa84229d82b09dd7def2.tar.gz minishell-a93558047c6d04ca4181fa84229d82b09dd7def2.zip | |
Merge branch 'main' into bugfix-tokenizer
Diffstat (limited to 'include/ast.h')
| -rw-r--r-- | include/ast.h | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/include/ast.h b/include/ast.h index e6ad25d..cd2f9c9 100644 --- a/include/ast.h +++ b/include/ast.h @@ -6,32 +6,20 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/27 11:48:27 by dkaiser #+# #+# */ -/* Updated: 2024/06/28 14:56:55 by dkaiser ### ########.fr */ +/* Updated: 2024/08/11 12:20:56 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ -#include "stdlib.h" #include "debug_tools.h" - -typedef struct s_sequence -{ - struct s_node **nodes; -} t_sequence; +#include "stdlib.h" enum e_node_type { - ASSIGN_NODE, PIPE_NODE, CMD_NODE, STRING_NODE }; -typedef struct s_assign -{ - char *var; - char *value; -} t_assign; - typedef struct s_pipe { struct s_node *left; @@ -40,10 +28,10 @@ typedef struct s_pipe enum e_redirection_type { - INPUT_FILE, - INPUT_LIMITER, - OUTPUT_OVERRIDE, - OUTPUT_APPEND + INPUT_FILE = 1, + INPUT_LIMITER = 2, + OUTPUT_OVERRIDE = 4, + OUTPUT_APPEND = 8 }; typedef struct s_redirection @@ -60,7 +48,6 @@ typedef struct s_cmd union u_node_content { - struct s_assign assign; struct s_pipe pipe; struct s_cmd cmd; char *string; @@ -73,7 +60,8 @@ typedef struct s_node } t_node; t_node *new_node(int type); -t_node *new_assign_node(char *var, char *value); t_node *new_pipe_node(t_node *left, t_node *right); t_node *new_cmd_node(char **args, t_redirection redirs[2]); t_node *new_string_node(char *string); + +void free_node(t_node *node); |
