29 lines
679 B
C
29 lines
679 B
C
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.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);
|