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