diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-07 05:51:09 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-07 05:51:09 +0000 |
commit | b3bcafc179201e33c4f41ccf028c12eacc110d69 (patch) | |
tree | 6b35f7e654ac3b2278b9201db331fab980b32cd9 /src/util | |
parent | c16be5841e613818d5764e4de99e4694a0703685 (diff) |
antlr parser for the cvc4 language (boolean only)
yet to be finalized, it should work as expected
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/assert.h | 18 | ||||
-rw-r--r-- | src/util/command.cpp | 5 | ||||
-rw-r--r-- | src/util/command.h | 4 |
3 files changed, 15 insertions, 12 deletions
diff --git a/src/util/assert.h b/src/util/assert.h index 4a164716c..8fd970c6c 100644 --- a/src/util/assert.h +++ b/src/util/assert.h @@ -57,17 +57,17 @@ public: inline void AssertImpl(const char* info, bool cond, std::string msg) { if(EXPECT_FALSE( ! cond )) - throw new AssertionException(std::string(info) + "\n" + msg); + throw AssertionException(std::string(info) + "\n" + msg); } inline void AssertImpl(const char* info, bool cond, const char* msg) { if(EXPECT_FALSE( ! cond )) - throw new AssertionException(std::string(info) + "\n" + msg); + throw AssertionException(std::string(info) + "\n" + msg); } inline void AssertImpl(const char* info, bool cond) { if(EXPECT_FALSE( ! cond )) - throw new AssertionException(info); + throw AssertionException(info); } #ifdef __GNUC__ @@ -77,15 +77,15 @@ inline void UnreachableImpl(const char* info) __attribute__ ((noreturn)); #endif /* __GNUC__ */ inline void UnreachableImpl(const char* info, std::string msg) { - throw new UnreachableCodeException(std::string(info) + "\n" + msg); + throw UnreachableCodeException(std::string(info) + "\n" + msg); } inline void UnreachableImpl(const char* info, const char* msg) { - throw new UnreachableCodeException(std::string(info) + "\n" + msg); + throw UnreachableCodeException(std::string(info) + "\n" + msg); } inline void UnreachableImpl(const char* info) { - throw new UnreachableCodeException(info); + throw UnreachableCodeException(info); } #ifdef __GNUC__ @@ -95,15 +95,15 @@ inline void UnhandledImpl(const char* info) __attribute__ ((noreturn)); #endif /* __GNUC__ */ inline void UnhandledImpl(const char* info, std::string msg) { - throw new UnhandledCaseException(std::string(info) + "\n" + msg); + throw UnhandledCaseException(std::string(info) + "\n" + msg); } inline void UnhandledImpl(const char* info, const char* msg) { - throw new UnhandledCaseException(std::string(info) + "\n" + msg); + throw UnhandledCaseException(std::string(info) + "\n" + msg); } inline void UnhandledImpl(const char* info) { - throw new UnhandledCaseException(info); + throw UnhandledCaseException(info); } }/* CVC4 namespace */ diff --git a/src/util/command.cpp b/src/util/command.cpp index e38695b46..961104585 100644 --- a/src/util/command.cpp +++ b/src/util/command.cpp @@ -19,7 +19,8 @@ ostream& operator<<(ostream& out, const CVC4::Command& c) { namespace CVC4 { -EmptyCommand::EmptyCommand() { +EmptyCommand::EmptyCommand(std::string name) : + d_name(name) { } void EmptyCommand::invoke(SmtEngine* smt_engine) { @@ -77,7 +78,7 @@ void CommandSequence::addCommand(Command* cmd) { using namespace std; void EmptyCommand::toString(ostream& out) const { - out << "EmptyCommand"; + out << "EmptyCommand(" << d_name << ")"; } void AssertCommand::toString(ostream& out) const { diff --git a/src/util/command.h b/src/util/command.h index ce137896a..3d738ba45 100644 --- a/src/util/command.h +++ b/src/util/command.h @@ -38,9 +38,11 @@ public: class CVC4_PUBLIC EmptyCommand : public Command { public: - EmptyCommand(); + EmptyCommand(std::string name = ""); void invoke(CVC4::SmtEngine* smt_engine); void toString(std::ostream& out) const; +private: + std::string d_name; };/* class EmptyCommand */ |