added a simple test of symbol table and entry creation
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct ListOfTable{
|
||||
struct SymbolTable* table;
|
||||
//struct ListOfTable* prev;
|
||||
struct ListOfTable* next;
|
||||
|
||||
}ListOfTable;
|
||||
|
||||
typedef union Value{
|
||||
int* value_of_int;
|
||||
void* value_of_pointer;
|
||||
bool* value_of_bool;
|
||||
char* value_of_char;
|
||||
}Value;
|
||||
|
||||
typedef struct TableNode{
|
||||
char* theType;
|
||||
char* theName;
|
||||
Value* value;
|
||||
struct TableNode* next;
|
||||
//this next value is an int for string types to tell you how far to traverse a buffer for the string
|
||||
int StrLength;
|
||||
}TableNode;
|
||||
|
||||
typedef struct SymbolTable{
|
||||
TableNode* entries;
|
||||
struct SymbolTable* Parent_Scope;
|
||||
struct ListOfTable* Children_Scope;
|
||||
int Line_Number;
|
||||
int Column_Number;
|
||||
}SymbolTable;
|
||||
|
Reference in New Issue
Block a user