Utilities for reporting compilation errors.
More...
|
int | numErrors |
| The number of errors logged by emitError up to now.
|
|
Utilities for reporting compilation errors.
These functions are used to report errors during compilation. In the parser it is also possible to use yyerror() for the same purpose.
◆ t_fileLocation
Structure that represents a location in a file.
Definition at line 19 of file errors.h.
Data Fields |
char * |
file |
The name of the file. |
int |
row |
The zero-based index of a line in the file. |
◆ emitError()
Prints an error message depending on the given code. Does not terminate the program.
- Parameters
-
loc | The file location where the error originated, or ‘nullFileLocation’ if not applicable |
fmt | A printf-like format string. |
◆ fatalError()
void fatalError |
( |
const char * | fmt, |
|
|
| ... ) |
Prints the specified error message and terminates the program.
- Parameters
-
fmt | A printf-like format string. |
◆ yyerror()
void yyerror |
( |
const char * | msg | ) |
|
Report a syntax error.
- Note
- This function is also used by Bison-generated code.
- Parameters
-
◆ numErrors
The number of errors logged by emitError up to now.