From 00bf0b5385f14702cc00bab25ae0e2bdc2fa0f49 Mon Sep 17 00:00:00 2001 From: Tianyi Liang Date: Wed, 26 Feb 2014 11:43:59 -0600 Subject: [PATCH] add a new file --- src/util/regexp.cpp | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/util/regexp.cpp 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 -- 2.30.2