include/lexical/scanner.h
raw| 1 | #ifndef SCANNER_H |
| 2 | #define SCANNER_H |
| 3 | |
| 4 | #include "token.h" |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | struct scanner_t |
| 8 | { |
| 9 | char *token_start; |
| 10 | char *current_char; |
| 11 | uint16_t line_nr; |
| 12 | }; |
| 13 | |
| 14 | typedef struct scanner_t scanner_t; |
| 15 | typedef struct token_t token_t; |
| 16 | |
| 17 | extern void init_scanner (char *start); |
| 18 | |
| 19 | extern void scan_token (token_t *token); |
| 20 | |
| 21 | #endif |