From a7dae7d30b7087bcd9972792a2ee1248e081cfce Mon Sep 17 00:00:00 2001 From: nass1pro Date: Mon, 15 Jun 2020 13:00:24 +0200 Subject: ADD redir_parse draft --- include/ast.h | 5 ++--- include/lexer.h | 2 ++ include/parser.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'include') 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 -- cgit