diff options
author | Cristian Cadar <cristic@cs.stanford.edu> | 2009-06-13 01:13:08 +0000 |
---|---|---|
committer | Cristian Cadar <cristic@cs.stanford.edu> | 2009-06-13 01:13:08 +0000 |
commit | c5f2596a973bc30dcbaf4284f88d2f87b9bc840c (patch) | |
tree | afde34f662f69b6874e6beeed7a1b6a8dd8e14c6 /lib/SMT/SMTParser.cpp | |
parent | e46452c0c0501a7c4b45ab4d7a50b9bc8bf59e46 (diff) | |
download | klee-c5f2596a973bc30dcbaf4284f88d2f87b9bc840c.tar.gz |
Changed SMTParser to return the parsed QueryCommand.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/SMT/SMTParser.cpp')
-rw-r--r-- | lib/SMT/SMTParser.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/SMT/SMTParser.cpp b/lib/SMT/SMTParser.cpp index a66c2bf4..88d0a6c9 100644 --- a/lib/SMT/SMTParser.cpp +++ b/lib/SMT/SMTParser.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <fstream> #include <cstring> +#include <cassert> using namespace std; using namespace klee; @@ -28,26 +29,29 @@ extern void smtlib_setInteractive(bool); SMTParser* SMTParser::parserTemp = NULL; SMTParser::SMTParser(const std::string filename) : fileName(filename), - lineNum(0), + lineNum(1), done(false), - expr(NULL), + query(NULL), bvSize(0), queryParsed(false) { is = new ifstream(filename.c_str()); } void SMTParser::Init() { - cout << "Initializing parser\n"; SMTParser::parserTemp = this; void *buf = smtlib_createBuffer(smtlib_bufSize()); smtlib_switchToBuffer(buf); smtlib_setInteractive(false); smtlibparse(); + cout << "Parsed successfully.\n"; } Decl* SMTParser::ParseTopLevelDecl() { - return NULL; + assert(done); + return new QueryCommand(assumptions, query, + std::vector<ExprHandle>(), + std::vector<const Array*>()); } // XXX: give more info |