diff options
Diffstat (limited to 'include/lex.h')
| -rw-r--r-- | include/lex.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/lex.h b/include/lex.h index 634be5f..bdfd32f 100644 --- a/include/lex.h +++ b/include/lex.h @@ -33,10 +33,15 @@ const char* lex_get_token_name(int id); +#define LEX_NUMBER_ERR 0 +#define LEX_HEX_ERR 1 +#define LEX_BINARY_ERR 2 + + struct token { int type; // size_t line; -// size_t pos; +// size_t linepos; size_t length; char *lexeme; }; @@ -45,12 +50,16 @@ struct lex { size_t pos; size_t size; char* buffer; + const char* filepath; size_t line; + size_t linepos; }; char lex_advance(struct lex *l, size_t o); char lex_seek(struct lex *l, size_t o); +void lex_error(struct lex *l, int err_code, const char *s, ...); + struct token lex_number(struct lex *l); struct token lex_directive(struct lex *l); struct token lex_link_unit(struct lex *l); |
