aboutsummaryrefslogtreecommitdiff
path: root/src/parse.h
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2017-08-07 20:23:44 +0200
committerkoekeishiya <aasvi93@hotmail.com>2017-08-07 20:23:44 +0200
commitd69056799a399058005b4950751397a31110de4a (patch)
tree1dee43a2f247094c58d1263cee8c8477b893e376 /src/parse.h
downloadskhd-d69056799a399058005b4950751397a31110de4a.tar.gz
skhd-d69056799a399058005b4950751397a31110de4a.zip
v0.0.1
Diffstat (limited to 'src/parse.h')
-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