diff options
Diffstat (limited to 'include/lexer.h')
-rw-r--r-- | include/lexer.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/lexer.h b/include/lexer.h new file mode 100644 index 0000000..99431ec --- /dev/null +++ b/include/lexer.h @@ -0,0 +1,22 @@ +/* + * Quark lexer (lexical analyzer). + * Turns source code into tokens. + * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team. + * Provided under the BSD 3-Clause license. + */ + +#ifndef _LEXER_H +#define _LEXER_H + +#include "lexer/token.h" + +struct lexer { + char *pos; + char *line_start; + int line; +}; + +void lexer_next(struct lexer *ctx, struct token *tok); +void lexer_init(struct lexer *ctx, char *source); + +#endif /* !_LEXER_H */ |