added printSegment class and started tester for framework

This commit is contained in:
Samuel D. Crow
2021-03-24 12:47:00 -05:00
parent f0ad605119
commit 7c5bf76778
8 changed files with 380 additions and 55 deletions

View File

@@ -8,9 +8,9 @@
*/
#include "yab2cpp.h"
unordered_map<string, shared_ptr<variable> >globals;
unordered_map<string, shared_ptr<variable> >locals;
unordered_map<string, shared_ptr<variable> >statics;
unordered_map<string, shared_ptr<variableType> >globals;
unordered_map<string, shared_ptr<variableType> >locals;
unordered_map<string, shared_ptr<variableType> >statics;
/* These correspond to the enum COMPILE_ERRORS. */
const char *COMPILE_ERROR_NAMES[]={
@@ -179,6 +179,7 @@ void setUp()
heap_h.open("output/heap.h");
output_cpp << "#include <runtime.h>\n#include \"consts.h\"\n"
<< "#include \"heap.h\"\n#include \"functions.h\"\n"
<< "int main(int argc, char *argv[])\n{\n"
<< "unsigned int state=start;\nint run(){\nwhile (state>=start){\n"
<< "switch(state){\ncase start:" << endl;
if (DUMP)