diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /42sh/src/parser/parser.h | |
Diffstat (limited to '42sh/src/parser/parser.h')
| -rw-r--r-- | 42sh/src/parser/parser.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 */ |
