Massive refactoring to simplify this whole setup. The Token List will be modified in place and reused in the Parser to normalize the list and generate a symbols table. Normalizing the token list will make sure the syntax is valid and the symbols table will have the relative offsets and length of symbol values. At least this is all the plan but one step at a time.

This commit is contained in:
2023-03-06 21:51:36 -06:00
parent 1b246e90bc
commit 5e9e1bdec4
7 changed files with 201 additions and 232 deletions
+8
View File
@@ -283,6 +283,14 @@ Token* ParseIdentifier(void) {
return token;
}
if (strcmp(lexeme, "load") == 0) {
Token* token = CreateToken(Line, DirectiveClass);
token->Lemexe = lexeme;
token->Value.Directive = Load;
return token;
}
Token* token = CreateToken(Line, IdentifierClass);