diff options
| author | nass1pro <nass1pro@gmail.com> | 2020-06-15 13:00:24 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-06-15 13:00:24 +0200 |
| commit | a7dae7d30b7087bcd9972792a2ee1248e081cfce (patch) | |
| tree | 21c567c81a542991eb27eb4056b74df8a8d8cc0e /include | |
| parent | 72ee131562574c4a6cb69800cdd81268b52ace84 (diff) | |
| download | minishell-a7dae7d30b7087bcd9972792a2ee1248e081cfce.tar.gz minishell-a7dae7d30b7087bcd9972792a2ee1248e081cfce.tar.bz2 minishell-a7dae7d30b7087bcd9972792a2ee1248e081cfce.zip | |
ADD redir_parse draft
Diffstat (limited to 'include')
| -rw-r--r-- | include/ast.h | 5 | ||||
| -rw-r--r-- | include/lexer.h | 2 | ||||
| -rw-r--r-- | include/parser.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/include/ast.h b/include/ast.h index 790ac29..4e89c96 100644 --- a/include/ast.h +++ b/include/ast.h @@ -32,6 +32,7 @@ struct s_ast; ** \param sep Type of separator */ + typedef struct s_line { struct s_ast *left; @@ -69,9 +70,7 @@ typedef struct s_ast t_line line; t_ftlst *cmd_argv; }; - t_ftlst *in; - t_ftlst *out; - bool is_append; + t_ftlst *redirs; } t_ast; typedef struct s_ret diff --git a/include/lexer.h b/include/lexer.h index e2abe28..bc1238c 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -21,6 +21,8 @@ enum e_token_tag TAG_STR_DOUBLE = 1 << 10, TAG_STR_SINGLE = 1 << 11, TAG_STICK = 1 << 12, + TAG_IS_STR = TAG_STR | TAG_STR_SINGLE | TAG_STR_DOUBLE, + TAG_IS_REDIR = TAG_REDIR_IN | TAG_REDIR_OUT | TAG_REDIR_APPEND, }; typedef struct diff --git a/include/parser.h b/include/parser.h index 099d4aa..2e6bae1 100644 --- a/include/parser.h +++ b/include/parser.h @@ -39,7 +39,9 @@ t_ret *parse(t_ftlst *input); t_ast *parse_cmd(t_ast *ast, t_ftlst *ret); +t_ast *parse_redir(t_ast *ast, t_ftlst *rest); int parse_cmd_str_true_false(enum e_token_tag tag); +int parse_redir_true_false(enum e_token_tag tag); #endif |
