diff options
author | koekeishiya <aasvi93@hotmail.com> | 2019-07-10 00:11:50 +0200 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2019-07-10 00:11:50 +0200 |
commit | 32f669eab3dea1908a83133e402411fa2e377ac3 (patch) | |
tree | f6ace98d121b9fac8598e6b52e266b082920671c /src/parse.h | |
parent | aae0e4f2a5d90a812343acf3d5b3f2f20f5c2dc0 (diff) | |
parent | 22071ddd738ad591f42500ad8dbe818ffd1eb93d (diff) | |
download | skhd-mt.tar.gz skhd-mt.zip |
merge mastermt
Diffstat (limited to 'src/parse.h')
-rw-r--r-- | src/parse.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/parse.h b/src/parse.h index d3543b9..6576f7a 100644 --- a/src/parse.h +++ b/src/parse.h @@ -4,25 +4,27 @@ #include "tokenize.h" #include <stdbool.h> +struct load_directive +{ + char *file; + struct token option; +}; + struct table; struct parser { + char *file; struct token previous_token; struct token current_token; struct tokenizer tokenizer; struct table *mode_map; + struct table *blacklst; + struct load_directive *load_directives; bool error; }; -enum parse_error_type -{ - Error_Unexpected_Token, - Error_Undeclared_Ident, - Error_Duplicate_Ident, -}; - - -void parse_config(struct parser *parser); +bool parse_config(struct parser *parser); +struct hotkey *parse_keypress(struct parser *parser); struct token parser_peek(struct parser *parser); struct token parser_previous(struct parser *parser); @@ -30,8 +32,9 @@ 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, struct table *mode_map, char *file); +bool parser_init(struct parser *parser, struct table *mode_map, struct table *blacklst, char *file); +bool parser_init_text(struct parser *parser, char *text); void parser_destroy(struct parser *parser); -void parser_report_error(struct parser *parser, enum parse_error_type error_type, const char *format, ...); +void parser_report_error(struct parser *parser, struct token token, const char *format, ...); #endif |