libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
stack.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdbool.h>
4
5#include "types/err.h"
6#include "types/stack.h"
7
13void
15
21void
23
35
46
58
67bool
enum error_code error_code_t
Enumeration of error codes.
void stack_init(stack_t *stack)
Initializes the given stack.
Definition stack.c:11
ast_node_t * stack_push(stack_t *stack, node_type_t type, token_t *token)
Push a new value on the stack.
Definition stack.c:27
void stack_close(stack_t *stack)
Closes the given stack.
Definition stack.c:20
error_code_t stack_pop(stack_t *stack, ast_node_t *value)
Pop a value from the stack.
Definition stack.c:47
bool stack_isempty(stack_t *stack)
Check if the given stack is empty.
Definition stack.c:59
ast_node_t * stack_insert(stack_t *stack, ast_node_t *source)
Push a new value on the stack copying from source pointer.
Definition stack.c:37
A struct representing a dynamic stack.
Definition stack.h:12
Struct for a Mya token.
Definition token.h:32
enum node_type node_type_t
struct ast_node ast_node_t
struct stack stack_t
A struct representing a dynamic stack.
struct token token_t
Struct for a Mya token.