feat: setup for parser
This commit is contained in:
parent
97b6321983
commit
015c5eb330
2
Makefile
2
Makefile
@ -22,7 +22,7 @@ LIBFT = $(LIBFT_PATH)/libft.a
|
|||||||
|
|
||||||
OBJ_PATH = obj
|
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"))
|
SOURCES = $(shell basename -a $(shell find $(SRC_PATH) -type f -name "*.c"))
|
||||||
|
|
||||||
OBJECTS = $(addprefix $(OBJ_PATH)/, $(SOURCES:.c=.o))
|
OBJECTS = $(addprefix $(OBJ_PATH)/, $(SOURCES:.c=.o))
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
# include "prompt.h"
|
# include "prompt.h"
|
||||||
# include "tokenizer.h"
|
# include "tokenizer.h"
|
||||||
# include "executor.h"
|
# include "executor.h"
|
||||||
|
# include "parser.h"
|
||||||
# include "utils.h"
|
# include "utils.h"
|
||||||
|
|
||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
|
|||||||
18
inc/parser.h
Normal file
18
inc/parser.h
Normal 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
|
||||||
@ -45,6 +45,14 @@ typedef struct s_lexer
|
|||||||
char current_char;
|
char current_char;
|
||||||
} t_lexer;
|
} t_lexer;
|
||||||
|
|
||||||
|
typedef struct s_command
|
||||||
|
{
|
||||||
|
char *command;
|
||||||
|
char **args;
|
||||||
|
int fd_in;
|
||||||
|
int fd_out;
|
||||||
|
} t_command;
|
||||||
|
|
||||||
typedef struct s_minishell
|
typedef struct s_minishell
|
||||||
{
|
{
|
||||||
t_list *environment;
|
t_list *environment;
|
||||||
|
|||||||
13
src/parser/parser.c
Normal file
13
src/parser/parser.c
Normal 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"
|
||||||
Loading…
Reference in New Issue
Block a user