Cleaned up the Symbol struct and updated code accordingly.
This commit is contained in:
@@ -9,11 +9,16 @@
|
||||
|
||||
#define SYMBOLSTABLE_DEFAULT_CAPACITY 128
|
||||
|
||||
typedef enum {
|
||||
StringSymbol,
|
||||
NumericSymbol,
|
||||
InstructionPointerSymbol,
|
||||
UnresolvedSymbol
|
||||
} SymbolType;
|
||||
|
||||
typedef struct {
|
||||
char* Name;
|
||||
int Length;
|
||||
int Resolved;
|
||||
int InstructionPointer;
|
||||
SymbolType Type;
|
||||
|
||||
union {
|
||||
char* Text;
|
||||
@@ -30,7 +35,7 @@ typedef struct {
|
||||
|
||||
SymbolTable* CreateSymbolTable(void);
|
||||
Symbol* TryGetSymbol(char* name, SymbolTable* table);
|
||||
Symbol* AddSymbolToTable(char* name, void* value, int length, SymbolTable* table);
|
||||
Symbol* AddSymbolToTable(char* name, SymbolType type, SymbolTable* table);
|
||||
void FreeSymbolTable(SymbolTable* table);
|
||||
void FreeSymbol(Symbol* symbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user