diff options
Diffstat (limited to 'lexer.h')
| -rw-r--r-- | lexer.h | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#pragma once + +#include <stdbool.h> +#include <stdio.h> + +// single characters stand for themselves +// so the named tokens start past them +enum Token +{ + TOK_END = 0, + TOK_COLONCOLON = 256, + TOK_EMIT, + TOK_COMMIT, + TOK_DECLTYPE, + TOK_DIFFERENCE, + TOK_CHAR +}; + +// provided by flex +// the input +// the current line +// and the scanner itself +extern FILE* yyin; +extern int yylineno; +int yylex(void); + +// true once the lexer has refused something +bool lexer_failed(void); +// the character inside the most recent TOK_CHAR +char lexer_character(void); |
