added more symbol table functions
This commit is contained in:
@ -101,6 +101,37 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr){
|
||||
}
|
||||
}
|
||||
|
||||
SymbolTable * getParent(SymbolTable* st){
|
||||
return st->ParentScope;
|
||||
}
|
||||
|
||||
ListOfTable * getChildren(SymbolTable* st){
|
||||
return st->Children_Scope;
|
||||
}
|
||||
SymbolTable * getFirstChild(ListOfTable * lt){
|
||||
return lt->table;
|
||||
}
|
||||
ListOfTable * getRestOfChildren(ListOfTable * lt){
|
||||
return lt->next;
|
||||
}
|
||||
TableNode * getFirstEntry(SymbolTable * st){
|
||||
return st->entries;
|
||||
}
|
||||
TableNode * getNextEntry(TableNode * tn){
|
||||
return tn->next;
|
||||
}
|
||||
char * getType(TableNode * tn){
|
||||
return tn->theType;
|
||||
}
|
||||
char * getName(TableNode * tn){
|
||||
return tn->theName;
|
||||
}
|
||||
int getLine(SymbolTable * st){
|
||||
return st->line;
|
||||
}
|
||||
int getColumn(SymbolTable *st){
|
||||
return st->column;
|
||||
}
|
||||
//uncomment the below main function along with the headers above for a simple standalone test of table and entry creation
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user