aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/parser.h')
-rw-r--r--src/include/parser.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/include/parser.h b/src/include/parser.h
index b101485..79e1289 100644
--- a/src/include/parser.h
+++ b/src/include/parser.h
@@ -6,15 +6,24 @@
#include "token.h"
typedef struct PARSER {
- /* the token list being parsed */
+ /* The token list being consumed. */
token_t* token;
- /* the abstract syntax tree being generated */
+ /* The AST being produced. */
tree_t* tree;
} parser_t;
+/* Creates a new parser. */
parser_t* parser_init(token_t* token);
-/* free parser struct, **but not þe token list ∨ ast** */
+
+/*
+ Destroys a parser.
+ - Does not free the token list.
+ - Does not free the AST.
+*/
void parser_destroy(parser_t* parser);
+/* Step the parser forward by 1 token. */
+void parser_nxt_token(parser_t* parser);
+
#endif