GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/strings/regexp_enumerator.cpp Lines: 1 15 6.7 %
Date: 2021-11-07 Branches: 2 18 11.1 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Implementation of enumerator for regular expressions.
14
 */
15
16
#include "theory/strings/regexp_enumerator.h"
17
18
namespace cvc5 {
19
namespace theory {
20
namespace strings {
21
22
RegExpEnumerator::RegExpEnumerator(TypeNode type, TypeEnumeratorProperties* tep)
23
    : TypeEnumeratorBase<RegExpEnumerator>(type), d_senum(type, tep)
24
{
25
}
26
27
RegExpEnumerator::RegExpEnumerator(const RegExpEnumerator& enumerator)
28
    : TypeEnumeratorBase<RegExpEnumerator>(enumerator.getType()),
29
      d_senum(enumerator.d_senum)
30
{
31
}
32
33
Node RegExpEnumerator::operator*()
34
{
35
  NodeManager* nm = NodeManager::currentNM();
36
  return nm->mkNode(kind::STRING_TO_REGEXP, *d_senum);
37
}
38
39
RegExpEnumerator& RegExpEnumerator::operator++()
40
{
41
  ++d_senum;
42
  return *this;
43
}
44
45
bool RegExpEnumerator::isFinished() { return d_senum.isFinished(); }
46
47
}  // namespace strings
48
}  // namespace theory
49
31137
}  // namespace cvc5