MiniDevil
As beautiful as a shell
Token allocation and management: creates & frees token nodes. More...
Include dependency graph for token.c:Token allocation and management: creates & frees token nodes.
Definition in file token.c.
Functions | |
| t_token * | create_token (t_token_type type, char *value) |
| Allocate and initialize a new token. More... | |
| void | free_token (t_token *token) |
| Free a single token and its value str. More... | |
| void | free_token_list (t_token *head) |
| Free the entire token linked list. More... | |
| void | add_token (t_token **head, t_token *new_token) |
| Add a token to the end of a linked list. More... | |
| t_token* create_token | ( | t_token_type | type, |
| char * | value | ||
| ) |
Allocate and initialize a new token.
The new token starts with quote_type = QUOTE_NONE, connected = 0 and next = NULL
| type | Token type |
| value | Text content |
Definition at line 26 of file token.c.
References t_token::connected, t_token::next, QUOTE_NONE, t_token::quote_type, t_token::type, and t_token::value.
Referenced by process_operator_token(), and process_word_token().
Here is the caller graph for this function:| void free_token | ( | t_token * | token | ) |
Free a single token and its value str.
| token | Token to free |
Definition at line 51 of file token.c.
References t_token::value.
Referenced by free_token_list().
Here is the caller graph for this function:| void free_token_list | ( | t_token * | head | ) |
Free the entire token linked list.
| head | Head of list to free |
Definition at line 64 of file token.c.
References free_token(), and t_token::next.
Referenced by process_input(), process_ui_input(), and tokenize().
Here is the call graph for this function:
Here is the caller graph for this function:Add a token to the end of a linked list.
| head | Pointer to head pointer |
| new_token | Token to add |
Definition at line 84 of file token.c.
References t_token::next.
Referenced by process_operator_token(), and process_word_token().
Here is the caller graph for this function: