Updated the structure of symbols and tokens to hopefully help make computing symbol values easier.

This commit is contained in:
2023-08-07 01:18:01 -05:00
parent 65383cded2
commit 4af2527806
11 changed files with 128 additions and 140 deletions
+13 -3
View File
@@ -25,8 +25,6 @@ typedef enum {
DB,
Include,
Byte
// Load,
// Store
} Directive;
typedef enum {
@@ -41,7 +39,7 @@ typedef enum {
AddressClass = LabelClass | IdentifierClass
} TokenClass;
typedef struct {
typedef struct __token {
char* Lemexe;
TokenClass Class;
int LineNumber;
@@ -54,9 +52,21 @@ typedef struct {
Directive Directive;
int Number;
} Value;
struct __token* Prev;
struct __token* Next;
} Token;
typedef struct {
Token** content;
int size;
int capacity;
} TokenList;
Token* CreateToken(int lineNumber, TokenClass tokenClass);
TokenList* CreateTokenList(void);
int AddToken(Token* token, TokenList* list);
void RemoveToken(int index, TokenList* list);
void FreeToken(Token* token);
#endif