Files
minishell/include/parser.h
Sergio c493979a18 update: parser now uses tokens from lexer
fixes pending:
 - some functions are longer than norminette allows
 - find solution to a list of commands being returned, even though a
syntax error is found when processing tokens (maybe delegate some work
to the lexer and return only a syntax-valid list?)
2026-02-11 02:51:30 +01:00

41 lines
1.8 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parser.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/10/22 19:03:51 by sede-san #+# #+# */
/* Updated: 2026/02/11 00:35:08 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PARSER_H
# define PARSER_H
# include "minishell.h"
# include "core.h"
# include "builtins.h"
/******************************************************************************/
/* Functions */
/******************************************************************************/
// parser.c
extern t_list *parse(char *line, t_minishell *minishell);
// lexer.c
extern t_list *lex(const char *line);
extern void token_clear(t_token *token);
extern t_command *command_new(t_list **tokens);
extern void command_clear(t_command *command);
extern void command_add_tokens(t_command *command, t_list **tokens);
extern bool is_pipe(t_token *token);
extern bool is_redirection(t_token *token);
void redirection_add(t_list **tokens, t_token *token, t_command *command);
void words_add(t_list **tokens, t_command *command);
#endif /* PARSER_H */