Skip to content
Snippets Groups Projects
Commit e34a48c1 authored by John Tinnerholm's avatar John Tinnerholm
Browse files

Fixed things in symtab.cc that I made by mistake

parent c265ca85
No related branches found
No related tags found
1 merge request!3Added C-code generator + test to TDDD55-lab
...@@ -7,8 +7,7 @@ using namespace std; ...@@ -7,8 +7,7 @@ using namespace std;
/* /*
* Global variables * Global variables
*/ */
FunctionInformation *currentFunction; FunctionInformation *currentFunction;
TypeInformation *kIntegerType; TypeInformation *kIntegerType;
...@@ -59,7 +58,7 @@ ostream& TypeInformation::print(ostream& o) ...@@ -59,7 +58,7 @@ ostream& TypeInformation::print(ostream& o)
switch (outputFormat) switch (outputFormat)
{ {
case kFullFormat: case kFullFormat:
o << "/*TypeInformation @ " << (void*)this << '\n'; o << "TypeInformation @ " << (void*)this << '\n';
o << " Tag: " << tag << '\n'; o << " Tag: " << tag << '\n';
o << " ID: " << id << '\n'; o << " ID: " << id << '\n';
o << " Table: " << (void*)table << '\n'; o << " Table: " << (void*)table << '\n';
...@@ -68,8 +67,6 @@ ostream& TypeInformation::print(ostream& o) ...@@ -68,8 +67,6 @@ ostream& TypeInformation::print(ostream& o)
o << '\n'; o << '\n';
o << " Dimensions: " << arrayDimensions << '\n'; o << " Dimensions: " << arrayDimensions << '\n';
o << " Size: " << size << '\n'; o << " Size: " << size << '\n';
o << "*/";
break;
case kSummaryFormat: case kSummaryFormat:
o << (void*)this << ' '; o << (void*)this << ' ';
if (elementType != NULL) if (elementType != NULL)
...@@ -84,7 +81,7 @@ ostream& TypeInformation::print(ostream& o) ...@@ -84,7 +81,7 @@ ostream& TypeInformation::print(ostream& o)
o << id; o << id;
} }
o << " [" << size << "] "; o << " [" << size << "]";
break; break;
case kShortFormat: case kShortFormat:
...@@ -131,7 +128,7 @@ ostream& VariableInformation::print(ostream& o) ...@@ -131,7 +128,7 @@ ostream& VariableInformation::print(ostream& o)
o << '\n'; o << '\n';
o << " Next: " << (void*)prev << ' '; o << " Next: " << (void*)prev << ' ';
if (prev) o << SummarySymbols << prev << LongSymbols; if (prev) o << SummarySymbols << prev << LongSymbols;
o << "\n"; o << '\n';
break; break;
case kSummaryFormat: case kSummaryFormat:
...@@ -166,7 +163,7 @@ ostream& FunctionInformation::print(ostream& o) ...@@ -166,7 +163,7 @@ ostream& FunctionInformation::print(ostream& o)
switch (outputFormat) switch (outputFormat)
{ {
case kFullFormat: case kFullFormat:
o << " FunctionInformation @ " << (void*)this << '\n'; o << "FunctionInformation @ " << (void*)this << '\n';
o << " Tag: " << tag << '\n'; o << " Tag: " << tag << '\n';
o << " ID: " << id << '\n'; o << " ID: " << id << '\n';
o << " Table: " << (void*)table << '\n'; o << " Table: " << (void*)table << '\n';
...@@ -187,7 +184,6 @@ ostream& FunctionInformation::print(ostream& o) ...@@ -187,7 +184,6 @@ ostream& FunctionInformation::print(ostream& o)
tmp = tmp->prev; tmp = tmp->prev;
} }
o << LongSymbols; o << LongSymbols;
o << "/*";
} }
else else
{ {
...@@ -204,22 +200,22 @@ ostream& FunctionInformation::print(ostream& o) ...@@ -204,22 +200,22 @@ ostream& FunctionInformation::print(ostream& o)
tmp = tmp->prev; tmp = tmp->prev;
} }
o << LongSymbols; o << LongSymbols;
o << "\n"; o << '\n';
} }
else else
{ {
o << " Locals: none\n"; o << " Locals: none\n";
} }
o << "Body: " << (void*)body << '\n'; o << " Body: " << (void*)body << '\n';
if (body) o << body; if (body) o << body;
o << "*/\n"; o << '\n';
o << " Quads: " << (void*)quads << '\n'; o << " Quads: " << (void*)quads << '\n';
if (quads) o << quads; if (quads) o << quads;
o << "\n"; o << '\n';
o << "\n" << symbolTable << "\n"; o << symbolTable;
break; break;
case kSummaryFormat: case kSummaryFormat:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment