From: Ulya Trofimovich Date: Tue, 19 May 2015 17:53:35 +0000 (+0100) Subject: Pass only that part of output needed by 're2c::State::emit'. X-Git-Tag: 0.15~254 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77ed90ca548aa0fec06318cae45fdb422b05b623;p=re2c Pass only that part of output needed by 're2c::State::emit'. --- diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index f711b618..faec05e8 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -45,10 +45,8 @@ void genGoTo(OutputFile & o, uint32_t ind, const State *from, const State *to, b o << indent(ind) << "goto " << labelPrefix << to->label << ";\n"; } -void State::emit(Output & output, uint32_t ind, bool &readCh, const std::string& condName) const +void State::emit(OutputFile & o, uint32_t ind, bool &readCh, const std::string& condName) const { - OutputFile & o = output.source; - if (!DFlag) { if (vUsedLabels.count(label)) @@ -121,7 +119,7 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s for (s = head; s; s = s->next) { bool readCh = false; - s->emit(null_dev, ind, readCh, condName); + s->emit(null_dev.source, ind, readCh, condName); s->go.emit(null_dev.source, ind, readCh); } if (last_fill_index < next_fill_index) @@ -224,7 +222,7 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s for (s = head; s; s = s->next) { bool readCh = false; - s->emit(output, ind, readCh, condName); + s->emit(o, ind, readCh, condName); s->go.emit(o, ind, readCh); } diff --git a/re2c/src/dfa/state.h b/re2c/src/dfa/state.h index b9d06a38..884ecd87 100644 --- a/re2c/src/dfa/state.h +++ b/re2c/src/dfa/state.h @@ -27,7 +27,7 @@ public: State (); ~State (); - void emit (Output &, uint32_t, bool &, const std::string &) const; + void emit (OutputFile &, uint32_t, bool &, const std::string &) const; friend std::ostream& operator << (std::ostream &, const State &); FORBID_COPY (State);