s502 assembler
A very simple assembler for the 6502 line of processors written in C
tokenslist.h
Go to the documentation of this file.
1 #ifndef GUARD_TOKENSLIST
2 #define GUARD_TOKENSLIST
3 
4 #include "token_t.h"
5 
16 typedef struct TokensListElement {
24 
29 typedef struct {
34 } TokensList;
35 
42 
48 int tokenslist_add(TokensList* list, Token t);
49 
58 
65 void tokenslist_insert(TokensList* list, TokensListElement* target, TokensList* src);
66 
73 void tokenslist_free(TokensList* list);
74 
82 
90 
91 #endif
TokensList::tokenslist_free
void tokenslist_free(TokensList *list)
free ALL memory associated with the TokensList object
Definition: tokenslist.c:78
TokensList::tokenslist_add
int tokenslist_add(TokensList *list, Token t)
Append a token to the list.
Definition: tokenslist.c:31
TokensListElement::token
Token * token
Token value.
Definition: tokenslist.h:18
TokensList::tail
TokensListElement * tail
tail (last element) pointer
Definition: tokenslist.h:33
TokensList::tokenslist_debug_print
void tokenslist_debug_print(TokensList *list)
Pretty-print all tokens in a list.
Definition: tokenslist.c:89
TokensListElement::prev
struct TokensListElement * prev
prev element in list or NULL
Definition: tokenslist.h:22
TokensListElement::next
struct TokensListElement * next
next element in list or NULL
Definition: tokenslist.h:20
Token
Token type to store token information.
Definition: token_t.h:37
TokensList::head
TokensListElement * head
head (first element) of the list
Definition: tokenslist.h:31
TokensListElement
An element of a TokensList.
Definition: tokenslist.h:16
token_t.h
token type struct
TokensList::tokenslist_recognize
int tokenslist_recognize(TokensList *t)
Do token recognition on all tokens in a list.
Definition: tokenslist.c:117
TokensList
A doubly-linked list for storing Tokens.
Definition: tokenslist.h:29
TokensList::tokenslist_remove
TokensListElement * tokenslist_remove(TokensList *list, TokensListElement *el)
remove a token from the list
Definition: tokenslist.c:60
TokensList::tokenslist_insert
void tokenslist_insert(TokensList *list, TokensListElement *target, TokensList *src)
Insert the contents of SRC into another list after an element.
Definition: tokenslist.c:97
TokensList::tokenslist_new
TokensList * tokenslist_new()
Create a new (empty) TokensList object.
Definition: tokenslist.c:17