From: Tianyi Liang Date: Wed, 26 Feb 2014 17:43:59 +0000 (-0600) Subject: add a new file X-Git-Tag: cvc5-1.0.0~7061 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00bf0b5385f14702cc00bab25ae0e2bdc2fa0f49;p=cvc5.git add a new file --- diff --git a/src/util/regexp.cpp b/src/util/regexp.cpp new file mode 100644 index 000000000..246f16243 --- /dev/null +++ b/src/util/regexp.cpp @@ -0,0 +1,70 @@ +/********************* */ +/*! \file regexp.cpp + ** \verbatim + ** Original author: Tianyi Liang + ** Major contributors: none + ** Minor contributors (to current version): Morgan Deters + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2013 New York University and The University of Iowa + ** See the file COPYING in the top-level source directory for licensing + ** information.\endverbatim + ** + ** \brief [[ Add one-line brief description here ]] + ** + ** [[ Add lengthier description here ]] + ** \todo document this file + **/ + +#include "util/regexp.h" +#include + +using namespace std; + +namespace CVC4 { + +std::string String::toString() const { + std::string str; + for(unsigned int i=0; i( &(std::ostringstream() << (int)c) )->str(); + if(s2.size() == 1) { + s2 = "0" + s2; + } + s = "\\x" + s2; + } + } + str += s; + } + } + return str; +} + +std::ostream& operator <<(std::ostream& os, const String& s) { + return os << "\"" << s.toString() << "\""; +} + +std::ostream& operator<<(std::ostream& out, const RegExp& s) { + return out << "regexp(" << s.getType() << ')'; +} + +}/* CVC4 namespace */ \ No newline at end of file