s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
A doubly-linked list for storing Tokens. More...
#include <tokenslist.h>
Public Member Functions | |
TokensList * | tokenslist_new () |
Create a new (empty) TokensList object. More... | |
int | tokenslist_add (TokensList *list, Token t) |
Append a token to the list. More... | |
TokensListElement * | tokenslist_remove (TokensList *list, TokensListElement *el) |
remove a token from the list More... | |
void | tokenslist_insert (TokensList *list, TokensListElement *target, TokensList *src) |
Insert the contents of SRC into another list after an element. More... | |
void | tokenslist_free (TokensList *list) |
free ALL memory associated with the TokensList object More... | |
void | tokenslist_debug_print (TokensList *list) |
Pretty-print all tokens in a list. More... | |
int | tokenslist_recognize (TokensList *t) |
Do token recognition on all tokens in a list. More... | |
Data Fields | |
TokensListElement * | head |
head (first element) of the list More... | |
TokensListElement * | tail |
tail (last element) pointer More... | |
A doubly-linked list for storing Tokens.
Definition at line 29 of file tokenslist.h.
int tokenslist_add | ( | TokensList * | list, |
Token | t | ||
) |
Append a token to the list.
Definition at line 31 of file tokenslist.c.
Referenced by read_file().
void tokenslist_debug_print | ( | TokensList * | list | ) |
Pretty-print all tokens in a list.
Intended for debugging
Definition at line 89 of file tokenslist.c.
Referenced by main().
void tokenslist_free | ( | TokensList * | list | ) |
free ALL memory associated with the TokensList object
Pointer should be NULLed after this!
Definition at line 78 of file tokenslist.c.
Referenced by load_file(), read_file(), and state_free().
void tokenslist_insert | ( | TokensList * | list, |
TokensListElement * | target, | ||
TokensList * | src | ||
) |
Insert the contents of SRC into another list after an element.
Keeps the original element in place
Definition at line 97 of file tokenslist.c.
TokensList * tokenslist_new | ( | ) |
Create a new (empty) TokensList object.
Definition at line 17 of file tokenslist.c.
Referenced by read_file().
int tokenslist_recognize | ( | TokensList * | t | ) |
Do token recognition on all tokens in a list.
t | tokenslist to use |
Definition at line 117 of file tokenslist.c.
Referenced by load_file().
TokensListElement * tokenslist_remove | ( | TokensList * | list, |
TokensListElement * | el | ||
) |
remove a token from the list
The reason why we return is that we use it in an iteration over the same list
Definition at line 60 of file tokenslist.c.
Referenced by pass_one(), and tokenslist_free().
TokensListElement* TokensList::head |
head (first element) of the list
Definition at line 31 of file tokenslist.h.
Referenced by concat_bin(), pass_one(), pass_two(), tokenslist_add(), tokenslist_debug_print(), tokenslist_free(), tokenslist_insert(), tokenslist_new(), tokenslist_recognize(), and tokenslist_remove().
TokensListElement* TokensList::tail |
tail (last element) pointer
Definition at line 33 of file tokenslist.h.
Referenced by tokenslist_add(), tokenslist_insert(), tokenslist_new(), and tokenslist_remove().