aboutsummaryrefslogtreecommitdiff
path: root/test_mini/lexer.h
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-06-09 19:48:34 +0200
committernass1pro <nass1pro@gmail.com>2020-06-13 11:31:00 +0200
commit579a26f5593039ffbbd1a81e45ecf0ef8797cb5d (patch)
treec5b6761db98e27d15bab3fb45ba9e0a646cf06e0 /test_mini/lexer.h
parent9fabc25a980550afc6337fd729632462f2680daa (diff)
downloadminishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.tar.gz
minishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.tar.bz2
minishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.zip
add lexer
add single quote
Diffstat (limited to 'test_mini/lexer.h')
-rw-r--r--test_mini/lexer.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/test_mini/lexer.h b/test_mini/lexer.h
new file mode 100644
index 0000000..a8680da
--- /dev/null
+++ b/test_mini/lexer.h
@@ -0,0 +1,38 @@
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <libc.h>
+# include "libft/include/libft_lst.h"
+# include "libft/include/libft_str.h"
+
+
+enum e_token_tag
+{
+ LTAG_AND = 1 << 0,
+ LTAG_END = 1 << 1,
+ LTAG_OR = 1 << 2,
+ LTAG_PIPE = 1 << 3,
+ LTAG_REDIR_IN = 1 << 4,
+ LTAG_REDIR_OUT = 1 << 5,
+ LTAG_REDIR_APPEND = 1 << 6,
+ LTAG_PARENT_OPEN = 1 << 7,
+ LTAG_PARENT_CLOSE = 1 << 8,
+ LTAG_STR = 1 << 9,
+ LTAG_STR_DOUBLE = 1 << 10,
+ LTAG_STR_SINGLE = 1 << 11,
+};
+
+typedef struct s_token
+{
+ enum e_token_tag token;
+ char *value;
+
+} t_token;
+
+t_ftlst *lexer(char *input);
+enum e_token_tag ret_token_sep(char *input, int i);
+enum e_token_tag ret_token_sep_redir_append(char *input, int i);
+
+int lexer_sep(char input);
+int lexer_verif_entre_cote(char *input, int i);
+int lexe_space(char *input);