From 74787eefa2ac85d85b484d0ca5dffc6a2a13331d Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Mar 2020 16:41:54 +0200 Subject: Added Doxyfile --- include/minishell.h | 25 ------------------------- include/ms_eval.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/ms_parse.h | 13 +++++++++++++ 3 files changed, 64 insertions(+), 25 deletions(-) create mode 100644 include/ms_eval.h (limited to 'include') diff --git a/include/minishell.h b/include/minishell.h index 3398461..04ab243 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -38,31 +38,6 @@ typedef t_ftht* t_path; typedef t_ftht* t_env; -/* -** eval.c -*/ - -typedef struct -{ - t_status_type type; - union - { - char *error_msg; - char *arg; - int code; - } value; -} t_status; - -typedef enum -{ - STYPE_ERROR, - STYPE_ARG, - STYPE_FILE, - // ... -} t_status_type; - -int ms_eval(t_path path, t_env env, t_ast *ast); - /* ** path.c */ diff --git a/include/ms_eval.h b/include/ms_eval.h new file mode 100644 index 0000000..35e7355 --- /dev/null +++ b/include/ms_eval.h @@ -0,0 +1,51 @@ +#ifndef MS_EVAL_H +# define MS_EVAL_H + +/* +** arg: +** type ARG +** value string +** +** redir in: +** type REDIRIN +** value fd +** +** redir out: +** type REDIROUT +** value fd +** +** redir append: +** type REDIRAPPEND +** value fd +*/ + +read state + if redir: + open file keep fd + + +typedef struct +{ + t_status_type type; + union + { + char *str; + int code; + int fd; + } data; +} t_val; + + + +typedef enum +{ + STYPE_ERROR, + STYPE_ARG, + STYPE_FILE, + STYPE_SEXPR, + // ... +} t_status_type; + +int ms_eval(t_path path, t_env env, t_ast *ast); + +#endif diff --git a/include/ms_parse.h b/include/ms_parse.h index 9e28ed6..74604e5 100644 --- a/include/ms_parse.h +++ b/include/ms_parse.h @@ -15,6 +15,19 @@ # include "minishell.h" +/* +** Context free grammar: +** +** redir_in ::= '<' +** redir_out ::= '>' +** redir_append ::= '>>' +** string ::= '\'' .+ '\'' | '"' .+ '"' | [^ ]+ +** sep ::= '&&' | '||' | '|' | ';' +** expr ::= | | | +** sexpr ::= + +** line ::= | +*/ + /* ** TAG_CMD: command name ** TAG_ARG: command argument -- cgit