diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-13 12:01:52 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-13 12:01:52 +0200 |
| commit | d93d65f4c73332e2b3ac9af368f996d654ece06c (patch) | |
| tree | 1c32b59fdfec26f65ff09a138a253a5acc82db3e /include | |
| parent | f08325f76ba4aac15dc3125b7779045956863a4b (diff) | |
| parent | 72ec3b700e8e3142eb9e79098a357f01a6085589 (diff) | |
| download | minishell-d93d65f4c73332e2b3ac9af368f996d654ece06c.tar.gz minishell-d93d65f4c73332e2b3ac9af368f996d654ece06c.tar.bz2 minishell-d93d65f4c73332e2b3ac9af368f996d654ece06c.zip | |
Merge remote-tracking branch 'origin/lexer'
Diffstat (limited to 'include')
| -rw-r--r-- | include/lexer.h | 56 | ||||
| -rw-r--r-- | include/ms_glob.h | 1 | ||||
| -rw-r--r-- | include/parse.h | 4 |
3 files changed, 38 insertions, 23 deletions
diff --git a/include/lexer.h b/include/lexer.h index c56244f..90f9353 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -1,29 +1,43 @@ -#include "minishell.h" +#ifndef LEXER_H +# define LEXER_H -// just to make iterpolation compile -////////////////////////////////////// -enum e_token_tag +# include <stdlib.h> +# include "libft_lst.h" +# include "libft_str.h" +# include "minishell.h" + +enum e_token_tag { - LTAG_STR = 1 << 0, - LTAG_STR_SINGLE = 1 << 1, - LTAG_STR_DOUBLE = 1 << 2, - LTAG_STICK = 1 << 3, + 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, + LTAG_STICK = 1 << 12, }; typedef struct { - enum e_token_tag tag; - char *content; -} t_token; + enum e_token_tag tag; + char *content; +} t_token; + +t_ftlst *lexer(char *input); +enum e_token_tag ret_token(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); -t_token *token_new(enum e_token_tag tag, char *content); -void token_destroy(t_token *token); -////////////////////////////////////// +t_token *token_new(enum e_token_tag tag, char *content); +void token_destroy(t_token *token); -char **lexer(char *input); -int lexer_sep(char input); -int lexer_verif_entre_cote(char *input, int i); -int lexer_verif_entre_cote22(char *input, int i); -int lexer_count_nb_element(char *input); -int lexer_count_len_element(char *input, int i); -char **lexer_malloc_len_elem(char *input, int i, char **out); +#endif diff --git a/include/ms_glob.h b/include/ms_glob.h index 2eb16f1..5b5c932 100644 --- a/include/ms_glob.h +++ b/include/ms_glob.h @@ -19,6 +19,7 @@ # include "libft_str.h" # include "libft_vec.h" # include "utils.h" +# include <limits.h> struct s_glob_param { diff --git a/include/parse.h b/include/parse.h index e864f9a..ec95ef9 100644 --- a/include/parse.h +++ b/include/parse.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/28 09:00:00 by cacharle #+# #+# */ -/* Updated: 2020/06/09 10:55:09 by charles ### ########.fr */ +/* Updated: 2020/06/13 11:59:47 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,7 +37,7 @@ ** lexer.c */ -char **lexer(char *input); +// char **lexer(char *input); /* ** parse.c |
