void SemanticAnalyzer::generate_one(CodeBlockPtr current) { // iterate through the blocks and // generate all code // generate pre inner code current->preprocess(); if (current->validate()) { current->generate_pre(); // get children and visit for (auto i = current->inner_begin(); i != current->inner_end(); i++) { generate_one(*i); } // generate post code current->generate_post(); } else { // terminate the program this->close_file(); report_msg_type("Compilation Failed", "Validation failure."); exit(0); } }