Stores error and warning messages
Public Member Functions | |
| ErrorStore () | |
| ~ErrorStore () | |
| void | setPrintToStderr (bool p) |
| void | addError (ASTNode *context, const char *messagefmt,...) |
| void | addError (const char *location, const char *messagefmt,...) |
| void | addWarning (ASTNode *context, const char *messagefmt,...) |
| void | addWarning (const char *location, const char *messagefmt,...) |
| void | add (ASTNode *context, int severity, const char *messagefmt,...) |
| void | add (const char *location, int severity, const char *messagefmt,...) |
| bool | empty () const |
| int | numMessages () const |
| bool | containsError () const |
| void | clear () |
Returns properties of the ith message stored (i=0..numMessages-1) | |
| const char * | errorSeverity (int i) const |
| int | errorSeverityCode (int i) const |
| const char * | errorLocation (int i) const |
| ASTNode * | errorContext (int i) const |
| const char * | errorText (int i) const |
| int | findFirstErrorFor (ASTNode *node, int startIndex) const |
| static const char * | severityName (int severity) |
|
inline |
Ctor
|
inline |
|
inline |
If set, errors get dumped to stderr as well as stored
| void addError | ( | ASTNode * | context, |
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message with the severity ERROR.
| void addError | ( | const char * | location, |
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message with the severity ERROR.
| void addWarning | ( | ASTNode * | context, |
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message with the severity WARNING.
| void addWarning | ( | const char * | location, |
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message with the severity WARNING.
| void add | ( | ASTNode * | context, |
| int | severity, | ||
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message.
| void add | ( | const char * | location, |
| int | severity, | ||
| const char * | messagefmt, | ||
| ... | |||
| ) |
Add an error message.
|
inline |
Return true if there are no messages stored.
|
inline |
Total number of error, warning and info messages.
| bool containsError | ( | ) | const |
Returns true if there is an error or fatal error stored.
|
inline |
Discard all messages stored.
| const char* errorSeverity | ( | int | i | ) | const |
| int errorSeverityCode | ( | int | i | ) | const |
| const char* errorLocation | ( | int | i | ) | const |
| ASTNode* errorContext | ( | int | i | ) | const |
| const char* errorText | ( | int | i | ) | const |
| int findFirstErrorFor | ( | ASTNode * | node, |
| int | startIndex | ||
| ) | const |
Return the first message with index >= startIndex whose context is the given node. Returns -1 if none found.
|
static |
Convert severities from numeric to textual form.