![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <Diagnostic.hpp>
Public Member Functions | |
Diagnostic (const bool color, std::ostream &out, std::ostream &err) | |
std::ostream & | operator() (const Position pos) |
std::ostream & | n (const Position pos) |
std::ostream & | w (const Position pos) |
std::ostream & | e (const Position pos) |
unsigned | num_errors () const |
Returns the number of errors emitted since the last call to clear() . | |
void | clear () |
Resets the error counter. | |
std::ostream & | out () const |
std::ostream & | err () |
Static Public Attributes | |
static constexpr const char * | RESET = "\033[0m" |
static constexpr const char * | BOLD = "\033[1;37m" |
static constexpr const char * | ITALIC = "\033[3;37m" |
static constexpr const char * | NOTE = "\033[1;2;37m" |
static constexpr const char * | WARNING = "\033[1;35m" |
static constexpr const char * | ERROR = "\033[1;31m" |
Private Types | |
enum | Kind { K_None , K_Note , K_Warning , K_Error } |
Private Member Functions | |
void | print_pos (std::ostream &out, const Position pos, const Kind kind) |
Private Attributes | |
const bool | color_ |
std::ostream & | out_ |
std::ostream & | err_ |
unsigned | num_errors_ = 0 |
Definition at line 11 of file Diagnostic.hpp.
|
private |
Enumerator | |
---|---|
K_None | |
K_Note | |
K_Warning | |
K_Error |
Definition at line 65 of file Diagnostic.hpp.
|
inline |
Definition at line 20 of file Diagnostic.hpp.
|
inline |
Resets the error counter.
Definition at line 50 of file Diagnostic.hpp.
References num_errors_.
Referenced by m::execute_file(), m::execute_instruction(), m::execute_statement(), m::load_from_CSV(), main(), and m::process_stream().
|
inline |
Definition at line 41 of file Diagnostic.hpp.
References err_, K_Error, num_errors_, and print_pos().
Referenced by m::execute_instruction(), m::execute_statement(), m::ast::Parser::expect(), m::ast::Parser::expect_integer(), m::load_from_CSV(), m::ast::Lexer::next(), m::DSVReader::operator()(), m::ast::Parser::parse_CreateIndexStmt(), m::ast::Parser::parse_data_type(), m::ast::Parser::parse_Expr(), m::ast::Parser::parse_ImportStmt(), m::ast::Parser::parse_LimitClause(), m::ast::Parser::parse_Stmt(), m::ast::Lexer::read_date_or_datetime(), m::ast::Lexer::read_number(), and m::ast::Lexer::read_string_literal().
|
inline |
Definition at line 53 of file Diagnostic.hpp.
References err_, ERROR, num_errors_, and RESET.
Referenced by m::learn_spns::execute(), m::ImportDSV::execute(), m::CreateDatabase::execute(), m::DropDatabase::execute(), m::UseDatabase::execute(), m::CreateTable::execute(), m::DropTable::execute(), m::CreateIndex::execute(), m::DropIndex::execute(), m::execute_statement(), m::load_from_CSV(), main(), and m::DotTool::show().
|
inline |
Definition at line 31 of file Diagnostic.hpp.
References K_Note, out_, and print_pos().
|
inline |
Returns the number of errors emitted since the last call to clear()
.
Definition at line 48 of file Diagnostic.hpp.
References num_errors_.
Referenced by m::command_from_string(), m::execute_file(), m::instruction_from_string(), m::load_from_CSV(), main(), and m::statement_from_string().
|
inline |
Definition at line 26 of file Diagnostic.hpp.
References K_None, out_, and print_pos().
|
inline |
Definition at line 52 of file Diagnostic.hpp.
References out_.
Referenced by m::learn_spns::execute(), m::QueryDatabase::execute(), m::CreateDatabase::execute(), m::DropDatabase::execute(), m::UseDatabase::execute(), m::CreateTable::execute(), m::DropTable::execute(), m::CreateIndex::execute(), m::DropIndex::execute(), print_pos(), and m::DotTool::show().
|
inlineprivate |
Definition at line 72 of file Diagnostic.hpp.
References BOLD, color_, m::Position::column, ERROR, K_Error, K_None, K_Note, K_Warning, m::Position::line, m::Position::name, NOTE, out(), RESET, and WARNING.
Referenced by e(), n(), operator()(), and w().
|
inline |
Definition at line 36 of file Diagnostic.hpp.
References err_, K_Warning, and print_pos().
Referenced by m::InjectionCardinalityEstimator::InjectionCardinalityEstimator(), m::DSVReader::operator()(), and m::InjectionCardinalityEstimator::read_json().
|
staticconstexpr |
Definition at line 14 of file Diagnostic.hpp.
Referenced by print_pos().
|
private |
Definition at line 60 of file Diagnostic.hpp.
Referenced by print_pos().
|
private |
Definition at line 62 of file Diagnostic.hpp.
|
staticconstexpr |
Definition at line 18 of file Diagnostic.hpp.
Referenced by err(), and print_pos().
|
staticconstexpr |
Definition at line 15 of file Diagnostic.hpp.
|
staticconstexpr |
Definition at line 16 of file Diagnostic.hpp.
Referenced by print_pos(), and m::DotTool::show().
|
private |
Definition at line 63 of file Diagnostic.hpp.
Referenced by clear(), e(), err(), and num_errors().
|
private |
Definition at line 61 of file Diagnostic.hpp.
Referenced by n(), operator()(), and out().
|
staticconstexpr |
Definition at line 13 of file Diagnostic.hpp.
Referenced by err(), print_pos(), and m::DotTool::show().
|
staticconstexpr |
Definition at line 17 of file Diagnostic.hpp.
Referenced by print_pos().