From 5f908033e68f6f3e03f2c38f4c396a0eab77ed05 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 10 Oct 2020 08:39:24 +0200 Subject: Norming lexer --- include/lexer.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include/lexer.h') diff --git a/include/lexer.h b/include/lexer.h index 36dfd5b..123531d 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/19 10:51:26 by nahaddac #+# #+# */ -/* Updated: 2020/10/09 13:44:09 by cacharle ### ########.fr */ +/* Updated: 2020/10/10 08:35:51 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -64,10 +64,6 @@ enum e_tok TAG_IS_SEP = TAG_AND | TAG_END | TAG_OR, }; -/* -** tok_lst.c -*/ - /* ** \brief Token list struct ** \param content token string content @@ -85,27 +81,33 @@ typedef struct s_tok_lst enum e_tok tag; } t_tok_lst; +/* +** tok_lst.c +*/ + t_tok_lst *tok_lst_new(enum e_tok tag, char *content); t_tok_lst *tok_lst_new_until( enum e_tok tag, char *content, size_t n); -void tok_lst_push_back( - t_tok_lst **tokens, t_tok_lst *pushed); t_tok_lst *tok_lst_push_front( t_tok_lst **tokens, t_tok_lst *pushed); +t_tok_lst *tok_lst_uncons(t_tok_lst **tokens); + +/* +** tok_lst_wrapper.c +*/ + +void tok_lst_push_back( + t_tok_lst **tokens, t_tok_lst *pushed); void tok_lst_pop_front( t_tok_lst **tokens, void (*del)(void*)); void *tok_lst_destroy( t_tok_lst **tokens, void (*del)(void*)); t_tok_lst *tok_lst_last(t_tok_lst *tokens); -t_tok_lst *tok_lst_uncons(t_tok_lst **tokens); /* ** lexer.c */ -int len_until_sep(char *input); -int tok_len(char *input); -t_tok_lst *create_token_list(char *input, t_tok_lst **lst); int lexer(char *input, t_tok_lst **out); /* @@ -113,9 +115,7 @@ int lexer(char *input, t_tok_lst **out); */ enum e_tok tok_assign_tag(char *content); -enum e_tok tok_assign_stick(t_tok_lst *tok); enum e_tok tok_assign_str(t_tok_lst *tok); -int lexer_sep(char input); int lexer_space(char *input); int quote_len(char *input, int i); -- cgit