diff options
| author | 2026-11-08 06:02:38 +0000 | |
|---|---|---|
| committer | 2026-11-08 06:26:07 +0000 | |
| commit | 6ecea40c849effd171c1d27c961f5c1ee100481f (patch) | |
| tree | 99a92dafddf7d2ef0e318d927ae70c3b642e4171 /src/bnf-lexer.h | |
| download | lab-03-6ecea40c849effd171c1d27c961f5c1ee100481f.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 | ||
