feat: setup for parser

This commit is contained in:
Quinten Mennen 2025-02-11 14:07:46 +01:00
parent 97b6321983
commit 015c5eb330
5 changed files with 41 additions and 1 deletions

View File

@ -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))

View File

@ -20,6 +20,7 @@
# include "prompt.h"
# include "tokenizer.h"
# include "executor.h"
# include "parser.h"
# include "utils.h"
# define TRUE 1

18
inc/parser.h Normal file
View File

@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parser.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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

View File

@ -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;

13
src/parser/parser.c Normal file
View File

@ -0,0 +1,13 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parser.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/11 14:06:02 by qmennen #+# #+# */
/* Updated: 2025/02/11 14:06:06 by qmennen ### ########.fr */
/* */
/* ************************************************************************** */
#include "parser.h"