#include "evaluator.h"
#include "hashtable.h"
#include "mir.h"
#include "module.h"
#include "types/keywords.h"
Go to the source code of this file.
◆ eval_set()
Evaluates a set statement.
- Parameters
-
mir | The MIR struct where to add the intermediate represetation. |
module | Mya module where the statement is in. |
ast | The AST node where start the statement. |
Definition at line 8 of file eval_set.c.
9{
16 "Unexpected token where is expected a set statement."
17 );
18
19 return;
20 }
21
24
27}
int64_t eval_expression(hashtable_t *variables, module_t *module, ast_node_t *ast)
Evaluates a mathetical expression.
void hashtable_set(hashtable_t *hashtable, const char *key, int64_t value)
Set the value of the specified key inside the hashtable.
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).
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