My Project
|
You will modify this file and implement the symbol.h interface. More...
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "Debug.h"
#include "symbol.h"
Data Structures | |
struct | node |
struct | sym_table |
Macros | |
#define | LC3_MEMORY_SIZE (1 << 16) |
Typedefs | |
typedef struct node | node_t |
Functions | |
char * | strdup (const char *s) |
sym_table_t * | symbol_init (int table_size) |
void | symbol_add_unique (sym_table_t *symTab, const char *name, int addr) |
char * | symbol_find_by_addr (sym_table_t *symTab, int addr) |
void | symbol_iterate (sym_table_t *symTab, iterate_fnc_t fnc, void *data) |
struct node * | symbol_search (sym_table_t *symTab, const char *name, int *ptrToHash, int *ptrToIndex) |
int | symbol_add (sym_table_t *symTab, const char *name, int addr) |
symbol_t * | symbol_find_by_name (sym_table_t *symTab, const char *name) |
void | symbol_reset (sym_table_t *symTab) |
void | symbol_term (sym_table_t *symTab) |
Your implementation of the functions defined in symbol.h. You may add other functions if you find it helpful. Added functions should be declared static to indicate they are only used within this file.
#define LC3_MEMORY_SIZE (1 << 16) |
size of LC3 memory
char* strdup | ( | const char * | s | ) |
Provide prototype for strdup()
int symbol_add | ( | sym_table_t * | symTab, |
const char * | name, | ||
int | addr | ||
) |
void symbol_add_unique | ( | sym_table_t * | symTab, |
const char * | name, | ||
int | addr | ||
) |
char* symbol_find_by_addr | ( | sym_table_t * | symTab, |
int | addr | ||
) |
symbol_t* symbol_find_by_name | ( | sym_table_t * | symTab, |
const char * | name | ||
) |
sym_table_t* symbol_init | ( | int | table_size | ) |
void symbol_iterate | ( | sym_table_t * | symTab, |
iterate_fnc_t | fnc, | ||
void * | data | ||
) |
void symbol_reset | ( | sym_table_t * | symTab | ) |
struct node* symbol_search | ( | sym_table_t * | symTab, |
const char * | name, | ||
int * | ptrToHash, | ||
int * | ptrToIndex | ||
) |
void symbol_term | ( | sym_table_t * | symTab | ) |