#ifndef SYMBOLSTABLE_H #define SYMBOLSTABLE_H #include #include #include #include #include "opcodes.h" #define SYMBOLSTABLE_DEFAULT_CAPACITY 128 typedef struct { char* Name; int Length; int Resolved; int InstructionPointer; union { char* Text; int Number; Instruction* Instruction; } Value; } Symbol; typedef struct { Symbol** Symbols; int Size; int Capacity; } SymbolTable; SymbolTable* CreateSymbolTable(void); Symbol* TryGetSymbol(char* name, SymbolTable* table); Symbol* AddSymbolToTable(char* name, void* value, int length, SymbolTable* table); void FreeSymbolTable(SymbolTable* table); void FreeSymbol(Symbol* symbol); #endif