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
75void
76module_add_error(module_t* module, unsigned int line, unsigned int column, unsigned int length, const char* message);
77
83void
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:92
token_t * module_add_token(module_t *module)
Add a new token to module.
Definition module.c:44
error_code_t module_init(module_t *module, const char *filepath)
Initialize a module struct.
Definition module.c:17
void module_print_errors(module_t *module)
Print all errors on the module.
Definition module.c:112
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:63
void module_close(module_t *module)
Close the given module.
Definition module.c:71
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:55
Struct that represents a Mya module.
Definition module.h:34
struct module module_t
Struct that represents a Mya module.
struct token token_t
Struct for a Mya token.