aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser.h
diff options
context:
space:
mode:
authors-over-42023-08-29 10:17:27 -0400
committers-over-42023-08-29 10:17:27 -0400
commit4176dea8503cc8eebfa24b14aaefc3a8dc643230 (patch)
treed2fd320fa4c83fcd397995ff009ae565b6a5e933 /src/include/parser.h
parent497a3b690c3828775ad1d141f53484a748d5b61a (diff)
g
Diffstat (limited to 'src/include/parser.h')
-rw-r--r--src/include/parser.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/parser.h b/src/include/parser.h
index 0ba2038..deb6c7c 100644
--- a/src/include/parser.h
+++ b/src/include/parser.h
@@ -4,6 +4,8 @@
#include "lexer.h"
#include "tree.h"
+#include <stdarg.h>
+
typedef struct PARSER_STRUC {
lexer_t* lexer; // lexer used by the parser
token_t* token; // current token
@@ -12,9 +14,8 @@ typedef struct PARSER_STRUC {
parser_t* parser_init(lexer_t* lexer);
void parser_destroy(parser_t* parser);
-// expect token, or die
-void parser_token_expect(parser_t* parser, int token);
-void parser_token_expectf(parser_t* parser, int (*expected_token)(token_t*));
+// expect token(s), or die
+void parser_token_expect(parser_t* parser, int token, ...);
// do the parse
tree_t* parser_parse(parser_t* parser);