/* ************************************************************************** */
/*                                                                            */
/*                                                        ::::::::            */
/*   tokenizer.h                                        :+:    :+:            */
/*                                                     +:+                    */
/*   By: qmennen <qmennen@student.codam.nl>           +#+                     */
/*                                                   +#+                      */
/*   Created: 2025/02/05 12:36:00 by whaffman      #+#    #+#                 */
/*   Updated: 2025/02/28 14:09:17 by whaffman      ########   odam.nl         */
/*                                                                            */
/* ************************************************************************** */

#ifndef TOKENIZER_H
# define TOKENIZER_H

/**
 * Lexer
 */
t_lexer			*ft_lexer_new(t_minishell *msh);
void			ft_lexer_free(t_minishell *msh, t_lexer *lexer);
void			lexer_readchar(t_lexer *lexer);
char			*lexer_readword(t_minishell *msh, t_lexer *lexer);
t_list			*ft_parse_input(t_minishell *msh);
char			*lexer_parse_quotes(t_minishell *msh, t_lexer *lexer);
/**
 * Token
 */
t_token			*ft_token_next(t_minishell *msh, t_lexer *lexer);
t_token			*token_new(t_minishell *msh,
					t_token_type type, char *c, int pos);
void			ft_token_free(t_minishell *msh, t_token *token);
void			ft_clear_tokenlist(t_minishell *msh, void *content);
t_token			*token_parse(t_minishell *msh, t_lexer *lexer);
char			*token_type_convert(t_token_type type);
t_token_type	token_char_convert(char c, int is_double);

#endif // TOKENIZER_H
