From 0a3ecb598dac9e5e7416f88403dbf73d558c8739 Mon Sep 17 00:00:00 2001 From: "Christopher L. Conway" Date: Sat, 23 Oct 2010 14:49:06 +0000 Subject: Adding Parser::setInput and using it in InteractiveShell (Fixes: #225) Removing ParserBuilder::withStateFrom --- src/main/main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main/main.cpp') diff --git a/src/main/main.cpp b/src/main/main.cpp index 8bca6190e..7943da0e7 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -229,22 +229,23 @@ int runCvc4(int argc, char* argv[]) { Warning.getStream() << Expr::setlanguage(language); } - ParserBuilder parserBuilder = - ParserBuilder(exprMgr, filename, options); - - if( inputFromStdin ) { - parserBuilder.withStreamInput(cin); - } // Parse and execute commands until we are done Command* cmd; if( options.interactive ) { - InteractiveShell shell(parserBuilder,options); + InteractiveShell shell(exprMgr,options); while((cmd = shell.readCommand())) { doCommand(smt,cmd); delete cmd; } } else { + ParserBuilder parserBuilder = + ParserBuilder(exprMgr, filename, options); + + if( inputFromStdin ) { + parserBuilder.withStreamInput(cin); + } + Parser *parser = parserBuilder.build(); while((cmd = parser->nextCommand())) { doCommand(smt, cmd); -- cgit v1.2.3