From 1bc0b3a137fce15ff81498ef91f14cc99272378e Mon Sep 17 00:00:00 2001 From: satunreric Date: Thu, 29 Apr 2021 21:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/main.cpp b/main.cpp index 4f9c13d..6a3cdaf 100644 --- a/main.cpp +++ b/main.cpp @@ -990,7 +990,38 @@ public: } } wcout << endl; + } + + wcout << endl; + + wcout << "GOTO" << endl; + symbols.clear(); + + wcout << std::left << std::setw(4) << " "; + for(const auto *symbol : pool->getAllSymbols()) { + if(symbol->index == 0) continue; + if(!symbol->terminator && !symbol->start) { + wcout << std::left << std::setw(4) << symbol->name; + symbols.push_back(symbol->index); + } + } + wcout <getItemCollections().size(); k++) { + wcout << std::left << std::setw(4) << k; + for (int symbol : symbols) { + auto p_step = this->findGotoStep(k, symbol); + if(p_step == nullptr) { + wcout << std::left << std::setw(4) << " "; + } else { + wcout << std::left << std::setw(4) << to_wstring(p_step->target.index); + } + } + wcout << endl; + } + + wcout << endl << endl; } };