summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp23
1 files changed, 23 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 */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback