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.
token_t * tkstack_peek(tkstack_t *stack)
Peeks the value on top of the stack without removing it.
void _tkstack_ensure_size(tkstack_t *stack)
bool tkstack_isempty(tkstack_t *stack)
Check if the given stack is empty.
token_t * tkstack_pop(tkstack_t *stack)
Pop a value from the stack.
void tkstack_close(tkstack_t *stack)
Closes the given stack.
void tkstack_init(tkstack_t *stack)
Initializes the given stack.
void tkstack_push(tkstack_t *stack, token_t *token)
Push a new value on the stack.
#define TKSTACK_LENGTH_INCREMENT
#define TKSTACK_INITIAL_LENGTH
struct tkstack tkstack_t
A struct representing a dynamic stack of token_t pointers.
struct token token_t
Struct for a Mya token.