aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-30 16:41:54 +0200
committerCharles <sircharlesaze@gmail.com>2020-03-30 16:41:54 +0200
commit74787eefa2ac85d85b484d0ca5dffc6a2a13331d (patch)
tree61000ecb790c31ec317f0f7758db4e2595e3bfbc /include
parentffec9915be37ceebeadeb12958cbb7424cbd3633 (diff)
downloadminishell-74787eefa2ac85d85b484d0ca5dffc6a2a13331d.tar.gz
minishell-74787eefa2ac85d85b484d0ca5dffc6a2a13331d.tar.bz2
minishell-74787eefa2ac85d85b484d0ca5dffc6a2a13331d.zip
Added Doxyfile
Diffstat (limited to 'include')
-rw-r--r--include/minishell.h25
-rw-r--r--include/ms_eval.h51
-rw-r--r--include/ms_parse.h13
3 files changed, 64 insertions, 25 deletions
diff --git a/include/minishell.h b/include/minishell.h
index 3398461..04ab243 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -39,31 +39,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
@@ -16,6 +16,19 @@
# include "minishell.h"
/*
+** Context free grammar:
+**
+** redir_in ::= '<' <string>
+** redir_out ::= '>' <string>
+** redir_append ::= '>>' <string>
+** string ::= '\'' .+ '\'' | '"' .+ '"' | [^ ]+
+** sep ::= '&&' | '||' | '|' | ';'
+** expr ::= <redir_in> | <redir_out> | <redir_append> | <string>
+** sexpr ::= <expr>+
+** line ::= <sexpr> <sep> <line> | <sexpr>
+*/
+
+/*
** TAG_CMD: command name
** TAG_ARG: command argument
** TAG_ENDCMD: `;`