diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-10-23 17:21:09 -0700 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2018-10-23 23:50:37 -0700 |
commit | 36fb4dcec8fb09a48da59261eda0582da68348cd (patch) | |
tree | 4d32beff03bbd0764dd048feadeab36415c1a7c2 /src/parser/smt2/Smt2.g | |
parent | c5982fa8fa60f25b01efcf45cf73bca353226d84 (diff) |
Sketch of refactoring the Commands to use new APInewApiForCommands
This commit is a sketch of how we can transform `Command`s to use the
new API and transform the parser bit-by-bit. The overall idea is that
`Command::invoke()` now takes an `Solver*` as an argument instead of an
`SmtEngine*`. The default implementation `Command::invoke()` just calls
the old implementation. As an example, the PR transforms the
`GetValueCommand`.
Diffstat (limited to 'src/parser/smt2/Smt2.g')
-rw-r--r-- | src/parser/smt2/Smt2.g | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index d9b0f622b..77de8d0c2 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -112,6 +112,7 @@ namespace CVC4 { #include <unordered_set> #include <vector> +#include "api/cvc4cpp.h" #include "base/output.h" #include "expr/expr.h" #include "expr/kind.h" @@ -403,7 +404,9 @@ command [std::unique_ptr<CVC4::Command>* cmd] | /* value query */ GET_VALUE_TOK { PARSER_STATE->checkThatLogicIsSet(); } ( LPAREN_TOK termList[terms,expr] RPAREN_TOK - { cmd->reset(new GetValueCommand(terms)); } + { + cmd->reset(new GetValueCommand(api::Solver::exprVectorToTerms(terms))); + } | ~LPAREN_TOK { PARSER_STATE->parseError("The get-value command expects a list of " "terms. Perhaps you forgot a pair of " |