diff options
| author | 2026-11-08 08:19:44 +0000 | |
|---|---|---|
| committer | 2026-11-08 08:23:19 +0000 | |
| commit | 5be0e39d0ce97849d7722bd1ac98563c7014faf3 (patch) | |
| tree | 9dba821664337a6662a6da88dfe86291d269c36b /src/bnf-lexer.h | |
| download | lab-05-master.tar.gz | |
Diffstat (limited to 'src/bnf-lexer.h')
| -rw-r--r-- | src/bnf-lexer.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bnf-lexer.h b/src/bnf-lexer.h new file mode 100644 index 0000000..5863219 --- /dev/null +++ b/src/bnf-lexer.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef INCLUDED_BNF_LEXER_H | ||
| 2 | #define INCLUDED_BNF_LEXER_H | ||
| 3 | |||
| 4 | #include <stddef.h> | ||
| 5 | #include "utils.h" | ||
| 6 | #include "bnf-lexeme.h" | ||
| 7 | |||
| 8 | struct bnf_lexer { | ||
| 9 | struct string_view sv; | ||
| 10 | const char *cursor; | ||
| 11 | const char *filename; | ||
| 12 | }; | ||
| 13 | |||
| 14 | extern struct bnf_lexer bnf_lexer_from_string_view (struct string_view, const char *filename); | ||
| 15 | extern struct bnf_lexer bnf_lexer_from_filename (const char *); | ||
| 16 | extern struct bnf_lexeme bnf_lexer_next_lexeme (struct bnf_lexer *); | ||
| 17 | |||
| 18 | #endif // INCLUDED_BNF_LEXER_H | ||
