Skip to content

Commit

Permalink
Make SlowCapturingScanner interface a bit more similar to CapturingSc…
Browse files Browse the repository at this point in the history
…anner (#57)

* Make GetSize() method public
* Add Begin() and End() methods
  • Loading branch information
gotthit authored and sergey-v-galtsev committed Feb 12, 2019
1 parent e1d1fc8 commit b1f97dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 10 additions & 0 deletions pire/extra/capture.h
Expand Up @@ -213,6 +213,16 @@ class SlowCapturingScanner : public SlowScanner {
m_end = pos;
}

size_t Begin() const
{
return GetBegin();
}

size_t End() const
{
return GetEnd();
}

size_t GetBegin() const
{
return m_begin;
Expand Down
7 changes: 2 additions & 5 deletions pire/scanners/slow.h
Expand Up @@ -79,6 +79,8 @@ class SlowScanner {

size_t GetLettersCount() const {return m.lettersCount; };

size_t Size() const { GetSize(); }
size_t GetSize() const { return m.statesCount; }
bool Empty() const { return m_finals == Null().m_finals; }

size_t Id() const {return (size_t) -1;}
Expand Down Expand Up @@ -291,11 +293,6 @@ class SlowScanner {
const State& StateIndex(const State& s) const { return s; }

protected:
size_t GetSize() const
{
return m.statesCount;
}

bool IsMmaped() const
{
return (!m_vecptr);
Expand Down

0 comments on commit b1f97dc

Please sign in to comment.