From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- 42sh/src/parser/parser.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 42sh/src/parser/parser.h (limited to '42sh/src/parser/parser.h') diff --git a/42sh/src/parser/parser.h b/42sh/src/parser/parser.h new file mode 100644 index 0000000..c029a63 --- /dev/null +++ b/42sh/src/parser/parser.h @@ -0,0 +1,17 @@ +#ifndef PARSER_H +#define PARSER_H + +#include "ast/ast.h" +#include "lexer/lexer.h" +#include "parser/parser_utils.h" + +/** + * @brief The main function to be called in the main loop. It will parse the + * current expression given by the lexer. Return NULL and set the state variable + * to `ERROR` if an error occured, else return the AST for this expression. + * @param lexer The lexer used to create the AST. + * @param state A pointger used to store the current state of the pointer. + */ +struct ast *parse(struct lexer *lexer, enum parser_state *state); + +#endif /* ! PARSER_H */ -- cgit v1.2.3