summaryrefslogtreecommitdiff
path: root/src/expr/command.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-06-07 16:16:48 +0000
committerMorgan Deters <mdeters@gmail.com>2012-06-07 16:16:48 +0000
commit0a7dc7687a4989641d8c101ba3b2d4737eaea24f (patch)
treee802b4522419f9480ba04c2c5f2e2d9b1f88426e /src/expr/command.cpp
parentb3d6d0ccc76e92304fe612b23dc76a7d78061567 (diff)
Adding EchoCommand and associated printer and parser rules:
* SMT-LIBv2 parser now supports (echo...). * Dump() gestures can now dump EchoCommands in CVC and SMT-LIB formats. This can make it much easier to interpret output.
Diffstat (limited to 'src/expr/command.cpp')
-rw-r--r--src/expr/command.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/expr/command.cpp b/src/expr/command.cpp
index 48b6940dd..7dd9df69a 100644
--- a/src/expr/command.cpp
+++ b/src/expr/command.cpp
@@ -139,6 +139,35 @@ Command* EmptyCommand::clone() const {
return new EmptyCommand(d_name);
}
+/* class EchoCommand */
+
+EchoCommand::EchoCommand(std::string output) throw() :
+ d_output(output) {
+}
+
+std::string EchoCommand::getOutput() const throw() {
+ return d_output;
+}
+
+void EchoCommand::invoke(SmtEngine* smtEngine) throw() {
+ /* we don't have an output stream here, nothing to do */
+ d_commandStatus = CommandSuccess::instance();
+}
+
+void EchoCommand::invoke(SmtEngine* smtEngine, std::ostream& out) throw() {
+ out << d_output << std::endl;
+ d_commandStatus = CommandSuccess::instance();
+ printResult(out);
+}
+
+Command* EchoCommand::exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap) {
+ return new EchoCommand(d_output);
+}
+
+Command* EchoCommand::clone() const {
+ return new EchoCommand(d_output);
+}
+
/* class AssertCommand */
AssertCommand::AssertCommand(const BoolExpr& e) throw() :
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback