NewLang Project
Yet another programm language
|
#include <diag.h>
Classes | |
struct | DataDiag |
Public Types | |
enum class | State : uint8_t { DEFINE_ENUM , none , flag , option , ignored , warning , error } |
typedef std::vector< DataDiag > | DiagListType |
typedef std::vector< DiagListType > | DiagStackType |
Public Member Functions | |
void | Push (const TermPtr term=nullptr) |
void | Pop (const TermPtr term=nullptr) |
bool | Apply (const char *name, State state, const TermPtr term=nullptr) |
Diag::State | Test (const char *name) |
bool | TestIgnore (const char *name) |
bool | Emit (const char *name, const TermPtr term=nullptr) |
bool | Register (const char *name, State state, const char *desc=nullptr) |
virtual | ~Diag () |
Diag () | |
bool | ParseArgs (int argc, const char **argv) |
Diag (const Diag &)=delete | |
const Diag & | operator= (const Diag &)=delete |
Static Public Member Functions | |
static const char * | toString (State state) |
static bool | IsClang (const std::string name) |
static bool | IsTurnError (const std::string name) |
static bool | IsTurnNoError (const std::string name) |
static bool | IsDisable (const std::string name) |
static bool | IsEnable (const std::string name) |
static std::string | RemoveDiagPrefix (const std::string name) |
static std::string | ChangeState (const std::string name, State from_state, State to_state) |
static DiagPtr | Init (int argc=0, const char **argv=nullptr) |
Public Attributes | |
DiagStackType | m_diag_stack |
int | m_error_limit |
int | m_error_count |
bool | m_fill_remainder |
Static Public Attributes | |
static const char * | DIAG_MACRO_NOT_FOUND = "-Wmacro-not-found" |
static const char * | DIAG_MACRO_STORAGE_NOT_EXIST = "-Wmacro-storage-not-exist" |
static const char * | DIAG_ERROR_LIMIT = "-ferror-limit=" |
static const char * | DIAG_EXTRA_TOKENS = "-Wextra-tokens" |
static const char * | DIAG_FILL_REMAINDER = "-Wfill-remainder" |
typedef std::vector<DataDiag> newlang::Diag::DiagListType |
typedef std::vector<DiagListType> newlang::Diag::DiagStackType |
|
strong |
Diag::Diag | ( | ) |
Definition at line 11 of file diag.cpp.
References DIAG_ERROR_LIMIT, DIAG_EXTRA_TOKENS, DIAG_FILL_REMAINDER, DIAG_MACRO_NOT_FOUND, DIAG_MACRO_STORAGE_NOT_EXIST, error, flag, ignored, m_diag_stack, m_error_count, m_error_limit, m_fill_remainder, option, Register(), VERIFY, and warning.
|
delete |
|
inlinestatic |
Definition at line 50 of file diag.h.
References DEFINE_CASE, and DIAG_STATE.
Referenced by newlang::Parser::PragmaEval().
|
inlinestatic |
Definition at line 80 of file diag.h.
Referenced by RemoveDiagPrefix().
|
inlinestatic |
Definition at line 84 of file diag.h.
Referenced by IsEnable(), and RemoveDiagPrefix().
|
inlinestatic |
Definition at line 88 of file diag.h.
Referenced by IsEnable(), and RemoveDiagPrefix().
|
inlinestatic |
Definition at line 92 of file diag.h.
Referenced by IsEnable(), and RemoveDiagPrefix().
|
inlinestatic |
Definition at line 96 of file diag.h.
References IsDisable(), IsTurnError(), and IsTurnNoError().
Referenced by RemoveDiagPrefix().
|
inlinestatic |
Definition at line 100 of file diag.h.
References ASSERT, IsClang(), IsDisable(), IsEnable(), IsTurnError(), IsTurnNoError(), and result.
Referenced by ChangeState().
|
inlinestatic |
Definition at line 127 of file diag.h.
References LOG_RUNTIME.
void Diag::Push | ( | const TermPtr | term = nullptr | ) |
Definition at line 133 of file diag.cpp.
References ASSERT, and m_diag_stack.
void Diag::Pop | ( | const TermPtr | term = nullptr | ) |
Definition at line 138 of file diag.cpp.
References LOG_RUNTIME, m_diag_stack, and NL_PARSER.
Definition at line 149 of file diag.cpp.
References LOG_RUNTIME, and NL_PARSER.
Diag::State Diag::Test | ( | const char * | name | ) |
Definition at line 158 of file diag.cpp.
References ASSERT, m_diag_stack, and none.
Referenced by Emit(), Register(), and TestIgnore().
bool Diag::TestIgnore | ( | const char * | name | ) |
bool Diag::Emit | ( | const char * | name, |
const TermPtr | term = nullptr ) |
Definition at line 175 of file diag.cpp.
References error, ignored, LOG_LEVEL_WARNING, LOG_RUNTIME, LOG_WARNING, NL_MESSAGE, NL_PARSER, none, Test(), and warning.
bool Diag::Register | ( | const char * | name, |
State | state, | ||
const char * | desc = nullptr ) |
|
inline |
|
inlinestatic |
Definition at line 74 of file diag.h.
Referenced by Diag(), and newlang::ProcessMacro().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
DiagStackType newlang::Diag::m_diag_stack |
int newlang::Diag::m_error_limit |
Definition at line 195 of file diag.h.
Referenced by newlang::AstAnalysis::CheckError(), and Diag().
int newlang::Diag::m_error_count |
Definition at line 196 of file diag.h.
Referenced by newlang::AstAnalysis::Analyze(), newlang::AstAnalysis::CheckError(), and Diag().