libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
module.h
Go to the documentation of this file.
1#pragma once
2
3#include "types/err.h"
4#include "types/module.h"
5
18module_init(module_t* module, const char* filepath);
19
29
40module_getc(module_t* module, int* chret);
41
55module_lookup(module_t* module, int* chret, unsigned int seek);
56
62void
64
75
86void
87module_add_error(module_t* module, unsigned int line, unsigned int column, unsigned int length, const char* message);
88
89
97unsigned int
99
105void
enum error_code error_code_t
Enumeration of error codes.
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.
Definition module.c:119
token_t * module_add_token(module_t *module)
Add a new token to module.
Definition module.c:49
error_code_t module_init(module_t *module, const char *filepath)
Initialize a module struct.
Definition module.c:18
void module_print_errors(module_t *module)
Print all errors on the module.
Definition module.c:139
module_t * module_add_submodule(module_t *module)
Add submodule for the given module.
Definition module.c:108
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.
Definition module.c:68
void module_close(module_t *module)
Close the given module.
Definition module.c:76
error_code_t module_getc(module_t *module, int *chret)
Get next character on module's file, removing it from the queue.
Definition module.c:60
unsigned int module_count_errors(module_t *module)
Returns the total number of errors on the given module and submodules.
Definition module.c:156
Struct that represents a Mya module.
Definition module.h:36
struct module module_t
Struct that represents a Mya module.
struct token token_t
Struct for a Mya token.