aboutsummaryrefslogtreecommitdiff
path: root/src/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.h')
-rw-r--r--src/parser.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parser.h b/src/parser.h
index 8fc5d6c..9193ca1 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -5,6 +5,7 @@
#include "lexer.h"
typedef struct parser *parser_t;
+typedef struct ast ast_t;
struct ast {
enum ast_type {
@@ -26,7 +27,6 @@ struct ast {
};
struct parser {
- struct sexp root;
struct sexp *cur_sexp;
struct quote_node {
@@ -45,16 +45,16 @@ parser_t parser_create();
// deallocate a parser
void parser_destroy(parser_t parser);
-// reset a parser to its default state without destroying it
+// reset to its default state without destroying it
// returns 0 on success
void parser_reset(parser_t parser);
+void ast_reset(ast_t *ast_root);
// self explanatory
-void parser_print_ast(parser_t parser);
+void ast_print(ast_t *ast_root);
-// turn the given lexer (which has already has tokens) into an ast
-// returns 0 on success, > 0 when more tokens are needed,
-// and < 0 on a fatal error
-int parser_parse_lexer(parser_t parser, lexer_t lexer);
+// turn the given toklist into an ast
+// returns 0 on success, and < 0 on a fatal error
+int parser_parse_toklist(parser_t parser, toklist_t *tokens, ast_t *ast);
#endif