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.
ast_node_t * aststack_insert(aststack_t *stack, ast_node_t *source)
Push a new value on the stack copying from source pointer.
void aststack_close(aststack_t *stack)
Closes the given stack.
void _stack_ensure_size(aststack_t *stack)
void aststack_init(aststack_t *stack)
Initializes the given stack.
bool aststack_isempty(aststack_t *stack)
Check if the given stack is empty.
error_code_t aststack_pop(aststack_t *stack, ast_node_t *value)
Pop a value from the stack.
ast_node_t * aststack_push(aststack_t *stack, node_type_t type, token_t *token)
Push a new value on the stack.
enum error_code error_code_t
Enumeration of error codes.
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 ASTSTACK_LENGTH_INCREMENT
#define ASTSTACK_INITIAL_LENGTH
struct stack aststack_t
A struct representing a dynamic stack.
struct token token_t
Struct for a Mya token.