Updated the structure of symbols and tokens to hopefully help make computing symbol values easier.
This commit is contained in:
+13
-3
@@ -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
|
||||
Reference in New Issue
Block a user