Updated the scanner to parse registers, assembly keywords and identifiers.
This commit is contained in:
+1
-28
@@ -7,34 +7,7 @@
|
||||
#include <ctype.h>
|
||||
#include "list.h"
|
||||
#include "tokenizer.h"
|
||||
|
||||
typedef enum {
|
||||
PLUS,
|
||||
MINUS,
|
||||
STAR,
|
||||
SLASH,
|
||||
POWER,
|
||||
LPARAM,
|
||||
RPARAM,
|
||||
LBRACKET,
|
||||
RBracket,
|
||||
COMMA,
|
||||
IDENTIFIER,
|
||||
NUMBER,
|
||||
HEX,
|
||||
//Keywords
|
||||
DB, ORG,
|
||||
//Opcodes
|
||||
COPY, ADD, SUB, JZ, INT, YLD, RET,
|
||||
CMP, IN, OUT,
|
||||
//Registers
|
||||
R1, R2, R3, R4, R5, R6, R7, R8
|
||||
} TokenType;
|
||||
|
||||
typedef struct {
|
||||
TokenType type;
|
||||
char* value;
|
||||
} Token;
|
||||
#include "token.h"
|
||||
|
||||
List* GetTokensFromLine(char*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user