A container for CompilerError instances generated by the various components of the Bond compiler.
More...
#include <bond/compiler/compilererror.h>
A container for CompilerError instances generated by the various components of the Bond compiler.
A CompilerErrorBuffer is used by the Lexer, Parser, SemanticAnalyzer and CodeGenerator of the Bond compiler to collect the errors that they detect. The CompilerErrorBuffer provides functionality for printing formatted error messages to an OutputStream.
The size of the buffer is fixed, and no memory allocations are incurred. If the buffer overflows, any additional errors are dropped since they are not considered relevant because they are most likely the consequence of the compiler being confused by the initial set of errors that caused the buffer to fill up.
- See also
- CodeGenerator, CompilerError, Lexer, Parser, SemanticAnalyzer
◆ CompilerErrorBuffer()
Bond::CompilerErrorBuffer::CompilerErrorBuffer |
( |
| ) |
|
◆ CopyFrom()
◆ GetError()
const CompilerError & Bond::CompilerErrorBuffer::GetError |
( |
size_t |
index | ) |
const |
|
inline |
Returns the CompilerError at the specified index in the buffer.
- Parameters
-
index | The index of the error to be retrieved. |
◆ GetNumErrors()
size_t Bond::CompilerErrorBuffer::GetNumErrors |
( |
| ) |
const |
|
inline |
Returns the number of errors in the buffer.
◆ HasErrors()
bool Bond::CompilerErrorBuffer::HasErrors |
( |
| ) |
const |
|
inline |
Returns whether the buffer contains any errors.
◆ Print()
void Bond::CompilerErrorBuffer::Print |
( |
OutputStream & |
stream | ) |
const |
Prints a formatted error message for each error to the given OutputStream.
- Parameters
-
stream | The OutputStream to which the error messages are printed. |
◆ PushError()
void Bond::CompilerErrorBuffer::PushError |
( |
CompilerError::Type |
type, |
|
|
const Token * |
context = nullptr , |
|
|
const void * |
arg0 = nullptr , |
|
|
const void * |
arg1 = nullptr |
|
) |
| |
◆ PushErrorInt()
void Bond::CompilerErrorBuffer::PushErrorInt |
( |
CompilerError::Type |
type, |
|
|
const Token * |
context = nullptr , |
|
|
intptr_t |
arg0 = 0 , |
|
|
intptr_t |
arg1 = 0 |
|
) |
| |
◆ Reset()
void Bond::CompilerErrorBuffer::Reset |
( |
| ) |
|
Clears the contents of the error buffer.
The documentation for this class was generated from the following file:
- include/bond/compiler/compilererror.h