From a54722bd465e657f86e12d020784491d5a842050 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 4 Mar 2015 15:43:43 +0000 Subject: [PATCH] Continued separating .dot case from other cases in codegen. --- re2c/code.cc | 47 +++++++++++++++-------------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/re2c/code.cc b/re2c/code.cc index 99c8e7c8..612a5581 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -1019,22 +1019,19 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex } } - if (!DFlag) + if (dFlag) { - if (dFlag) - { - o << indent(ind) << mapCodeName["YYDEBUG"] << "(-1, " << mapCodeName["yych"] << ");\n"; - } + o << indent(ind) << mapCodeName["YYDEBUG"] << "(-1, " << mapCodeName["yych"] << ");\n"; + } - if (readCh) - { - o << indent(ind) << "switch ((" << input_api.expr_peek_save () << ")) {\n"; - readCh = false; - } - else - { - o << indent(ind) << "switch (" << mapCodeName["yych"] << ") {\n"; - } + if (readCh) + { + o << indent(ind) << "switch ((" << input_api.expr_peek_save () << ")) {\n"; + readCh = false; + } + else + { + o << indent(ind) << "switch (" << mapCodeName["yych"] << ") {\n"; } while (t != &sP[0]) @@ -1066,7 +1063,7 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex } } - if (used && !DFlag) + if (used) { genGoTo(o, newLine ? ind+1 : 1, from, to, readCh); newLine = true; @@ -1074,23 +1071,9 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex t = r; } - if (DFlag) - { - if (!newLine) - { - o << "\n"; - newLine = true; - } - - o << from->label << " -> " << def->label; - o << " [label=default]\n" ; - } - else - { - o << indent(ind) << "default:"; - genGoTo(o, 1, from, def, readCh); - o << indent(ind) << "}\n"; - } + o << indent(ind) << "default:"; + genGoTo(o, 1, from, def, readCh); + o << indent(ind) << "}\n"; delete [] sP; } -- 2.40.0