void ast_node_init(ast_node_t *node, ast_node_t *parent, node_type_t type, token_t *token)
Initializes an AST node.
void ast_copy(ast_node_t *destiny, ast_node_t *source)
Copies the content of source to destinty AST nodes.
enum error_code error_code_t
Enumeration of error codes.
void stack_init(stack_t *stack)
Initializes the given stack.
ast_node_t * stack_push(stack_t *stack, node_type_t type, token_t *token)
Push a new value on the stack.
void stack_close(stack_t *stack)
Closes the given stack.
error_code_t stack_pop(stack_t *stack, ast_node_t *value)
Pop a value from the stack.
bool stack_isempty(stack_t *stack)
Check if the given stack is empty.
ast_node_t * stack_insert(stack_t *stack, ast_node_t *source)
Push a new value on the stack copying from source pointer.
void _stack_ensure_size(stack_t *stack)
A struct representing a dynamic stack.
unsigned int length
Number of elements on the stack.
ast_node_t * values
Array of values on the stack.
unsigned int _size
Current number of elements that fits on the stack.
enum node_type node_type_t
struct ast_node ast_node_t
#define STACK_INITIAL_LENGTH
#define STACK_LENGTH_INCREMENT
struct stack stack_t
A struct representing a dynamic stack.
struct token token_t
Struct for a Mya token.