diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /contrib/libs/pire | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/pire')
-rw-r--r-- | contrib/libs/pire/pire/classes.cpp | 10 | ||||
-rw-r--r-- | contrib/libs/pire/pire/determine.h | 14 | ||||
-rw-r--r-- | contrib/libs/pire/pire/easy.h | 6 | ||||
-rw-r--r-- | contrib/libs/pire/pire/extra/count.cpp | 16 | ||||
-rw-r--r-- | contrib/libs/pire/pire/extra/glyphs.cpp | 18 | ||||
-rw-r--r-- | contrib/libs/pire/pire/fsm.cpp | 112 | ||||
-rw-r--r-- | contrib/libs/pire/pire/fsm.h | 24 | ||||
-rw-r--r-- | contrib/libs/pire/pire/glue.h | 2 | ||||
-rw-r--r-- | contrib/libs/pire/pire/inline.l | 2 | ||||
-rw-r--r-- | contrib/libs/pire/pire/partition.h | 8 | ||||
-rw-r--r-- | contrib/libs/pire/pire/re_lexer.h | 6 | ||||
-rw-r--r-- | contrib/libs/pire/pire/re_parser.y | 2 | ||||
-rw-r--r-- | contrib/libs/pire/pire/scanner_io.cpp | 2 | ||||
-rw-r--r-- | contrib/libs/pire/pire/scanners/multi.h | 6 | ||||
-rw-r--r-- | contrib/libs/pire/pire/scanners/slow.h | 6 | ||||
-rw-r--r-- | contrib/libs/pire/pire/stub/stl.h | 6 | ||||
-rw-r--r-- | contrib/libs/pire/pire/vbitset.h | 2 |
17 files changed, 121 insertions, 121 deletions
diff --git a/contrib/libs/pire/pire/classes.cpp b/contrib/libs/pire/pire/classes.cpp index bbf021737d..2a7b8f5a81 100644 --- a/contrib/libs/pire/pire/classes.cpp +++ b/contrib/libs/pire/pire/classes.cpp @@ -53,9 +53,9 @@ namespace { return r; } - TSet<wchar32> ToSet() const + TSet<wchar32> ToSet() const { - TSet<wchar32> ret; + TSet<wchar32> ret; for (auto&& bound : m_bounds) for (wchar32 c = bound.first; c <= bound.second; ++c) ret.insert(c); @@ -63,7 +63,7 @@ namespace { } private: - TVector<ypair<wchar32, wchar32> > m_bounds; + TVector<ypair<wchar32, wchar32> > m_bounds; }; public: @@ -72,7 +72,7 @@ namespace { return (m_classes.find(to_lower(wc & ~ControlMask)) != m_classes.end()); } - TSet<wchar32> Get(wchar32 wc) const + TSet<wchar32> Get(wchar32 wc) const { auto it = m_classes.find(to_lower(wc & ~ControlMask)); if (it == m_classes.end()) @@ -102,7 +102,7 @@ namespace { m_classes['t'] = CharClass('\t'); } - TMap<wchar32, CharClass> m_classes; + TMap<wchar32, CharClass> m_classes; }; class CharClassesImpl: public Feature { diff --git a/contrib/libs/pire/pire/determine.h b/contrib/libs/pire/pire/determine.h index fb48fdd0b3..61428ec501 100644 --- a/contrib/libs/pire/pire/determine.h +++ b/contrib/libs/pire/pire/determine.h @@ -48,7 +48,7 @@ namespace Pire { typedef Partition<char, ImplementationSpecific2> LettersTbl; /// A container used for storing map of states to thier indices. - typedef TMap<State, size_t> InvStates; + typedef TMap<State, size_t> InvStates; /// Should return used letters' partition. const LettersTbl& Letters() const; @@ -63,7 +63,7 @@ namespace Pire { bool IsRequired(const State& /*state*/) const { return true; } /// Called when the set of new states is closed. - void AcceptStates(const TVector<State>& newstates); + void AcceptStates(const TVector<State>& newstates); /// Called for each transition from one new state to another. void Connect(size_t from, size_t to, Char letter); @@ -94,12 +94,12 @@ namespace Pire { { typedef typename Task::State State; typedef typename Task::InvStates InvStates; - typedef TDeque< TVector<size_t> > TransitionTable; + typedef TDeque< TVector<size_t> > TransitionTable; - TVector<State> states; + TVector<State> states; InvStates invstates; TransitionTable transitions; - TVector<size_t> stateIndices; + TVector<size_t> stateIndices; states.push_back(task.Initial()); invstates.insert(typename InvStates::value_type(states[0], 0)); @@ -123,14 +123,14 @@ namespace Pire { stateIndices.push_back(stateIdx); } - TVector<Char> invletters(task.Letters().Size()); + TVector<Char> invletters(task.Letters().Size()); for (auto&& letter : task.Letters()) invletters[letter.second.first] = letter.first; task.AcceptStates(states); size_t from = 0; for (TransitionTable::iterator i = transitions.begin(), ie = transitions.end(); i != ie; ++i, ++from) { - TVector<Char>::iterator l = invletters.begin(); + TVector<Char>::iterator l = invletters.begin(); for (TransitionTable::value_type::iterator j = i->begin(), je = i->end(); j != je; ++j, ++l) task.Connect(stateIndices[from], *j, *l); } diff --git a/contrib/libs/pire/pire/easy.h b/contrib/libs/pire/pire/easy.h index c70e965353..d38145f331 100644 --- a/contrib/libs/pire/pire/easy.h +++ b/contrib/libs/pire/pire/easy.h @@ -196,7 +196,7 @@ private: void Init(ypair<const char*, const char*> rawPattern, Options options) { - TVector<wchar32> pattern; + TVector<wchar32> pattern; options.Encoding().FromLocal(rawPattern.first, rawPattern.second, std::back_inserter(pattern)); Lexer lexer(pattern); @@ -216,7 +216,7 @@ private: static bool BeginsWithCircumflex(const Fsm& fsm) { typedef Fsm::StatesSet Set; - TDeque<size_t> queue; + TDeque<size_t> queue; BitSet handled(fsm.Size()); queue.push_back(fsm.Initial()); @@ -231,7 +231,7 @@ private: } } - TSet<Char> lets = fsm.OutgoingLetters(queue.front()); + TSet<Char> lets = fsm.OutgoingLetters(queue.front()); lets.erase(SpecialChar::Epsilon); lets.erase(SpecialChar::BeginMark); if (!lets.empty()) diff --git a/contrib/libs/pire/pire/extra/count.cpp b/contrib/libs/pire/pire/extra/count.cpp index 468ff61d92..89ea43f0c7 100644 --- a/contrib/libs/pire/pire/extra/count.cpp +++ b/contrib/libs/pire/pire/extra/count.cpp @@ -766,15 +766,15 @@ CountingScanner::CountingScanner(const Fsm& re, const Fsm& sep) // Make a full Cartesian product of two sep_res sep_re.Determine(); sep_re.Unsparse(); - TSet<size_t> dead = sep_re.DeadStates(); + TSet<size_t> dead = sep_re.DeadStates(); PIRE_IFDEBUG(Cdbg << "=== Original FSM ===" << Endl << sep_re << ">>> " << sep_re.Size() << " states, dead: [" << Join(dead.begin(), dead.end(), ", ") << "]" << Endl); Fsm sq; typedef ypair<size_t, size_t> NewState; - TVector<NewState> states; - TMap<NewState, size_t> invstates; + TVector<NewState> states; + TMap<NewState, size_t> invstates; states.push_back(NewState(sep_re.Initial(), sep_re.Initial())); invstates.insert(ymake_pair(states.back(), states.size() - 1)); @@ -815,7 +815,7 @@ CountingScanner::CountingScanner(const Fsm& re, const Fsm& sep) PIRE_IFDEBUG(if (ns != savedNs) Cdbg << "Diverted transition to (" << savedNs.first << ", " << savedNs.second << ") on " << (char) letter << " to (" << ns.first << ", " << ns.second << ")" << dbgout << Endl); - TMap<NewState, size_t>::iterator nsi = invstates.find(ns); + TMap<NewState, size_t>::iterator nsi = invstates.find(ns); if (nsi == invstates.end()) { PIRE_IFDEBUG(Cdbg << "New state " << states.size() << " = (" << ns.first << ", " << ns.second << ")" << Endl); states.push_back(ns); @@ -823,7 +823,7 @@ CountingScanner::CountingScanner(const Fsm& re, const Fsm& sep) sq.Resize(states.size()); } - for (TVector<Char>::const_iterator li = lit->second.second.begin(), le = lit->second.second.end(); li != le; ++li) + for (TVector<Char>::const_iterator li = lit->second.second.begin(), le = lit->second.second.end(); li != le; ++li) sq.Connect(curstate, nsi->second, *li); if (outputs) sq.SetOutput(curstate, nsi->second, outputs); @@ -885,14 +885,14 @@ public: using typename ScannerGlueCommon<Scanner>::State; using TAction = typename Scanner::Action; using InternalState = typename Scanner::InternalState; - typedef TMap<State, size_t> InvStates; + typedef TMap<State, size_t> InvStates; CountingScannerGlueTask(const Scanner& lhs, const Scanner& rhs) : ScannerGlueCommon<Scanner>(lhs, rhs, LettersEquality<Scanner>(lhs.m_letters, rhs.m_letters)) { } - void AcceptStates(const TVector<State>& states) + void AcceptStates(const TVector<State>& states) { States = states; this->SetSc(THolder<Scanner>(new Scanner)); @@ -909,7 +909,7 @@ public: } protected: - TVector<State> States; + TVector<State> States; TAction Action(const Scanner& sc, InternalState state, Char letter) const { size_t state_index = sc.StateIdx(state); diff --git a/contrib/libs/pire/pire/extra/glyphs.cpp b/contrib/libs/pire/pire/extra/glyphs.cpp index a14d2baa56..cd4c8465b3 100644 --- a/contrib/libs/pire/pire/extra/glyphs.cpp +++ b/contrib/libs/pire/pire/extra/glyphs.cpp @@ -45,12 +45,12 @@ namespace { */ class GlyphTable { private: - TList< TVector<wchar32> > m_classes; - TMap<wchar32, TVector<wchar32>*> m_map; + TList< TVector<wchar32> > m_classes; + TMap<wchar32, TVector<wchar32>*> m_map; struct GlyphClass { - TVector<wchar32>* m_class; - TMap<wchar32, TVector<wchar32>*> *m_map; + TVector<wchar32>* m_class; + TMap<wchar32, TVector<wchar32>*> *m_map; GlyphClass& operator << (wchar32 c) { @@ -63,7 +63,7 @@ namespace { GlyphClass Class() { GlyphClass cl; - m_classes.push_back(TVector<wchar32>()); + m_classes.push_back(TVector<wchar32>()); cl.m_class = &m_classes.back(); cl.m_map = &m_map; return cl; @@ -71,13 +71,13 @@ namespace { public: - const TVector<wchar32>& Klass(wchar32 x) const + const TVector<wchar32>& Klass(wchar32 x) const { - TMap<wchar32, TVector<wchar32>*>::const_iterator i = m_map.find(x); + TMap<wchar32, TVector<wchar32>*>::const_iterator i = m_map.find(x); if (i != m_map.end()) return *i->second; else - return DefaultValue< TVector<wchar32> >(); + return DefaultValue< TVector<wchar32> >(); } GlyphTable() @@ -119,7 +119,7 @@ namespace { const CharSet& old = range.first; CharSet altered; for (auto&& i : old) { - const TVector<wchar32>* klass = 0; + const TVector<wchar32>* klass = 0; if (i.size() == 1 && !(klass = &m_table->Klass(i[0]))->empty()) for (auto&& j : *klass) altered.insert(Term::String(1, j)); diff --git a/contrib/libs/pire/pire/fsm.cpp b/contrib/libs/pire/pire/fsm.cpp index 984d708dfa..909de9e322 100644 --- a/contrib/libs/pire/pire/fsm.cpp +++ b/contrib/libs/pire/pire/fsm.cpp @@ -11,7 +11,7 @@ * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * Pire is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -42,7 +42,7 @@ #include "platform.h" namespace Pire { - + ystring CharDump(Char c) { char buf[8]; @@ -75,7 +75,7 @@ ystring CharDump(Char c) void Fsm::DumpState(yostream& s, size_t state) const { // Fill in a 'row': Q -> exp(V) (for current state) - TVector< ybitset<MaxChar> > row(Size()); + TVector< ybitset<MaxChar> > row(Size()); for (auto&& transition : m_transitions[state]) for (auto&& transitionState : transition.second) { if (transitionState >= Size()) { @@ -157,7 +157,7 @@ void Fsm::DumpState(yostream& s, size_t state) const if (oit2 == oit->second.end()) ; else { - TVector<int> payload; + TVector<int> payload; for (unsigned i = 0; i < sizeof(oit2->second) * 8; ++i) if (oit2->second & (1ul << i)) payload.push_back(i); @@ -236,9 +236,9 @@ const Fsm::StatesSet& Fsm::Destinations(size_t from, Char c) const return (i != m_transitions[from].end()) ? i->second : DefaultValue<StatesSet>(); } -TSet<Char> Fsm::OutgoingLetters(size_t state) const +TSet<Char> Fsm::OutgoingLetters(size_t state) const { - TSet<Char> ret; + TSet<Char> ret; for (auto&& i : m_transitions[state]) ret.insert(i.first); return ret; @@ -291,7 +291,7 @@ Fsm& Fsm::Append(char c) determined = false; return *this; } - + Fsm& Fsm::Append(const ystring& str) { for (auto&& i : str) @@ -309,7 +309,7 @@ Fsm& Fsm::AppendSpecial(Char c) return *this; } -Fsm& Fsm::AppendStrings(const TVector<ystring>& strings) +Fsm& Fsm::AppendStrings(const TVector<ystring>& strings) { for (auto&& i : strings) if (i.empty()) @@ -326,15 +326,15 @@ Fsm& Fsm::AppendStrings(const TVector<ystring>& strings) // state #0 cannot appear in LTRs. Thus we can use this // criteria to test whether a transition has been created or not. typedef ypair<size_t, char> Transition; - TMap<char, size_t> startLtr; - TMap<Transition, size_t> ltr; + TMap<char, size_t> startLtr; + TMap<Transition, size_t> ltr; // A presense of a transition in this set indicates that // a that transition already points somewhere (either to end // or somewhere else). Another attempt to create such transition // will clear `determined flag. - TSet<Transition> usedTransitions; - TSet<char> usedFirsts; + TSet<Transition> usedTransitions; + TSet<char> usedFirsts; for (const auto& str : strings) { if (str.size() > 1) { @@ -398,7 +398,7 @@ void Fsm::Import(const Fsm& rhs) auto dest = m_transitions.begin() + oldsize; for (auto outer = rhs.m_transitions.begin(), outerEnd = rhs.m_transitions.end(); outer != outerEnd; ++outer, ++dest) { for (auto&& inner : *outer) { - TSet<size_t> targets; + TSet<size_t> targets; std::transform(inner.second.begin(), inner.second.end(), std::inserter(targets, targets.begin()), std::bind2nd(std::plus<size_t>(), oldsize)); dest->insert(ymake_pair(inner.first, targets)); @@ -504,7 +504,7 @@ Fsm& Fsm::operator |= (const Fsm& rhs) Import(rhs); for (auto&& final : rhs.m_final) m_final.insert(final + lhsSize); - + if (!isAlternative && !rhs.isAlternative) { Resize(Size() + 1); Connect(Size() - 1, initial); @@ -598,40 +598,40 @@ void Fsm::MakeSuffix() Connect(initial, i); ClearHints(); } - + Fsm& Fsm::Reverse() -{ +{ Fsm out; out.Resize(Size() + 1); out.letters = Letters(); - + // Invert transitions for (size_t from = 0; from < Size(); ++from) for (auto&& i : m_transitions[from]) for (auto&& j : i.second) out.Connect(j, from, i.first); - + // Invert initial and final states out.m_final.clear(); out.SetFinal(initial, true); for (auto i : m_final) out.Connect(Size(), i, Epsilon); out.SetInitial(Size()); - + // Invert outputs for (auto&& i : outputs) for (auto&& j : i.second) out.SetOutput(j.first, i.first, j.second); - + // Preserve tags (although thier semantics are usually heavily broken at this point) out.tags = tags; - + // Apply Swap(out); return *this; } -TSet<size_t> Fsm::DeadStates() const +TSet<size_t> Fsm::DeadStates() const { TSet<size_t> res; @@ -697,7 +697,7 @@ void Fsm::RemoveDeadEnds() { PIRE_IFDEBUG(Cdbg << "Removing dead ends on:" << Endl << *this << Endl); - TSet<size_t> dead = DeadStates(); + TSet<size_t> dead = DeadStates(); // Erase all useless states for (auto&& i : dead) { PIRE_IFDEBUG(Cdbg << "Removing useless state " << i << Endl); @@ -726,7 +726,7 @@ void Fsm::MergeEpsilonConnection(size_t from, size_t to) // Merge transitions from 'to' state into transitions from 'from' state for (auto&& transition : m_transitions[to]) { - TSet<size_t> connStates; + TSet<size_t> connStates; std::copy(transition.second.begin(), transition.second.end(), std::inserter(m_transitions[from][transition.first], m_transitions[from][transition.first].end())); @@ -766,7 +766,7 @@ void Fsm::MergeEpsilonConnection(size_t from, size_t to) // finds all states which are Epsilon-reachable from 'thru' and connects // them directly to 'from' with Epsilon transition having proper output. // Updates inverse map of epsilon transitions as well. -void Fsm::ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inveps) +void Fsm::ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inveps) { PIRE_IFDEBUG(Cdbg << "In Fsm::ShortCutEpsilon(" << from << ", " << thru << ")\n"); const StatesSet& to = Destinations(thru, Epsilon); @@ -778,7 +778,7 @@ void Fsm::ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inv inveps[toElement].insert(from); if (outIt != outputs.end()) outIt->second[toElement] |= (fromThruOut | Output(thru, toElement)); - } + } } // Removes all Epsilon-connections by iterating though states and merging each Epsilon-connection @@ -786,15 +786,15 @@ void Fsm::ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inv void Fsm::RemoveEpsilons() { Unsparse(); - + // Build inverse map of epsilon transitions - TVector< TSet<size_t> > inveps(Size()); // We have to use TSet<> here since we want it sorted + TVector< TSet<size_t> > inveps(Size()); // We have to use TSet<> here since we want it sorted for (size_t from = 0; from != Size(); ++from) { const StatesSet& tos = Destinations(from, Epsilon); for (auto&& to : tos) inveps[to].insert(from); } - + // Make a transitive closure of all epsilon transitions (Floyd-Warshall algorithm) // (if there exists an epsilon-path between two states, epsilon-connect them directly) for (size_t thru = 0; thru != Size(); ++thru) @@ -802,9 +802,9 @@ void Fsm::RemoveEpsilons() // inveps[thru] may alter during loop body, hence we cannot cache ivneps[thru].end() if (from != thru) ShortCutEpsilon(from, thru, inveps); - + PIRE_IFDEBUG(Cdbg << "=== After epsilons shortcut\n" << *this << Endl); - + // Iterate through all epsilon-connected state pairs, merging states together for (size_t from = 0; from != Size(); ++from) { const StatesSet& to = Destinations(from, Epsilon); @@ -812,13 +812,13 @@ void Fsm::RemoveEpsilons() if (toElement != from) MergeEpsilonConnection(from, toElement); // it's a NOP if to == from, so don't waste time } - + PIRE_IFDEBUG(Cdbg << "=== After epsilons merged\n" << *this << Endl); - + // Drop all epsilon transitions for (auto&& i : m_transitions) i.erase(Epsilon); - + Sparse(); ClearHints(); } @@ -859,9 +859,9 @@ void Fsm::Unsparse() // Returns a set of 'terminal states', which are those of the final states, // from which a transition to themselves on any letter is possible. -TSet<size_t> Fsm::TerminalStates() const +TSet<size_t> Fsm::TerminalStates() const { - TSet<size_t> terminals; + TSet<size_t> terminals; for (auto&& final : m_final) { bool ok = true; for (auto&& letter : letters) { @@ -877,10 +877,10 @@ TSet<size_t> Fsm::TerminalStates() const namespace Impl { class FsmDetermineTask { public: - typedef TVector<size_t> State; + typedef TVector<size_t> State; typedef Fsm::LettersTbl LettersTbl; - typedef TMap<State, size_t> InvStates; - + typedef TMap<State, size_t> InvStates; + FsmDetermineTask(const Fsm& fsm) : mFsm(fsm) , mTerminals(fsm.TerminalStates()) @@ -888,7 +888,7 @@ public: PIRE_IFDEBUG(Cdbg << "Terminal states: [" << Join(mTerminals.begin(), mTerminals.end(), ", ") << "]" << Endl); } const LettersTbl& Letters() const { return mFsm.letters; } - + State Initial() const { return State(1, mFsm.initial); } bool IsRequired(const State& state) const { @@ -897,7 +897,7 @@ public: return false; return true; } - + State Next(const State& state, Char letter) const { State next; @@ -913,8 +913,8 @@ public: << "--> [" << Join(next.begin(), next.end(), ", ") << "]" << Endl); return next; } - - void AcceptStates(const TVector<State>& states) + + void AcceptStates(const TVector<State>& states) { mNewFsm.Resize(states.size()); mNewFsm.initial = 0; @@ -924,7 +924,7 @@ public: for (size_t ns = 0; ns < states.size(); ++ns) { PIRE_IFDEBUG(Cdbg << "State " << ns << " = [" << Join(states[ns].begin(), states[ns].end(), ", ") << "]" << Endl); for (auto&& j : states[ns]) { - + // If it was a terminal state, connect it to itself if (mTerminals.find(j) != mTerminals.end()) { for (auto&& letter : Letters()) @@ -943,7 +943,7 @@ public: // hence weve done with this state and got nothing more to do. break; } - + // Bitwise OR all tags in states auto ti = mFsm.tags.find(j); if (ti != mFsm.tags.end()) { @@ -953,12 +953,12 @@ public: } } // For each old state, prepare a list of new state it is contained in - typedef TMap< size_t, TVector<size_t> > Old2New; + typedef TMap< size_t, TVector<size_t> > Old2New; Old2New old2new; for (size_t ns = 0; ns < states.size(); ++ns) for (auto&& j : states[ns]) old2new[j].push_back(ns); - + // Copy all outputs for (auto&& i : mFsm.outputs) { for (auto&& j : i.second) { @@ -973,7 +973,7 @@ public: } PIRE_IFDEBUG(Cdbg << "New terminals = [" << Join(mNewTerminals.begin(), mNewTerminals.end(), ",") << "]" << Endl); } - + void Connect(size_t from, size_t to, Char letter) { PIRE_IFDEBUG(Cdbg << "Connecting " << from << " --" << letter << "--> " << to << Endl); @@ -1004,13 +1004,13 @@ public: } Result Failure() { return false; } - + Fsm& Output() { return mNewFsm; } private: const Fsm& mFsm; Fsm mNewFsm; - TSet<size_t> mTerminals; - TSet<size_t> mNewTerminals; + TSet<size_t> mTerminals; + TSet<size_t> mNewTerminals; }; } @@ -1021,10 +1021,10 @@ bool Fsm::Determine(size_t maxsize /* = 0 */) return true; PIRE_IFDEBUG(Cdbg << "=== Initial ===" << Endl << *this << Endl); - + RemoveEpsilons(); PIRE_IFDEBUG(Cdbg << "=== After all epsilons removed" << Endl << *this << Endl); - + Impl::FsmDetermineTask task(*this); if (Pire::Impl::Determine(task, maxsize ? maxsize : MaxSize)) { task.Output().Swap(*this); @@ -1162,7 +1162,7 @@ void Fsm::Minimize() Fsm& Fsm::Canonize(size_t maxSize /* = 0 */) { if (!IsDetermined()) { - if (!Determine(maxSize)) + if (!Determine(maxSize)) throw Error("regexp pattern too complicated"); } Minimize(); @@ -1175,7 +1175,7 @@ void Fsm::PrependAnything() Resize(Size() + 1); for (size_t letter = 0; letter < MaxChar; ++letter) Connect(newstate, newstate, letter); - + Connect(newstate, initial); initial = newstate; @@ -1188,7 +1188,7 @@ void Fsm::AppendAnything() Resize(Size() + 1); for (size_t letter = 0; letter < MaxChar; ++letter) Connect(newstate, newstate, letter); - + ConnectFinal(newstate); ClearFinal(); SetFinal(newstate, 1); diff --git a/contrib/libs/pire/pire/fsm.h b/contrib/libs/pire/pire/fsm.h index 4dad06ca06..dd1784377d 100644 --- a/contrib/libs/pire/pire/fsm.h +++ b/contrib/libs/pire/pire/fsm.h @@ -60,7 +60,7 @@ namespace Pire { /// and case-insensitive comparison of multibyte characters, /// when one string represents a lowercase variant of a character, /// while another string represents its uppercase variant. - Fsm& AppendStrings(const TVector<ystring>& strings); + Fsm& AppendStrings(const TVector<ystring>& strings); /// Appends a part matching a single byte (any). Fsm& AppendDot(); @@ -108,7 +108,7 @@ namespace Pire { Fsm& Reverse(); /// Returns a set of states from which no final states are reachable - TSet<size_t> DeadStates() const; + TSet<size_t> DeadStates() const; /// Removes all dead end paths from FSM void RemoveDeadEnds(); @@ -122,9 +122,9 @@ namespace Pire { void DumpState(yostream& s, size_t state) const; void DumpTo(yostream& s, const ystring& name = "") const; - typedef TSet<size_t> StatesSet; - typedef TMap<size_t, StatesSet> TransitionRow; - typedef TVector<TransitionRow> TransitionTable; + typedef TSet<size_t> StatesSet; + typedef TMap<size_t, StatesSet> TransitionRow; + typedef TVector<TransitionRow> TransitionTable; struct LettersEquality { LettersEquality(const Fsm::TransitionTable& tbl): m_tbl(&tbl) {} @@ -133,7 +133,7 @@ namespace Pire { const Fsm::TransitionTable* m_tbl; }; - typedef TSet<size_t> FinalTable; + typedef TSet<size_t> FinalTable; typedef Partition<Char, LettersEquality> LettersTbl; @@ -174,7 +174,7 @@ namespace Pire { bool Connected(size_t from, size_t to, Char c) const; /// Returns a set of letters on which a transition from the specified state exists - TSet<Char> OutgoingLetters(size_t state) const; + TSet<Char> OutgoingLetters(size_t state) const; /// Returns a set of states where a transition from the given state using the given letter is possible const StatesSet& Destinations(size_t from, Char letter) const; @@ -226,19 +226,19 @@ namespace Pire { bool determined; /// Output - typedef TMap< size_t, TMap<size_t, unsigned long> > Outputs; + typedef TMap< size_t, TMap<size_t, unsigned long> > Outputs; Outputs outputs; - typedef TMap<size_t, unsigned long> Tags; + typedef TMap<size_t, unsigned long> Tags; Tags tags; /// Heuristics hit: true iff this FSM is a union of two other FSMs bool isAlternative; - void ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inveps); ///< internal + void ShortCutEpsilon(size_t from, size_t thru, TVector< TSet<size_t> >& inveps); ///< internal void MergeEpsilonConnection(size_t from, size_t to); ///< internal - TSet<size_t> TerminalStates() const; + TSet<size_t> TerminalStates() const; Char Translate(Char c) const; @@ -252,7 +252,7 @@ namespace Pire { template<class Scanner> void BuildScanner(const Fsm& fsm, Scanner& r) { - TSet<size_t> dead; + TSet<size_t> dead; if (Scanner::DeadFlag) dead = fsm.DeadStates(); diff --git a/contrib/libs/pire/pire/glue.h b/contrib/libs/pire/pire/glue.h index bac086f2f0..96e8957feb 100644 --- a/contrib/libs/pire/pire/glue.h +++ b/contrib/libs/pire/pire/glue.h @@ -105,7 +105,7 @@ private: } TArrayHolder<value_type> mMap; - TVector<bool> mFilled; + TVector<bool> mFilled; // Noncopyable GluedStateLookupTable(const GluedStateLookupTable&); diff --git a/contrib/libs/pire/pire/inline.l b/contrib/libs/pire/pire/inline.l index a4d2e1a836..ba7eb7a839 100644 --- a/contrib/libs/pire/pire/inline.l +++ b/contrib/libs/pire/pire/inline.l @@ -37,7 +37,7 @@ ystring filename = ""; int line = 1; -TVector<ystring> args; +TVector<ystring> args; #ifdef _WIN32 #if _MCS_VER >= 1600 diff --git a/contrib/libs/pire/pire/partition.h b/contrib/libs/pire/pire/partition.h index 85a9af8863..fd9ae6f1aa 100644 --- a/contrib/libs/pire/pire/partition.h +++ b/contrib/libs/pire/pire/partition.h @@ -37,7 +37,7 @@ namespace Pire { template<class T, class Eq> class Partition { private: - typedef TMap< T, ypair< size_t, TVector<T> > > Set; + typedef TMap< T, ypair< size_t, TVector<T> > > Set; public: Partition(const Eq& eq) @@ -103,7 +103,7 @@ public: } /// Returns the whole equivalence class of @p t (i.e. item @p i /// is returned iff representative(i) == representative(t)). - const TVector<T>& Klass(const T& t) const + const TVector<T>& Klass(const T& t) const { auto it = m_inv.find(t); if (it == m_inv.end()) @@ -143,7 +143,7 @@ public: private: Eq m_eq; Set m_set; - TMap<T, T> m_inv; + TMap<T, T> m_inv; size_t m_maxidx; void DoAppend(Set& set, const T& t) @@ -159,7 +159,7 @@ private: if (it == end) { // Begin new set - TVector<T> v(1, t); + TVector<T> v(1, t); set.insert(ymake_pair(t, ymake_pair(m_maxidx++, v))); m_inv[t] = t; } diff --git a/contrib/libs/pire/pire/re_lexer.h b/contrib/libs/pire/pire/re_lexer.h index 5591c16d34..6873f89cda 100644 --- a/contrib/libs/pire/pire/re_lexer.h +++ b/contrib/libs/pire/pire/re_lexer.h @@ -74,8 +74,8 @@ enum { */ class Term { public: - typedef TVector<wchar32> String; - typedef TSet<String> Strings; + typedef TVector<wchar32> String; + typedef TSet<String> Strings; typedef ypair<int, int> RepetitionCount; typedef ypair<Strings, bool> CharacterRange; @@ -170,7 +170,7 @@ private: void InstallDefaultFeatures(); - TDeque<wchar32> m_input; + TDeque<wchar32> m_input; const Pire::Encoding* m_encoding; TVector<THolder<Feature>> m_features; Any m_retval; diff --git a/contrib/libs/pire/pire/re_parser.y b/contrib/libs/pire/pire/re_parser.y index dbad88e287..94c8fa7bdc 100644 --- a/contrib/libs/pire/pire/re_parser.y +++ b/contrib/libs/pire/pire/re_parser.y @@ -178,7 +178,7 @@ void yyerror(Pire::Lexer& rlex, const char* str) void AppendRange(const Encoding& encoding, Fsm& a, const Term::CharacterRange& cr) { - TVector<ystring> strings; + TVector<ystring> strings; for (auto&& i : cr.first) { ystring s; diff --git a/contrib/libs/pire/pire/scanner_io.cpp b/contrib/libs/pire/pire/scanner_io.cpp index 3956e3c6ed..aea6d387c7 100644 --- a/contrib/libs/pire/pire/scanner_io.cpp +++ b/contrib/libs/pire/pire/scanner_io.cpp @@ -206,7 +206,7 @@ void LoadedScanner::Load(yistream* s, ui32* type) Impl::AlignedLoadArray(s, sc.m_letters, MaxChar); Impl::AlignedLoadArray(s, sc.m_jumps, sc.m.statesCount * sc.m.lettersCount); if (header.Version == Header::RE_VERSION_WITH_MACTIONS) { - TVector<Action> actions(sc.m.statesCount * sc.m.lettersCount); + TVector<Action> actions(sc.m.statesCount * sc.m.lettersCount); Impl::AlignedLoadArray(s, actions.data(), actions.size()); } Impl::AlignedLoadArray(s, sc.m_tags, sc.m.statesCount); diff --git a/contrib/libs/pire/pire/scanners/multi.h b/contrib/libs/pire/pire/scanners/multi.h index 29679e416e..b3e8a72a67 100644 --- a/contrib/libs/pire/pire/scanners/multi.h +++ b/contrib/libs/pire/pire/scanners/multi.h @@ -402,7 +402,7 @@ protected: Y_ASSERT(m_buffer == nullptr); // Ensure that specializations of Scanner across different Relocations do not touch its Locals - static_assert(sizeof(m) == sizeof(s.m), "sizeof(m) == sizeof(s.m)"); + static_assert(sizeof(m) == sizeof(s.m), "sizeof(m) == sizeof(s.m)"); memcpy(&m, &s.m, sizeof(s.m)); m.relocationSignature = Relocation::Signature; m.shortcuttingSignature = Shortcutting::Signature; @@ -475,7 +475,7 @@ protected: Y_ASSERT(m_buffer); // Build the mapping from letter classes to characters - TVector< TVector<char> > letters(RowSize()); + TVector< TVector<char> > letters(RowSize()); for (unsigned ch = 0; ch != 1 << (sizeof(char)*8); ++ch) letters[m_letters[ch]].push_back(ch); @@ -1012,7 +1012,7 @@ public: { } - void AcceptStates(const TVector<State>& states) + void AcceptStates(const TVector<State>& states) { // Make up a new scanner and fill in the final table diff --git a/contrib/libs/pire/pire/scanners/slow.h b/contrib/libs/pire/pire/scanners/slow.h index 6adfcb8c1d..068779644d 100644 --- a/contrib/libs/pire/pire/scanners/slow.h +++ b/contrib/libs/pire/pire/scanners/slow.h @@ -62,7 +62,7 @@ public: }; struct State { - TVector<unsigned> states; + TVector<unsigned> states; BitSet flags; State() {} @@ -352,8 +352,8 @@ private: size_t* m_jumpPos; size_t* m_letters; - TVector<void*> m_pool; - TVector< TVector<unsigned> > m_vec, *m_vecptr; + TVector<void*> m_pool; + TVector< TVector<unsigned> > m_vec, *m_vecptr; bool need_actions; TVector<TVector<Action>> m_actionsvec; diff --git a/contrib/libs/pire/pire/stub/stl.h b/contrib/libs/pire/pire/stub/stl.h index 98ebd9f7c6..af708d9403 100644 --- a/contrib/libs/pire/pire/stub/stl.h +++ b/contrib/libs/pire/pire/stub/stl.h @@ -8,7 +8,7 @@ #include <utility> #include <memory> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/vector.h> #include <util/generic/deque.h> #include <util/generic/list.h> @@ -26,7 +26,7 @@ #include <util/string/vector.h> namespace Pire { - using ystring = TString; + using ystring = TString; template<size_t N> using ybitset = std::bitset<N>; template<typename T1, typename T2> using ypair = std::pair<T1, T2>; template<typename T> using yauto_ptr = std::auto_ptr<T>; @@ -60,7 +60,7 @@ namespace Pire { typedef IInputStream yistream; template<class Iter> - ystring Join(Iter begin, Iter end, const ystring& separator) { return JoinStrings(begin, end, separator); } + ystring Join(Iter begin, Iter end, const ystring& separator) { return JoinStrings(begin, end, separator); } } #endif diff --git a/contrib/libs/pire/pire/vbitset.h b/contrib/libs/pire/pire/vbitset.h index 69cb5aeba3..7d16976fa1 100644 --- a/contrib/libs/pire/pire/vbitset.h +++ b/contrib/libs/pire/pire/vbitset.h @@ -97,7 +97,7 @@ public: private: typedef unsigned char ContainerType; static const size_t ItemSize = sizeof(ContainerType) * 8; - TVector<ContainerType> m_data; + TVector<ContainerType> m_data; size_t m_size; static size_t RoundUp(size_t x) { return x / ItemSize + ((x % ItemSize) ? 1 : 0); } |