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;
/*
* Global variables
*/
*/
FunctionInformation *currentFunction;
TypeInformation *kIntegerType;
......@@ -59,7 +58,7 @@ ostream& TypeInformation::print(ostream& o)
switch (outputFormat)
{
case kFullFormat:
o << "/*TypeInformation @ " << (void*)this << '\n';
o << "TypeInformation @ " << (void*)this << '\n';
o << " Tag: " << tag << '\n';
o << " ID: " << id << '\n';
o << " Table: " << (void*)table << '\n';
......@@ -68,8 +67,6 @@ ostream& TypeInformation::print(ostream& o)
o << '\n';
o << " Dimensions: " << arrayDimensions << '\n';
o << " Size: " << size << '\n';
o << "*/";
break;
case kSummaryFormat:
o << (void*)this << ' ';
if (elementType != NULL)
......@@ -84,7 +81,7 @@ ostream& TypeInformation::print(ostream& o)
o << id;
}
o << " [" << size << "] ";
o << " [" << size << "]";
break;
case kShortFormat:
......@@ -131,7 +128,7 @@ ostream& VariableInformation::print(ostream& o)
o << '\n';
o << " Next: " << (void*)prev << ' ';
if (prev) o << SummarySymbols << prev << LongSymbols;
o << "\n";
o << '\n';
break;
case kSummaryFormat:
......@@ -166,7 +163,7 @@ ostream& FunctionInformation::print(ostream& o)
switch (outputFormat)
{
case kFullFormat:
o << " FunctionInformation @ " << (void*)this << '\n';
o << "FunctionInformation @ " << (void*)this << '\n';
o << " Tag: " << tag << '\n';
o << " ID: " << id << '\n';
o << " Table: " << (void*)table << '\n';
......@@ -187,7 +184,6 @@ ostream& FunctionInformation::print(ostream& o)
tmp = tmp->prev;
}
o << LongSymbols;
o << "/*";
}
else
{
......@@ -204,22 +200,22 @@ ostream& FunctionInformation::print(ostream& o)
tmp = tmp->prev;
}
o << LongSymbols;
o << "\n";
o << '\n';
}
else
{
o << " Locals: none\n";
}
o << "Body: " << (void*)body << '\n';
o << " Body: " << (void*)body << '\n';
if (body) o << body;
o << "*/\n";
o << '\n';
o << " Quads: " << (void*)quads << '\n';
if (quads) o << quads;
o << "\n";
o << '\n';
o << "\n" << symbolTable << "\n";
o << symbolTable;
break;
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