save commit

This commit is contained in:
2026-02-09 20:47:43 +01:00
parent e983f7fe64
commit 280fa51f94
39 changed files with 3400 additions and 239 deletions

View File

@@ -6,7 +6,7 @@
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/10/22 19:03:51 by sede-san #+# #+# */
/* Updated: 2025/10/30 12:44:51 by sede-san ### ########.fr */
/* Updated: 2026/02/09 20:36:19 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,6 +14,46 @@
# define PARSER_H
# include "minishell.h"
# include "core.h"
# include "builtins.h"
# define PIPE_STR "|"
# define REDIRECT_IN_STR "<"
# define REDIRECT_OUT_STR ">"
# define APPEND_STR ">>"
# define HEREDOC_STR "<<"
# define TOKENS_COUNT 5
typedef enum e_token_type
{
TOKEN_WORD,
TOKEN_PIPE,
TOKEN_REDIRECT_IN,
TOKEN_REDIRECT_OUT,
TOKEN_APPEND,
TOKEN_HEREDOC
} t_token_type;
typedef struct s_token
{
t_token_type type;
char *value;
} t_token;
typedef enum e_redirection_type
{
REDIRECT_IN,
REDIRECT_OUT,
APPEND,
HEREDOC
} t_redirection_type;
typedef struct s_redirection
{
t_redirection_type type;
char *target;
} t_redirection;
/******************************************************************************/
/* Functions */
@@ -21,6 +61,6 @@
// parser.c
extern t_command parse(char *line, t_minishell *minishell);
extern t_list *parse(char *line, t_minishell *minishell);
#endif /* PARSER_H */