Files
compiler-the-translators/symbol_table.h
2025-02-23 12:00:41 -05:00

32 lines
808 B
C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct ListOfTable{
struct SymbolTable* table;
//struct ListOfTable* prev;
struct ListOfTable* next;
}ListOfTable;
typedef struct TableNode{
char* theType;
char* theName;
struct TableNode* next;
}TableNode;
typedef struct SymbolTable{
TableNode* entries;
struct SymbolTable* Parent_Scope;
struct ListOfTable* Children_Scope;
int Line_Number;
int Column_Number;
}SymbolTable;
TableNode* CreateEntry(SymbolTable* table, char* typeOf, char* id);
SymbolTable* CreateScope(SymbolTable* ParentScope, int Line, int Column);
TableNode * table_lookup(SymbolTable * table, char * x);
TableNode * look_up(SymbolTable * table, char * x);