fixed bugs and added enough runtime to execute first code after the compiler segfaults at shutdown

This commit is contained in:
Samuel D. Crow
2021-03-24 18:17:33 -05:00
parent 7c5bf76778
commit 48505d1ef8
11 changed files with 152 additions and 79 deletions

View File

@@ -7,10 +7,11 @@
**
*/
#include "yab2cpp.h"
#include "runtime/runtime.h"
/* static initializers */
unordered_map<string, shared_ptr<label> > label::lookup;
unsigned int label::nextID;
unsigned int label::nextID=START;
/* base class of all the code structure types */
codeType::codeType(enum CODES t)
@@ -53,6 +54,11 @@ void label::dumpLabels()
varNames << endl;
}
void label::generateEnd()
{
output_cpp << "state=EXIT;\nbreak;\n";
}
void label::generateJumpTo()
{
output_cpp << "state=" << this->getID() << ";\nbreak;\n";