|
Nearly CC
An educational compiler skeleton
|
Exception type for lexical or syntax errors. More...
#include "exceptions.h"


Public Member Functions | |
| SyntaxError (const Location &loc, const std::string &desc) | |
| Constructor. More... | |
| SyntaxError (const SyntaxError &other) | |
| Copy constructor. More... | |
| bool | has_location () const |
| Check whether this exception has a valud source Location. More... | |
| const Location & | get_loc () const |
| Get the source Location. More... | |
Static Public Member Functions | |
| static void | raise (const Location &loc, const char *fmt,...) EX_PRINTF_FORMAT |
| Throw a SyntaxError exception. More... | |
Exception type for lexical or syntax errors.
| SyntaxError::SyntaxError | ( | const Location & | loc, |
| const std::string & | desc | ||
| ) |
Constructor.
| loc | the source Location |
| desc | description of the error |
| SyntaxError::SyntaxError | ( | const SyntaxError & | other | ) |
Copy constructor.
| other | the SyntaxError object to copy from |
|
inherited |
|
inlineinherited |
|
static |
Throw a SyntaxError exception.
The description is generated from printf-style formatting.
| fmt | the format string |
| ... | argument values (corresponding to conversions in the format string) |