From 4e0f079e41587fae454bce64d8ad8cd445b57898 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 3 Apr 2016 17:00:37 +0100 Subject: [PATCH] Separated .dot code generation from common case. --- re2c/src/codegen/emit.h | 3 - re2c/src/codegen/emit_action.cc | 64 +++------- re2c/src/codegen/emit_dfa.cc | 116 +++++++++--------- re2c/src/codegen/indent.h | 6 +- re2c/src/ir/adfa/adfa.h | 1 + re2c/test/bug47_dot_escapes.--emit-dot.c | 2 - re2c/test/dot.--emit-dot.c | 4 +- re2c/test/dot2.--emit-dot.c | 2 - re2c/test/dot_backslash.--emit-dot.c | 2 - re2c/test/dot_conditions.c--emit-dot.c | 4 - re2c/test/dot_ranges.--emit-dot.c | 2 - ....c--emit-dot--flex-syntax--case-inverted.c | 10 -- ....c--emit-dot--flex-syntax--case-inverted.c | 24 +--- re2c/test/scanner_re2c_default.--emit-dot.c | 22 +--- 14 files changed, 90 insertions(+), 172 deletions(-) diff --git a/re2c/src/codegen/emit.h b/re2c/src/codegen/emit.h index f6aae16e..29375344 100644 --- a/re2c/src/codegen/emit.h +++ b/re2c/src/codegen/emit.h @@ -21,9 +21,6 @@ void emit_action , bool base_ctxmarker ); -// helpers -void genGoTo (OutputFile & o, uint32_t ind, const State * from, const State * to, bool & readCh); - } // namespace re2c #endif // _RE2C_CODEGEN_EMIT_ diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index 9d9ca623..4384c11c 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -27,12 +27,13 @@ static void emit_initial (OutputFile & o, uint32_t ind, bool & readCh, con static void emit_save (OutputFile & o, uint32_t ind, bool & readCh, const State * const s, size_t save, bool save_yyaccept); static void emit_accept_binary (OutputFile & o, uint32_t ind, bool & readCh, const State * const s, const accept_t & accept, size_t l, size_t r); static void emit_accept (OutputFile & o, uint32_t ind, bool & readCh, const State * const s, const accept_t & accept); -static void emit_rule(OutputFile &o, uint32_t ind, const State *const s, +static void emit_rule(OutputFile &o, uint32_t ind, size_t rule, const std::string &condName, const Skeleton *skeleton, bool base_ctxmarker); static void genYYFill (OutputFile & o, size_t need); static void genSetCondition (OutputFile & o, uint32_t ind, const std::string & newcond); static void genSetState (OutputFile & o, uint32_t ind, uint32_t fillIndex); +static void genGoTo (OutputFile & o, uint32_t ind, const State * from, const State * to, bool & readCh); void emit_action ( const Action & action @@ -64,10 +65,10 @@ void emit_action emit_accept (o, ind, readCh, s, * action.info.accepts); break; case Action::RULE: - emit_rule (o, ind, s, action.info.rule, condName, skeleton, base_ctxmarker); + emit_rule (o, ind, action.info.rule, condName, skeleton, base_ctxmarker); break; } - if (opts->target != opt_t::DOT && !s->ctxs.empty()) { + if (!s->ctxs.empty()) { if (base_ctxmarker) { o.wstring(opts->input_api.stmt_dist(ind, s->ctxs, skeleton->contexts)); } else { @@ -78,11 +79,6 @@ void emit_action void emit_match (OutputFile & o, uint32_t ind, bool & readCh, const State * const s) { - if (opts->target == opt_t::DOT) - { - return; - } - const bool read_ahead = s && s->next && s->next->action.type != Action::RULE; @@ -110,11 +106,6 @@ void emit_match (OutputFile & o, uint32_t ind, bool & readCh, const State * cons void emit_initial (OutputFile & o, uint32_t ind, bool & readCh, const State * const s, const Initial & initial, const std::set & used_labels) { - if (opts->target == opt_t::DOT) - { - return; - } - if (used_labels.count(s->label)) { if (s->fill != 0) @@ -154,10 +145,6 @@ void emit_initial (OutputFile & o, uint32_t ind, bool & readCh, const State * co void emit_save(OutputFile &o, uint32_t ind, bool &readCh, const State *const s, size_t save, bool save_yyaccept) { - if (opts->target == opt_t::DOT) { - return; - } - if (save_yyaccept) { o.wind(ind).wstring(opts->yyaccept).ws(" = ") .wu64(save).ws(";\n"); @@ -194,10 +181,7 @@ void emit_accept (OutputFile & o, uint32_t ind, bool & readCh, const State * con const size_t accepts_size = accepts.size (); if (accepts_size > 0) { - if (opts->target != opt_t::DOT) - { - o.wstring(opts->input_api.stmt_restore (ind)); - } + o.wstring(opts->input_api.stmt_restore (ind)); if (readCh) // shouldn't be necessary, but might become at some point { @@ -219,18 +203,10 @@ void emit_accept (OutputFile & o, uint32_t ind, bool & readCh, const State * con o.wind(ind).ws("goto *").wstring(opts->yytarget).ws("[").wstring(opts->yyaccept).ws("];\n"); o.wind(--ind).ws("}\n"); } - else if (opts->sFlag || (accepts_size == 2 && opts->target != opt_t::DOT)) + else if (opts->sFlag || (accepts_size == 2)) { emit_accept_binary (o, ind, readCh, s, accepts, 0, accepts_size - 1); } - else if (opts->target == opt_t::DOT) - { - for (uint32_t i = 0; i < accepts_size; ++i) - { - o.wlabel(s->label).ws(" -> ").wlabel(accepts[i]->label); - o.ws(" [label=\"yyaccept=").wu32(i).ws("\"]\n"); - } - } else { o.wind(ind).ws("switch (").wstring(opts->yyaccept).ws(") {\n"); @@ -273,7 +249,6 @@ static void subst_contexts( void emit_rule( OutputFile &o, uint32_t ind, - const State *const s, size_t rule_idx, const std::string &condName, const Skeleton *skeleton, @@ -282,17 +257,6 @@ void emit_rule( const Rule &rule = skeleton->rules[rule_idx]; const RuleInfo *info = rule.info; - if (opts->target == opt_t::DOT) { - o.wlabel(s->label); - const Code *code = info->code; - if (code) { - o.ws(" [label=\"").wstring(code->loc.filename) - .ws(":").wu32(code->loc.line).ws("\"]"); - } - o.ws("\n"); - return; - } - const Trail &trail = rule.trail; switch (trail.type) { case Trail::NONE: @@ -337,11 +301,6 @@ void emit_rule( void need (OutputFile & o, uint32_t ind, bool & readCh, size_t n, bool bSetMarker) { - if (opts->target == opt_t::DOT) - { - return; - } - uint32_t fillIndex = last_fill_index; if (opts->fFlag) @@ -430,4 +389,15 @@ void genSetState(OutputFile & o, uint32_t ind, uint32_t fillIndex) o.ws("\n"); } +void genGoTo(OutputFile & o, uint32_t ind, const State *from, const State *to, bool & readCh) +{ + if (readCh && from->next != to) + { + o.wstring(opts->input_api.stmt_peek (ind)); + readCh = false; + } + + o.wind(ind).ws("goto ").wstring(opts->labelPrefix).wlabel(to->label).ws(";\n"); +} + } // namespace re2c diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index dcc5256c..6bdf4c67 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -35,35 +35,15 @@ std::string genGetCondition() : opts->cond_get + "()"; } -void genGoTo(OutputFile & o, uint32_t ind, const State *from, const State *to, bool & readCh) +void emit_state (OutputFile & o, uint32_t ind, const State * s, bool used_label) { - if (opts->target == opt_t::DOT) + if (used_label) { - o.wlabel(from->label).ws(" -> ").wlabel(to->label).ws("\n"); - return; + o.wstring(opts->labelPrefix).wlabel(s->label).ws(":\n"); } - - if (readCh && from->next != to) + if (opts->dFlag && (s->action.type != Action::INITIAL)) { - o.wstring(opts->input_api.stmt_peek (ind)); - readCh = false; - } - - o.wind(ind).ws("goto ").wstring(opts->labelPrefix).wlabel(to->label).ws(";\n"); -} - -void emit_state (OutputFile & o, uint32_t ind, const State * s, bool used_label) -{ - if (opts->target != opt_t::DOT) - { - if (used_label) - { - o.wstring(opts->labelPrefix).wlabel(s->label).ws(":\n"); - } - if (opts->dFlag && (s->action.type != Action::INITIAL)) - { - o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(opts->input_api.expr_peek ()).ws(");\n"); - } + o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(opts->input_api.expr_peek ()).ws(");\n"); } } @@ -114,6 +94,52 @@ void DFA::emit_body (OutputFile & o, uint32_t& ind, const std::set & us } } +void DFA::emit_dot( + OutputFile &o, + bool last_cond, + const std::vector &conds) const +{ + if (!opts->cFlag || !bWroteCondCheck) { + o.ws("digraph re2c {\n"); + } + if (opts->cFlag) { + if (!bWroteCondCheck) { + for (size_t i = 0; i < conds.size(); ++i) { + const std::string &cond = conds[i]; + o.ws("0 -> ").wstring(cond) + .ws(" [label=\"state=") + .wstring(cond).ws("\"]\n"); + } + bWroteCondCheck = true; + } + o.wstring(cond).ws(" -> ").wlabel(head->label).ws("\n"); + } + for (State *s = head; s; s = s->next) { + if (s->action.type == Action::ACCEPT) { + const accept_t &accepts = *s->action.info.accepts; + for (uint32_t i = 0; i < accepts.size(); ++i) { + o.wlabel(s->label).ws(" -> ") + .wlabel(accepts[i]->label) + .ws(" [label=\"yyaccept=") + .wu32(i).ws("\"]").ws("\n"); + } + } else if (s->action.type == Action::RULE) { + const Code *code = rules[s->action.info.rule].info->code; + if (code) { + o.wlabel(s->label).ws(" [label=\"") + .wstring(code->loc.filename) + .ws(":").wu32(code->loc.line) + .ws("\"]").ws("\n"); + } + } + bool readCh = false; + s->go.emit(o, 0, readCh); + } + if (!opts->cFlag || last_cond) { + o.ws("}\n"); + } +} + void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBrace) { OutputFile & o = output.source; @@ -151,8 +177,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra warn_undefined_control_flow(*skeleton); warn_unreachable_nullable_rules(*skeleton); - if (opts->target == opt_t::SKELETON) - { + if (opts->target == opt_t::SKELETON) { if (output.skeletons.insert (name).second) { emit_data(*skeleton, o.file_name); @@ -162,19 +187,14 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra emit_body (o, i, used_labels, initial_label); emit_end(*skeleton, o, need_backup, need_backupctx); } - } - else - { + } else if (opts->target == opt_t::DOT) { + emit_dot(o, isLastCond, output.types); + } else { // Generate prolog if (bProlog) { o.ws("\n").wdelay_line_info (); - if (opts->target == opt_t::DOT) - { - bPrologBrace = true; - o.ws("digraph re2c {\n"); - } - else if ((!opts->fFlag && o.get_used_yyaccept ()) + if ((!opts->fFlag && o.get_used_yyaccept ()) || (!opts->fFlag && opts->bEmitYYCh) || (opts->bFlag && !opts->cFlag && BitMap::first) || (opts->cFlag && !bWroteCondCheck && opts->gFlag) @@ -188,7 +208,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra { ind = 1; } - if (!opts->fFlag && opts->target != opt_t::DOT) + if (!opts->fFlag) { if (opts->bEmitYYCh) { @@ -216,7 +236,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra genCondTable(o, ind, output.types); } o.wdelay_state_goto (ind); - if (opts->cFlag && opts->target != opt_t::DOT) + if (opts->cFlag) { if (used_labels.count(start_label)) { @@ -237,14 +257,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra strrreplace(divider, opts->condDividerParam, cond); o.wstring(divider).ws("\n"); } - if (opts->target == opt_t::DOT) - { - o.wstring(cond).ws(" -> ").wlabel(head->label).ws("\n"); - } - else - { - o.wstring(opts->condPrefix).wstring(cond).ws(":\n"); - } + o.wstring(opts->condPrefix).wstring(cond).ws(":\n"); } if (opts->cFlag && opts->bFlag && BitMap::first) { @@ -327,16 +340,7 @@ void genCondGotoSub(OutputFile & o, uint32_t ind, const std::vector void genCondGoto(OutputFile & o, uint32_t ind, const std::vector & condnames) { const size_t conds = condnames.size (); - if (opts->target == opt_t::DOT) - { - o.warn_condition_order = false; // see note [condition order] - for (size_t i = 0; i < conds; ++i) - { - const std::string cond = condnames[i]; - o.ws("0 -> ").wstring(cond).ws(" [label=\"state=").wstring(cond).ws("\"]\n"); - } - } - else if (opts->gFlag) + if (opts->gFlag) { o.wind(ind).ws("goto *").wstring(opts->yyctable).ws("[").wstring(genGetCondition()).ws("];\n"); } diff --git a/re2c/src/codegen/indent.h b/re2c/src/codegen/indent.h index d2d8f369..d00e46f0 100644 --- a/re2c/src/codegen/indent.h +++ b/re2c/src/codegen/indent.h @@ -8,12 +8,10 @@ namespace re2c { -inline std::string indent (uint32_t ind) +inline std::string indent(uint32_t ind) { std::string str; - - while (opts->target != opt_t::DOT && ind-- > 0) - { + while (ind-- > 0) { str += opts->indString; } return str; diff --git a/re2c/src/ir/adfa/adfa.h b/re2c/src/ir/adfa/adfa.h index f8279028..4816cb18 100644 --- a/re2c/src/ir/adfa/adfa.h +++ b/re2c/src/ir/adfa/adfa.h @@ -101,6 +101,7 @@ private: void findBaseState (); void count_used_labels (std::set & used, label_t prolog, label_t start, bool force_start) const; void emit_body (OutputFile &, uint32_t &, const std::set & used_labels, label_t initial) const; + void emit_dot(OutputFile &o, bool last_cond, const std::vector &conds) const; FORBID_COPY (DFA); }; diff --git a/re2c/test/bug47_dot_escapes.--emit-dot.c b/re2c/test/bug47_dot_escapes.--emit-dot.c index ed16996c..74132396 100644 --- a/re2c/test/bug47_dot_escapes.--emit-dot.c +++ b/re2c/test/bug47_dot_escapes.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00-0x06][0x0E-!][#-&][(-[][0x5D-0xFF]"] 1 -> 3 [label="[0x07]"] 1 -> 5 [label="[0x08]"] diff --git a/re2c/test/dot.--emit-dot.c b/re2c/test/dot.--emit-dot.c index d9716722..ca08117c 100644 --- a/re2c/test/dot.--emit-dot.c +++ b/re2c/test/dot.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00-`][b-d][f-0xFF]"] 1 -> 4 [label="[a]"] 1 -> 5 [label="[e]"] @@ -13,7 +11,7 @@ digraph re2c { 5 -> 8 [label="[f]"] 6 -> 7 [label="[0x00-b][d-0xFF]"] 6 -> 9 [label="[c]"] -7 -> 3 +7 -> 3 [label="yyaccept=0"] 8 -> 7 [label="[0x00-f][h-0xFF]"] 8 -> 11 [label="[g]"] 9 -> 10 diff --git a/re2c/test/dot2.--emit-dot.c b/re2c/test/dot2.--emit-dot.c index d590eba2..14e99bba 100644 --- a/re2c/test/dot2.--emit-dot.c +++ b/re2c/test/dot2.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00]"] 1 -> 4 [label="[0x01-0xFF]"] 2 -> 3 diff --git a/re2c/test/dot_backslash.--emit-dot.c b/re2c/test/dot_backslash.--emit-dot.c index 73c7a220..d881861b 100644 --- a/re2c/test/dot_backslash.--emit-dot.c +++ b/re2c/test/dot_backslash.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00-[][0x5D-0xFF]"] 1 -> 3 [label="[\\]"] 3 -> 4 diff --git a/re2c/test/dot_conditions.c--emit-dot.c b/re2c/test/dot_conditions.c--emit-dot.c index 828284e7..4e34159a 100644 --- a/re2c/test/dot_conditions.c--emit-dot.c +++ b/re2c/test/dot_conditions.c--emit-dot.c @@ -1,10 +1,7 @@ /* Generated by re2c */ - digraph re2c { - 0 -> state1 [label="state=state1"] 0 -> state2 [label="state=state2"] -/* *********************************** */ state1 -> 2 2 -> 3 [label="[0x00-`][b-e][g-0xFF]"] 2 -> 4 [label="[a]"] @@ -21,7 +18,6 @@ state1 -> 2 9 [label="dot_conditions.c--emit-dot.re:6"] 10 -> 11 11 [label="dot_conditions.c--emit-dot.re:8"] -/* *********************************** */ state2 -> 13 13 -> 14 [label="[0x00-`][b-0xFF]"] 13 -> 15 [label="[a]"] diff --git a/re2c/test/dot_ranges.--emit-dot.c b/re2c/test/dot_ranges.--emit-dot.c index cc775132..244c00c8 100644 --- a/re2c/test/dot_ranges.--emit-dot.c +++ b/re2c/test/dot_ranges.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00-/][9-0x5D][_-`][c-0xFD]"] 1 -> 4 [label="[0-8][^]"] 1 -> 6 [label="[a-b][0xFE-0xFF]"] diff --git a/re2c/test/php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.c b/re2c/test/php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.c index 3897c854..6f354947 100644 --- a/re2c/test/php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.c +++ b/re2c/test/php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 0 -> INITIAL [label="state=INITIAL"] 0 -> ST_OFFSET [label="state=ST_OFFSET"] 0 -> ST_SECTION_VALUE [label="state=ST_SECTION_VALUE"] @@ -10,7 +8,6 @@ digraph re2c { 0 -> ST_DOUBLE_QUOTES [label="state=ST_DOUBLE_QUOTES"] 0 -> ST_VARNAME [label="state=ST_VARNAME"] 0 -> ST_RAW [label="state=ST_RAW"] -/* *********************************** */ INITIAL -> 2 2 -> 3 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][#][%]['][*-:][<][>-E][G-M][P-S][U-X][Z][\\-0x5D][_-e][g-m][p-s][u-x][z][0x7F-0xFF]"] 2 -> 6 [label="[0x09]"] @@ -140,7 +137,6 @@ INITIAL -> 2 59 -> 60 60 -> 58 [label="[0x00-0x08][0x0A-0x1F][!-0xFF]"] 60 -> 59 [label="[0x09][ ]"] -/* *********************************** */ ST_DOUBLE_QUOTES -> 62 62 -> 63 [label="[0x00-!][#][%-0xFF]"] 62 -> 65 [label="[\"]"] @@ -155,7 +151,6 @@ ST_DOUBLE_QUOTES -> 62 68 -> 69 [label="[{]"] 69 -> 70 70 [label="php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.re:449"] -/* *********************************** */ ST_OFFSET -> 72 72 -> 73 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!][#][%-&][(-,][/][:][<-@][[][^][`][{-0xFF]"] 72 -> 76 [label="[0x09][ ]"] @@ -236,7 +231,6 @@ ST_OFFSET -> 72 104 -> 96 [label="[\\]"] 105 -> 106 106 [label="php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.re:416"] -/* *********************************** */ ST_RAW -> 108 108 -> 109 [label="[0x00]"] 108 -> 111 [label="[0x01-0x08][0x0B-0x0C][0x0E-0x1F][!-:][<-0xFF]"] @@ -270,7 +264,6 @@ ST_RAW -> 108 124 [label="php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.re:637"] 125 -> 124 [label="[0x00-0x09][0x0B-0xFF]"] 125 -> 123 [label="[0x0A]"] -/* *********************************** */ ST_SECTION_RAW -> 127 127 -> 128 [label="[0x00-0x09][0x0B-0x0C][0x0E-\\][^-0xFF]"] 127 -> 131 [label="[0x0A][0x0D]"] @@ -290,7 +283,6 @@ ST_SECTION_RAW -> 127 136 -> 135 137 -> 135 [label="[0x00-0x09][0x0B-0xFF]"] 137 -> 136 [label="[0x0A]"] -/* *********************************** */ ST_SECTION_VALUE -> 139 139 -> 140 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!][#][%-&][(-,][/][:][<-@][[][^][`][{-0xFF]"] 139 -> 143 [label="[0x09][ ]"] @@ -377,7 +369,6 @@ ST_SECTION_VALUE -> 139 174 -> 173 [label="[0x0A]"] 175 -> 176 176 [label="php20150211_zend_ini_scanner.c--emit-dot--flex-syntax--case-inverted.re:416"] -/* *********************************** */ ST_VALUE -> 178 178 -> 179 [label="[0x00]"] 178 -> 181 [label="[0x01-0x08][0x0B-0x0C][0x0E-0x1F][#][%][*-,][/][:][<][>-@][[-0x5D][`][{][}][0x7F-0xFF]"] @@ -572,7 +563,6 @@ ST_VALUE -> 178 250 -> 251 251 -> 249 [label="[0x00-0x08][0x0A-0x1F][!-0xFF]"] 251 -> 250 [label="[0x09][ ]"] -/* *********************************** */ ST_VARNAME -> 253 253 -> 254 [label="[0x00-0x08][0x0B-0x0C][0x0E- ][#][%]['][*-:][<][>-Z][\\-0x5D][_-z][0x7F-0xFF]"] 253 -> 257 [label="[0x09-0x0A][0x0D][!-\"][$][&][(-)][;][=][[][^][{-|][~]"] diff --git a/re2c/test/php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.c b/re2c/test/php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.c index 3935c29b..569d3666 100644 --- a/re2c/test/php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.c +++ b/re2c/test/php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 0 -> ST_IN_SCRIPTING [label="state=ST_IN_SCRIPTING"] 0 -> ST_LOOKING_FOR_PROPERTY [label="state=ST_LOOKING_FOR_PROPERTY"] 0 -> ST_BACKQUOTE [label="state=ST_BACKQUOTE"] @@ -12,7 +10,6 @@ digraph re2c { 0 -> INITIAL [label="state=INITIAL"] 0 -> ST_END_HEREDOC [label="state=ST_END_HEREDOC"] 0 -> ST_NOWDOC [label="state=ST_NOWDOC"] -/* *********************************** */ INITIAL -> 2 2 -> 3 [label="[0x00-;][=-0xFF]"] 2 -> 5 [label="[<]"] @@ -28,7 +25,7 @@ INITIAL -> 2 9 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1744"] 10 -> 11 [label="[0x00-G][I-g][i-0xFF]"] 10 -> 12 [label="[H][h]"] -11 -> 7 +11 -> 7 [label="yyaccept=0"] 12 -> 11 [label="[0x00-O][Q-o][q-0xFF]"] 12 -> 13 [label="[P][p]"] 13 -> 11 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!-0xFF]"] @@ -38,7 +35,6 @@ INITIAL -> 2 15 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1750"] 16 -> 15 [label="[0x00-0x09][0x0B-0xFF]"] 16 -> 14 [label="[0x0A]"] -/* *********************************** */ ST_BACKQUOTE -> 18 18 -> 19 [label="[0x00-#][%-_][a-z][|-0xFF]"] 18 -> 21 [label="[$]"] @@ -65,14 +61,13 @@ ST_BACKQUOTE -> 18 31 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:2107"] 32 -> 33 [label="[0x00-=][?-0xFF]"] 32 -> 36 [label="[>]"] -33 -> 27 +33 -> 27 [label="yyaccept=0"] 34 -> 35 35 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1824"] 36 -> 33 [label="[0x00-@][[-^][`][{-~]"] 36 -> 37 [label="[A-Z][_][a-z][0x7F-0xFF]"] 37 -> 38 38 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1815"] -/* *********************************** */ ST_DOUBLE_QUOTES -> 40 40 -> 41 [label="[0x00-!][#][%-z][|-0xFF]"] 40 -> 43 [label="[\"]"] @@ -99,19 +94,17 @@ ST_DOUBLE_QUOTES -> 40 53 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:2107"] 54 -> 55 [label="[0x00-=][?-0xFF]"] 54 -> 58 [label="[>]"] -55 -> 49 +55 -> 49 [label="yyaccept=0"] 56 -> 57 57 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1824"] 58 -> 55 [label="[0x00-@][[-^][`][{-~]"] 58 -> 59 [label="[A-Z][_][a-z][0x7F-0xFF]"] 59 -> 60 60 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1815"] -/* *********************************** */ ST_END_HEREDOC -> 62 62 -> 63 63 -> 64 64 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:2093"] -/* *********************************** */ ST_HEREDOC -> 66 66 -> 67 [label="[0x00-#][%-z][|-0xFF]"] 66 -> 69 [label="[$]"] @@ -135,14 +128,13 @@ ST_HEREDOC -> 66 77 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:2107"] 78 -> 79 [label="[0x00-=][?-0xFF]"] 78 -> 82 [label="[>]"] -79 -> 73 +79 -> 73 [label="yyaccept=0"] 80 -> 81 81 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1824"] 82 -> 79 [label="[0x00-@][[-^][`][{-~]"] 82 -> 83 [label="[A-Z][_][a-z][0x7F-0xFF]"] 83 -> 84 84 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1815"] -/* *********************************** */ ST_IN_SCRIPTING -> 86 86 -> 87 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F]"] 86 -> 89 [label="[0x09-0x0A][0x0D][ ]"] @@ -1442,7 +1434,6 @@ ST_IN_SCRIPTING -> 86 751 -> 752 [label="[0x00-/][:-@][[-^][`][{-~]"] 751 -> 127 [label="[0-9][A-Z][_][a-z][0x7F-0xFF]"] 752 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1384"] -/* *********************************** */ ST_LOOKING_FOR_PROPERTY -> 754 754 -> 755 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!-,][.-@][[-^][`][{-~]"] 754 -> 757 [label="[0x09-0x0A][0x0D][ ]"] @@ -1462,7 +1453,6 @@ ST_LOOKING_FOR_PROPERTY -> 754 763 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1272"] 764 -> 765 765 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1268"] -/* *********************************** */ ST_LOOKING_FOR_VARNAME -> 767 767 -> 768 [label="[0x00-@][[-^][`][{-~]"] 767 -> 770 [label="[A-Z][_][a-z][0x7F-0xFF]"] @@ -1474,15 +1464,13 @@ ST_LOOKING_FOR_VARNAME -> 767 772 -> 773 [label="[0x00-/][:-@][\\-^][`][{-|][~]"] 772 -> 771 [label="[0-9][A-Z][_][a-z][0x7F-0xFF]"] 772 -> 774 [label="[[][}]"] -773 -> 769 +773 -> 769 [label="yyaccept=0"] 774 -> 775 775 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1570"] -/* *********************************** */ ST_NOWDOC -> 777 777 -> 778 778 -> 779 779 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:2292"] -/* *********************************** */ ST_VAR_OFFSET -> 781 781 -> 782 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F]"] 781 -> 784 [label="[0x09-0x0A][0x0D][ ][#]['][\\]"] @@ -1524,7 +1512,7 @@ ST_VAR_OFFSET -> 781 803 [label="php20150211_zend_language_scanner.c--emit-dot--flex-syntax--case-inverted.re:1697"] 804 -> 805 [label="[0x00-/][2-0xFF]"] 804 -> 807 [label="[0-1]"] -805 -> 790 +805 -> 790 [label="yyaccept=0"] 806 -> 805 [label="[0x00-/][:-@][G-`][g-0xFF]"] 806 -> 809 [label="[0-9][A-F][a-f]"] 807 -> 808 diff --git a/re2c/test/scanner_re2c_default.--emit-dot.c b/re2c/test/scanner_re2c_default.--emit-dot.c index 48ae31ba..b2686ce0 100644 --- a/re2c/test/scanner_re2c_default.--emit-dot.c +++ b/re2c/test/scanner_re2c_default.--emit-dot.c @@ -1,7 +1,5 @@ /* Generated by re2c */ - digraph re2c { - 1 -> 2 [label="[0x00]"] 1 -> 4 [label="[0x01-0x09][0x0B-$][&-)][+-.][0-0xFF]"] 1 -> 6 [label="[0x0A]"] @@ -214,9 +212,7 @@ digraph re2c { 108 -> 109 109 [label="scanner_re2c_default.--emit-dot.re:134"] } - digraph re2c { - 111 -> 112 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!][#-$][&][-][0-9][@][0x5D-^][`][}-0xFF]"] 111 -> 114 [label="[0x09][ ]"] 111 -> 117 [label="[0x0A]"] @@ -470,9 +466,7 @@ digraph re2c { 245 -> 242 [label="[0x00-0x09][0x0B-0xFF]"] 245 -> 144 [label="[0x0A]"] } - digraph re2c { - 247 -> 248 [label="[0x00]"] 247 -> 250 [label="[0x01-0x09][0x0B-!][#-&][(-z][|][~-0xFF]"] 247 -> 252 [label="[0x0A]"] @@ -566,9 +560,7 @@ digraph re2c { 292 -> 289 [label="[0x00-0x09][0x0B-0xFF]"] 292 -> 265 [label="[0x0A]"] } - digraph re2c { - 294 -> 295 [label="[0x00-0x09][0x0B-)][+-.][0-0xFF]"] 294 -> 297 [label="[0x0A]"] 294 -> 299 [label="[*]"] @@ -587,7 +579,7 @@ digraph re2c { 302 -> 303 [label="[0x00-0x08][0x0A-0x1F][!-\"][$-0xFF]"] 302 -> 301 [label="[0x09][ ]"] 302 -> 304 [label="[#]"] -303 -> 298 +303 -> 298 [label="yyaccept=0"] 304 -> 305 305 -> 303 [label="[0x00-0x08][0x0A-0x1F][!-k][m-0xFF]"] 305 -> 304 [label="[0x09][ ]"] @@ -633,9 +625,7 @@ digraph re2c { 326 -> 323 [label="[0x00-0x09][0x0B-0xFF]"] 326 -> 303 [label="[0x0A]"] } - digraph re2c { - 328 -> 329 [label="[0x00-0x09][0x0B-0xFF]"] 328 -> 331 [label="[0x0A]"] 329 -> 330 @@ -643,9 +633,7 @@ digraph re2c { 331 -> 332 332 [label="scanner_re2c_default.--emit-dot.re:577"] } - digraph re2c { - 334 -> 335 [label="[0x00-0x08][0x0A-0x1F][!-<][>-0xFF]"] 334 -> 337 [label="[0x09][ ]"] 334 -> 340 [label="[=]"] @@ -660,9 +648,7 @@ digraph re2c { 341 -> 340 [label="[0x09][ ]"] 342 [label="scanner_re2c_default.--emit-dot.re:596"] } - digraph re2c { - 344 -> 346 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!][#-&][(-,][.-/][:][<-0xFF]"] 344 -> 345 [label="[0x09-0x0A][0x0D][ ][;]"] 344 -> 348 [label="[\"]"] @@ -700,7 +686,7 @@ digraph re2c { 358 -> 359 [label="[0x0A]"] 358 -> 364 [label="[\"]"] 358 -> 365 [label="[\\]"] -359 -> 345 +359 -> 345 [label="yyaccept=0"] 360 -> 348 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][!-:][<-0xFF]"] 360 -> 357 [label="[0x09][0x0D][ ][;]"] 360 -> 345 [label="[0x0A]"] @@ -718,9 +704,7 @@ digraph re2c { 366 -> 361 [label="[0x00-0x09][0x0B-0xFF]"] 366 -> 359 [label="[0x0A]"] } - digraph re2c { - 368 -> 369 [label="[0x00-0x09][0x0B-!][#-0][:-0xFF]"] 368 -> 371 [label="[0x0A]"] 368 -> 373 [label="[\"]"] @@ -740,7 +724,7 @@ digraph re2c { 378 -> 379 [label="[0x0A]"] 378 -> 380 [label="[\"]"] 378 -> 382 [label="[\\]"] -379 -> 370 +379 -> 370 [label="yyaccept=0"] 380 -> 381 381 [label="scanner_re2c_default.--emit-dot.re:633"] 382 -> 377 [label="[0x00-0x09][0x0B-0xFF]"] -- 2.40.0