diff options
author | Cristian Cadar <cristic@cs.stanford.edu> | 2009-06-12 02:38:27 +0000 |
---|---|---|
committer | Cristian Cadar <cristic@cs.stanford.edu> | 2009-06-12 02:38:27 +0000 |
commit | e46452c0c0501a7c4b45ab4d7a50b9bc8bf59e46 (patch) | |
tree | fbcc67f3bdb1b6eef9e6efa19f1bd265147aea14 /lib/SMT/SMTParser.cpp | |
parent | 1c7da6d62afa3b5b8e83fc8c1cb7301cba70fa16 (diff) | |
download | klee-e46452c0c0501a7c4b45ab4d7a50b9bc8bf59e46.tar.gz |
Removed parser_temp.h. Adapted the code to use SMTParser directly.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73215 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/SMT/SMTParser.cpp')
-rw-r--r-- | lib/SMT/SMTParser.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/SMT/SMTParser.cpp b/lib/SMT/SMTParser.cpp index b87bbdbc..a66c2bf4 100644 --- a/lib/SMT/SMTParser.cpp +++ b/lib/SMT/SMTParser.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -#include "parser_temp.h" #include "SMTParser.h" #include "expr/Parser.h" @@ -26,19 +25,22 @@ extern void smtlib_switchToBuffer(void *); extern int smtlib_bufSize(void); extern void smtlib_setInteractive(bool); -namespace CVC3 { - ParserTemp* parserTemp; +SMTParser* SMTParser::parserTemp = NULL; + +SMTParser::SMTParser(const std::string filename) : fileName(filename), + lineNum(0), + done(false), + expr(NULL), + bvSize(0), + queryParsed(false) { + is = new ifstream(filename.c_str()); } void SMTParser::Init() { cout << "Initializing parser\n"; - void *buf = smtlib_createBuffer(smtlib_bufSize()); + SMTParser::parserTemp = this; - CVC3::parserTemp = new CVC3::ParserTemp(); - CVC3::parserTemp->fileName = fname; - CVC3::parserTemp->is = new ifstream(fname.c_str()); - CVC3::parserTemp->interactive = false; - + void *buf = smtlib_createBuffer(smtlib_bufSize()); smtlib_switchToBuffer(buf); smtlib_setInteractive(false); smtlibparse(); @@ -47,3 +49,10 @@ void SMTParser::Init() { Decl* SMTParser::ParseTopLevelDecl() { return NULL; } + +// XXX: give more info +int SMTParser::Error(const string& s) { + std::cerr << "error: " << s << "\n"; + exit(1); + return 0; +} |