Redesigning the way the Symbol's represent string declaration (the .db msg 'Hello World' type of declarations).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef SYMBOLSTABLE_H
|
||||
#define SYMBOLSTABLE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
@@ -13,13 +14,19 @@ typedef enum {
|
||||
Address
|
||||
} SymbolType;
|
||||
|
||||
typedef struct {
|
||||
char* String;
|
||||
uint8_t TerminatorByte;
|
||||
int HasTerminatorByte;
|
||||
} SymbolString;
|
||||
|
||||
typedef struct {
|
||||
char* Name;
|
||||
int Length;
|
||||
int Resolved;
|
||||
|
||||
union {
|
||||
char* Text;
|
||||
SymbolString String;
|
||||
int Number;
|
||||
//Instruction Instruction;
|
||||
} Value;
|
||||
@@ -33,7 +40,8 @@ typedef struct {
|
||||
|
||||
SymbolTable* CreateSymbolTable(void);
|
||||
Symbol* TryGetSymbol(char* name, SymbolTable* table);
|
||||
Symbol* AddSymbolToTable(char* name, void* value, int length, SymbolTable* table);
|
||||
Symbol* AddSymbolToTable(char* name, SymbolTable* table);
|
||||
SymbolString* CreateSymbolString(char* text);
|
||||
void FreeSymbolTable(SymbolTable* table);
|
||||
void FreeSymbol(Symbol* symbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user