![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <Lexer.hpp>
Public Member Functions | |
Lexer (Diagnostic &diag, ThreadSafeStringPool &pool, const char *filename, std::istream &in) | |
void | initialize_keywords () |
Initializes the set of all keywords. | |
Token | next () |
Obtains the next token from the input stream. | |
Data Fields | |
Diagnostic & | diag |
ThreadSafeStringPool & | pool |
const char * | filename |
std::istream & | in |
Private Types | |
using | Keywords_t = std::unordered_map< ThreadSafePooledString, TokenType > |
using | buf_t = std::vector< char > |
Private Member Functions | |
int | step () |
Reads the next character from in to c_ , and updates pos_ accordingly. | |
void | push () |
bool | accept (const int c) |
ThreadSafePooledString | internalize () |
Token | read_keyword_or_identifier () |
Token | read_number () |
Token | read_string_literal () |
Token | read_date_or_datetime () |
Token | read_instruction () |
Private Attributes | |
Keywords_t | keywords_ |
int | c_ |
Position | pos_ |
Position | start_ |
buf_t | buf_ |
|
private |
|
private |
|
inlineexplicit |
|
inlineprivate |
Definition at line 73 of file Lexer.hpp.
Referenced by read_date_or_datetime().
void Lexer::initialize_keywords | ( | ) |
|
inlineprivate |
Definition at line 81 of file Lexer.hpp.
Referenced by next(), read_date_or_datetime(), read_instruction(), read_keyword_or_identifier(), read_number(), and read_string_literal().
Token Lexer::next | ( | ) |
Obtains the next token from the input stream.
Definition at line 20 of file Lexer.cpp.
References m::and, buf_, c_, diag, m::Diagnostic::e(), GUESS, internalize(), m::is_alpha(), LEX, pool, pos_, push(), read_date_or_datetime(), read_instruction(), read_keyword_or_identifier(), read_number(), read_string_literal(), start_, step(), and UNDO.
Referenced by m::ast::Parser::consume(), and main().
|
inlineprivate |
Definition at line 68 of file Lexer.hpp.
Referenced by next(), read_date_or_datetime(), read_instruction(), read_keyword_or_identifier(), read_number(), and read_string_literal().
|
private |
|
private |
|
private |
Definition at line 116 of file Lexer.cpp.
References c_, internalize(), m::is_alnum(), keywords_, push(), and start_.
Referenced by next().
|
private |
Definition at line 126 of file Lexer.cpp.
References c_, diag, m::Diagnostic::e(), internalize(), m::is_dec(), m::is_hex(), m::is_oct(), M_insist, push(), and start_.
Referenced by next().
|
private |
Definition at line 188 of file Lexer.cpp.
References m::and, c_, diag, m::Diagnostic::e(), internalize(), push(), and start_.
Referenced by next().
|
inlineprivate |
Reads the next character from in
to c_
, and updates pos_
accordingly.
Definition at line 54 of file Lexer.hpp.
References m::Position::column, and m::Position::line.
Referenced by next().
|
private |
Definition at line 28 of file Lexer.hpp.
Referenced by next(), read_date_or_datetime(), read_instruction(), read_keyword_or_identifier(), read_number(), and read_string_literal().
Diagnostic& m::ast::Lexer::diag |
Definition at line 19 of file Lexer.hpp.
Referenced by next(), read_date_or_datetime(), read_number(), and read_string_literal().
|
private |
Definition at line 27 of file Lexer.hpp.
Referenced by read_keyword_or_identifier().
ThreadSafeStringPool& m::ast::Lexer::pool |
|
private |
Definition at line 29 of file Lexer.hpp.
Referenced by next(), read_date_or_datetime(), read_instruction(), read_keyword_or_identifier(), read_number(), and read_string_literal().