diff options
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 |