minishell/inc/tokenizer.h
whaffman 91cb0af6ef Free_safe implemented, ft_lstnew_safe and ft_lstclear_safe added
ft_strdup_safe added
ft_strjoin_safe added
2025-02-25 16:55:13 +01:00

34 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* tokenizer.h :+: :+: */
/* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/05 12:36:00 by whaffman #+# #+# */
/* Updated: 2025/02/25 16:19:05 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef TOKENIZER_H
# define TOKENIZER_H
/**
* Lexer
*/
t_lexer *ft_lexer_new(t_minishell *minishell);
void ft_lexer_free(t_minishell *minishell, t_lexer *lexer);
void lexer_readchar(t_lexer *lexer);
char *lexer_readword(t_minishell *minishell, t_lexer *lexer);
t_list *ft_parse_input(t_minishell *minishell);
/**
* Token
*/
t_token *ft_token_next(t_minishell *minishell, t_lexer *lexer);
t_token *token_new(t_minishell *minishell, t_token_type type, char *c, int pos);
void ft_token_free(t_minishell *minishell, t_token *token);
void ft_clear_tokenlist(t_minishell *minishell, void *content);
t_token *token_parse(t_minishell *minishell, t_lexer *lexer);
#endif // TOKENIZER_H