Reworked the tokens to include a broad class to make parameter matching a bit easier, and removed the hexadecimal distinction.

This commit is contained in:
2022-05-12 20:26:14 +00:00
parent 72abf6c4ab
commit 72525959f6
6 changed files with 94 additions and 34 deletions
+8 -1
View File
@@ -21,7 +21,6 @@ typedef enum {
IDENTIFIER,
LABEL,
NUMBER,
HEX,
//Keywords
DB, ORG,
//Opcodes
@@ -31,11 +30,19 @@ typedef enum {
R1, R2, R3, R4, R5, R6, R7, R8
} TokenType;
typedef enum {
None,
Reg,
Immediate16,
Opcode
} TokenClass;
typedef struct {
TokenType type;
char* lexeme;
void* value;
int line;
TokenClass token_class;
} Token;
Token* CreateToken(char*, void*, int, TokenType);