libmya 0.1.0
Library to parse Mya language.
|
Go to the source code of this file.
Functions | |
error_code_t | module_init (module_t *module, const char *filepath) |
Initialize a module struct. | |
token_t * | module_add_token (module_t *module) |
Add a new token to module. | |
error_code_t | module_getc (module_t *module, int *chret) |
Get next character on module's file, removing it from the queue. | |
error_code_t | module_lookup (module_t *module, int *chret, unsigned int seek) |
Get a character on module's file, without removing it from the queue. | |
void | module_close (module_t *module) |
Close the given module. | |
void | module_add_error (module_t *module, unsigned int line, unsigned int column, unsigned int length, const char *message) |
Add error for the given module. | |
void | module_print_errors (module_t *module) |
Print all errors on the module. | |
void module_add_error | ( | module_t * | module, |
unsigned int | line, | ||
unsigned int | column, | ||
unsigned int | length, | ||
const char * | message ) |
Add error for the given module.
module | The module where to add the error. |
line | The module's line where the error is. |
column | The line's column where the error starts. |
length | The length of the part where has an error in the line. It's starts on column and ends on column + length . |
message | The error message. |
Definition at line 92 of file module.c.
Add a new token to module.
module | The module where the token will be added. |
Definition at line 44 of file module.c.
void module_close | ( | module_t * | module | ) |
Close the given module.
module | The module to be closed. |
Definition at line 71 of file module.c.
error_code_t module_getc | ( | module_t * | module, |
int * | chret ) |
Get next character on module's file, removing it from the queue.
module | The module to get the character. |
chret | Pointer where the character will be saved. |
Definition at line 55 of file module.c.
error_code_t module_init | ( | module_t * | module, |
const char * | filepath ) |
Initialize a module struct.
Open the filepath
and initializes the tokens
list.
module | The module to be initialized. |
filepath | The filepath for the module file. |
Definition at line 17 of file module.c.
error_code_t module_lookup | ( | module_t * | module, |
int * | chret, | ||
unsigned int | seek ) |
Get a character on module's file, without removing it from the queue.
module | The module to get the character. |
chret | Pointer where the character will be saved. |
seek | The index of the character to get (0 means the current, 1 the next and so one). Should not be >= MODULE_MIN_QUEUE_LENGTH to avoid possible errors. |
seek
is invalid. Definition at line 63 of file module.c.
void module_print_errors | ( | module_t * | module | ) |
Print all errors on the module.
module | The module to print all errors. |
Definition at line 112 of file module.c.