summaryrefslogtreecommitdiff
path: root/include/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/parser.h')
-rw-r--r--include/parser.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/parser.h b/include/parser.h
index 369115b..d0dadbe 100644
--- a/include/parser.h
+++ b/include/parser.h
@@ -32,6 +32,17 @@
#include "lexer.h"
+struct parser {
+ struct lexer *lexer;
+ struct token tok;
+};
+
+static inline bool
+parser_advance(struct parser *ctx)
+{
+ return lexer_next(ctx->lexer, &ctx->tok);
+}
+
bool parser_parse(struct lexer *lexer);
#endif /* !_PARSER_H */