15 "Unexpected token where is expected a register statement."
26 if (size < 0 || size > 4096) {
32 "Register size should be between 0 and 4096."
void eval_bitfield_spec(mir_bitfield_spec_t *spec, module_t *module, ast_node_t *ast, hashtable_t *variables)
Evaluates a bitfield specification expression.
int64_t eval_expression(hashtable_t *variables, module_t *module, ast_node_t *ast)
Evaluates a mathetical expression.
void eval_register(mir_t *mir, module_t *module, ast_node_t *ast)
Evaluates a register statement.
mir_register_t * mir_add_register(mir_t *mir, const char *name, uint32_t size)
Add a new register declaration for the specified MIR.
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.
struct ast_node * children
unsigned int length
The length of the string.
char * data
Pointer for the raw string content (a normal C string).
mir_bitfield_spec_t spec
Register's bitfield specification.
Mya in-memory intermediate representation.
hashtable_t variables
Hashtable of variables.
Struct that represents a Mya module.
long long int value
Integer value of the token.
dstring_t lexeme
Lexeme of the token.
unsigned int line
Token line inside the module.
unsigned int column
Column of the token position on the line.
struct ast_node ast_node_t
struct mir_register mir_register_t
Register declaration.
struct mir mir_t
Mya in-memory intermediate representation.
struct module module_t
Struct that represents a Mya module.