diff --git a/Makefile b/Makefile index 4530439..7c8878a 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ LIBFT = $(LIBFT_PATH)/libft.a OBJ_PATH = obj -VPATH = src:src/environment:src/prompt:src/lexer:src/token:src/utils:src/executor +VPATH = src:src/environment:src/prompt:src/lexer:src/token:src/utils:src/executor:src/parser SOURCES = $(shell basename -a $(shell find $(SRC_PATH) -type f -name "*.c")) OBJECTS = $(addprefix $(OBJ_PATH)/, $(SOURCES:.c=.o)) diff --git a/inc/minishell.h b/inc/minishell.h index 3dd180d..9b98018 100644 --- a/inc/minishell.h +++ b/inc/minishell.h @@ -20,6 +20,7 @@ # include "prompt.h" # include "tokenizer.h" # include "executor.h" +# include "parser.h" # include "utils.h" # define TRUE 1 diff --git a/inc/parser.h b/inc/parser.h new file mode 100644 index 0000000..74afc75 --- /dev/null +++ b/inc/parser.h @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* parser.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: qmennen +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/02/11 14:03:03 by qmennen #+# #+# */ +/* Updated: 2025/02/11 14:03:36 by qmennen ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef PARSER_H +# define PARSER_H + +#include "minishell.h" + +#endif diff --git a/inc/typedef.h b/inc/typedef.h index 5a9f9cd..d784297 100644 --- a/inc/typedef.h +++ b/inc/typedef.h @@ -45,6 +45,14 @@ typedef struct s_lexer char current_char; } t_lexer; +typedef struct s_command +{ + char *command; + char **args; + int fd_in; + int fd_out; +} t_command; + typedef struct s_minishell { t_list *environment; diff --git a/src/parser/parser.c b/src/parser/parser.c new file mode 100644 index 0000000..8936ec4 --- /dev/null +++ b/src/parser/parser.c @@ -0,0 +1,13 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* parser.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: qmennen +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/02/11 14:06:02 by qmennen #+# #+# */ +/* Updated: 2025/02/11 14:06:06 by qmennen ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "parser.h"