aboutsummaryrefslogtreecommitdiff
path: root/src/parse.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/parse.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/parse.h b/src/parse.h
new file mode 100644
index 0000000..f0ea0f7
--- /dev/null
+++ b/src/parse.h
@@ -0,0 +1,26 @@
+#ifndef SKHD_PARSE_H
+#define SKHD_PARSE_H
+
+#include "tokenize.h"
+#include <stdbool.h>
+
+struct parser
+{
+ struct token previous_token;
+ struct token current_token;
+ struct tokenizer tokenizer;
+ bool error;
+};
+
+struct hotkey *parse_config(struct parser *parser);
+
+struct token parser_peek(struct parser *parser);
+struct token parser_previous(struct parser *parser);
+bool parser_eof(struct parser *parser);
+struct token parser_advance(struct parser *parser);
+bool parser_check(struct parser *parser, enum token_type type);
+bool parser_match(struct parser *parser, enum token_type type);
+bool parser_init(struct parser *parser, char *file);
+void parser_destroy(struct parser *parser);
+
+#endif