|
s502 assembler
A very simple assembler for the 6502 line of processors written in C
|
file reading, tokenization and token recognition step More...
#include <stdio.h>#include <errno.h>#include <string.h>#include <stdlib.h>#include "loadfile.h"#include "token_t.h"#include "tokenFunc.h"#include "logging.h"Go to the source code of this file.
Functions | |
| int | read_token (FILE *f, Token *t) |
| magic token reader function More... | |
| TokensList * | read_file (char *name) |
| read all tokens from a file More... | |
| TokensList * | load_file (char *name) |
| load and parse one file More... | |
| TokensList* load_file | ( | char * | name | ) |
load and parse one file
Load file, parse into tokens, build TokensList, identify token types
| name | file name / path to load |
Definition at line 166 of file loadfile.c.
References ERROR, FAIL, LOG, read_file(), TokensList::tokenslist_free(), and TokensList::tokenslist_recognize().
Referenced by main().
| TokensList* read_file | ( | char * | name | ) |
read all tokens from a file
| name | file name to read tokens from |
High-level func to read the contents from a file
Definition at line 119 of file loadfile.c.
References ERROR, FAIL, Token::len, read_token(), Token::source, Token::token_print(), TOKEN_SOURCE_FILE_SIZE, TokensList::tokenslist_add(), TokensList::tokenslist_free(), and TokensList::tokenslist_new().
Referenced by load_file().
| int read_token | ( | FILE * | f, |
| Token * | t | ||
| ) |
magic token reader function
| f | file to read from |
| t | token to read into |
Read a single token into a Token struct from file f
Definition at line 33 of file loadfile.c.
References Token::binSize, Token::instr, Token::len, LOG, LOGDO, Token::stripped, TOKEN_BUFFER_SIZE, and Token::token_print().
Referenced by read_file().