summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-10-09 10:10:47 +0000
committerMorgan Deters <mdeters@gmail.com>2010-10-09 10:10:47 +0000
commit7a059452ebf5729723f610da9258a47007e38253 (patch)
tree2bbab5fe2aed85984a492d1706348ae3aaa7a68a /src/parser
parent0131e18b811bdf2825a1cde5a6d68d523b19aacc (diff)
reverting some changes to parser from last commit
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/parser.cpp23
-rw-r--r--src/parser/parser.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 09e65526d..90e13022c 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -326,6 +326,29 @@ Command* Parser::nextCommand() throw(ParserException) {
return cmd;
}
+Expr Parser::nextExpression() throw(ParserException) {
+ Debug("parser") << "nextExpression()" << std::endl;
+ Expr result;
+ if(!done()) {
+ try {
+ result = d_input->parseExpr();
+ if(result.isNull()) {
+ setDone();
+ }
+ } catch(ParserException& e) {
+ setDone();
+ throw;
+ } catch(Exception& e) {
+ setDone();
+ stringstream ss;
+ ss << e;
+ parseError( ss.str() );
+ }
+ }
+ Debug("parser") << "nextExpression() => " << result << std::endl;
+ return result;
+}
+
}/* CVC4::parser namespace */
}/* CVC4 namespace */
diff --git a/src/parser/parser.h b/src/parser/parser.h
index bc0142089..4d1e64176 100644
--- a/src/parser/parser.h
+++ b/src/parser/parser.h
@@ -350,6 +350,7 @@ public:
bool isPredicate(const std::string& name);
Command* nextCommand() throw(ParserException);
+ Expr nextExpression() throw(ParserException);
inline void parseError(const std::string& msg) throw (ParserException) {
d_input->parseError(msg);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback