diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/driver_unified.cpp | 24 | ||||
-rw-r--r-- | src/main/interactive_shell.cpp | 4 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/main/driver_unified.cpp b/src/main/driver_unified.cpp index f27bf03f0..a26ee3b73 100644 --- a/src/main/driver_unified.cpp +++ b/src/main/driver_unified.cpp @@ -259,16 +259,20 @@ int runCvc5(int argc, char* argv[], Options& opts) ParserBuilder parserBuilder(pExecutor->getSolver(), pExecutor->getSymbolManager(), - filename, opts); - + std::unique_ptr<Parser> parser(parserBuilder.build()); if( inputFromStdin ) { - parserBuilder.withStreamInput(cin); + parser->setInput( + Input::newStreamInput(opts.getInputLanguage(), cin, filename)); + } + else + { + parser->setInput(Input::newFileInput( + opts.getInputLanguage(), filename, opts.getMemoryMap())); } vector< vector<Command*> > allCommands; allCommands.push_back(vector<Command*>()); - std::unique_ptr<Parser> parser(parserBuilder.build()); int needReset = 0; // true if one of the commands was interrupted bool interrupted = false; @@ -411,14 +415,18 @@ int runCvc5(int argc, char* argv[], Options& opts) ParserBuilder parserBuilder(pExecutor->getSolver(), pExecutor->getSymbolManager(), - filename, opts); - + std::unique_ptr<Parser> parser(parserBuilder.build()); if( inputFromStdin ) { - parserBuilder.withStreamInput(cin); + parser->setInput( + Input::newStreamInput(opts.getInputLanguage(), cin, filename)); + } + else + { + parser->setInput(Input::newFileInput( + opts.getInputLanguage(), filename, opts.getMemoryMap())); } - std::unique_ptr<Parser> parser(parserBuilder.build()); bool interrupted = false; while (status) { diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 516f9e621..8ca10799f 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -91,9 +91,9 @@ InteractiveShell::InteractiveShell(api::Solver* solver, SymbolManager* sm) d_out(*d_options.getOutConst()), d_quit(false) { - ParserBuilder parserBuilder(solver, sm, INPUT_FILENAME, d_options); + ParserBuilder parserBuilder(solver, sm, d_options); /* Create parser with bogus input. */ - d_parser = parserBuilder.withStringInput("").build(); + d_parser = parserBuilder.build(); if(d_options.wasSetByUserForceLogicString()) { LogicInfo tmp(d_options.getForceLogicString()); d_parser->forceLogic(tmp.getLogicString()); |