diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-06-07 16:16:48 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-06-07 16:16:48 +0000 |
commit | 0a7dc7687a4989641d8c101ba3b2d4737eaea24f (patch) | |
tree | e802b4522419f9480ba04c2c5f2e2d9b1f88426e /src/printer/smt2 | |
parent | b3d6d0ccc76e92304fe612b23dc76a7d78061567 (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/printer/smt2')
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 25d3bf35a..a1ee99d8f 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -423,7 +423,8 @@ void Smt2Printer::toStream(std::ostream& out, const Command* c, tryToStream<GetOptionCommand>(out, c) || tryToStream<DatatypeDeclarationCommand>(out, c) || tryToStream<CommentCommand>(out, c) || - tryToStream<EmptyCommand>(out, c)) { + tryToStream<EmptyCommand>(out, c) || + tryToStream<EchoCommand>(out, c)) { return; } @@ -661,6 +662,10 @@ static void toStream(std::ostream& out, const CommentCommand* c) throw() { static void toStream(std::ostream& out, const EmptyCommand* c) throw() { } +static void toStream(std::ostream& out, const EchoCommand* c) throw() { + out << "(echo \"" << c->getOutput() << "\")"; +} + template <class T> static bool tryToStream(std::ostream& out, const Command* c) throw() { if(typeid(*c) == typeid(T)) { |