feat: yet another new parser architecture
This commit is contained in:
parent
6dd19a75ad
commit
96ac2fea77
9 changed files with 182 additions and 128 deletions
|
|
@ -1,9 +1,28 @@
|
|||
#ifndef PARSER_H
|
||||
#define PARSER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "../lexer/lexer.h"
|
||||
#include "../utils/ast/ast.h"
|
||||
|
||||
enum parser_state {
|
||||
PARSER_STATE_NOT_INITIALIZED = 0,
|
||||
PARSER_STATE_READY,
|
||||
PARSER_STATE_CLOSED
|
||||
};
|
||||
|
||||
/* @brief Initializes the parser module
|
||||
* @warning parser needs to be closed after use with parser_close()
|
||||
*
|
||||
* @return Returns false on error and true on success
|
||||
*/
|
||||
bool parser_init(void);
|
||||
|
||||
/* @brief Closes the parser module after use
|
||||
*/
|
||||
void parser_close(void);
|
||||
|
||||
/* @brief Builds the AST representation of the next command to execute.
|
||||
*
|
||||
* @return Returns the AST representation of the next command to execute.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue