Lhogho
0.0.028
|
Go to the source code of this file.
Macros | |
#define | FORMAT_ERR_CODE TEXT("{ERR#%d") |
#define | FORMAT_ERR_POS TEXT("@%d}") |
Functions | |
void | init_errors () |
initializes errors More... | |
void | finit_errors () |
finalizes errors More... | |
atom_t | new_error (uint_t code, atom_t data) |
creates a new error atom More... | |
atom_t | new_os_error (chars_t filename) |
creates error atom for OS error More... | |
atom_t | new_os_error_atom (atom_t filename) |
atom_t | new_parse_error (uint_t code, int position, atom_t source) |
creates error atom for parser's error More... | |
void | add_error_source (atom_t error, atom_t source) |
adds new error position to an error More... | |
int | get_error_position (atom_t data, chars_t *source) |
gets error position More... | |
void | delete_error (atom_t a) |
deletes error atom More... | |
void | dump_error (atom_t a, int level) |
dumps error atom More... | |
void | clear_all_errors () |
clears all errors More... | |
Variables | |
atom_t | error_texts [] |
Texts for error messages. More... | |
int | last_os_error |
records last OS error code More... | |
Error fields | |
These macros are used to access errors. Error code is in | |
#define | ERRCODE(x) ((x)->unode.s[3]) |
#define | ERRPOS(x) ((x)->unode.a[2]) |
#define | ERRDATA(x) ((x)->unode.a[3]) |
#define | IS_ERROR(x) (ID(x)==ERROR_ID) |
void init_errors | ( | ) |
filename | file name associated with the error |
Creates error atom describing OS error.
code | error code |
position | character position within the source |
source | (sub)word containing the source |
Creates error atom describing an error generated by the parser.
error | error to which new position will be added |
source | error source |
Adds a new error position to an already existing error atom. The error position is simply an atom which may have been extracted from the actual source. The new error position is inserted in the first place of the list of error positions.
Definition at line 268 of file errors.c.
data | data to search for |
source | source where the data is found |
Tries to identify the position of the first (sub)word in the data in the original source. This function returns the character position and the source. If the source cannot be identified, then return -1 and set source
to NULL.
Definition at line 314 of file errors.c.
a | atom to delete |
Deletes error atom by returning it back to the data pool. The source atom is dereferenced.
void clear_all_errors | ( | ) |
Clears all errors recorder in all_errors except for the one stored in last_error
Definition at line 503 of file errors.c.