A class to read tokens from a source file.
Definition lexer.hpp:36
ifstream source
Definition lexer.hpp:66
string line_buff
Definition lexer.hpp:68
bool is_import_line()
Check if the current line is an import line.
Definition lexer.cpp:214
Lexer(const char *filename)
Construct a new Lexer object.
Definition lexer.cpp:12
Token next_token()
Get the next token from the source file.
Definition lexer.cpp:43
Type get_type(const string &identifier)
Return the type of a given identifier.
Definition lexer.cpp:228
size_t column
Definition lexer.hpp:69
char skip_blanks()
Skip blanks in the line buffer.
Definition lexer.cpp:192
~Lexer()
Destroy the Lexer object.
Definition lexer.cpp:39
string filename
Definition lexer.hpp:67
size_t line
Definition lexer.hpp:69
char pop_char()
Pop the first character from the line buffer.
Definition lexer.cpp:202
static locale loc
Definition lexer.hpp:65
const array< string, 11 > KEYWORDS
The keywords in the language.
Definition lexer.hpp:14
Type
Token types.
Definition token.hpp:12