fixed some of the spacing in the table t#29
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
void print_symbol_table(SymbolTable *table, FILE *file_ptr){
|
void print_symbol_table(SymbolTable *table, FILE *file_ptr){
|
||||||
if(table->Parent_Scope == NULL){
|
if(table->Parent_Scope == NULL){
|
||||||
fprintf(file_ptr, "%-17s:%-8s:%-8s:%-22s:%-29s\n", "NAME", "SCOPE", "PARANT", "TYPE", "Extra annotation");
|
fprintf(file_ptr, "%-17s: %-6s : %-6s : %-21s: %-28s\n", "NAME", "SCOPE", "PARANT", "TYPE", "Extra annotation");
|
||||||
}
|
}
|
||||||
TableNode * entrie = table->entries;
|
TableNode * entrie = table->entries;
|
||||||
fprintf(file_ptr, "-----------------:--------:--------:----------------------:-----------------------------\n");
|
fprintf(file_ptr, "-----------------:--------:--------:----------------------:-----------------------------\n");
|
||||||
@ -18,7 +18,7 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr){
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(; entrie != NULL; entrie = entrie->next){
|
for(; entrie != NULL; entrie = entrie->next){
|
||||||
fprintf(file_ptr, "%-17s: %06d : %06d :%-22s:%-29s\n",
|
fprintf(file_ptr, "%-17s: %06d : %06d : %-21s: %-28s\n",
|
||||||
entrie->theName, current_scope, parant_scope,
|
entrie->theName, current_scope, parant_scope,
|
||||||
entrie->theType, "Extra annotation");
|
entrie->theType, "Extra annotation");
|
||||||
}
|
}
|
||||||
@ -34,6 +34,7 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr){
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
int main(void){
|
int main(void){
|
||||||
SymbolTable * parant = CreateScope(NULL, 1,1);
|
SymbolTable * parant = CreateScope(NULL, 1,1);
|
||||||
// Value* v = calloc(1, sizeof(Value));
|
// Value* v = calloc(1, sizeof(Value));
|
||||||
@ -59,4 +60,3 @@ int main(void){
|
|||||||
print_symbol_table(parant, stderr);
|
print_symbol_table(parant, stderr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
@ -32,3 +32,7 @@ typedef struct SymbolTable{
|
|||||||
int Line_Number;
|
int Line_Number;
|
||||||
int Column_Number;
|
int Column_Number;
|
||||||
}SymbolTable;
|
}SymbolTable;
|
||||||
|
|
||||||
|
|
||||||
|
TableNode* CreateEntry(SymbolTable* table, char* typeOf, char* id, Value* value, int StringLength);
|
||||||
|
SymbolTable* CreateScope(SymbolTable* ParentScope, int Line, int Column);
|
||||||
|
Reference in New Issue
Block a user