diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/interactive_shell.cpp | 15 | ||||
-rw-r--r-- | src/main/interactive_shell.h | 19 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 8437d61b2..b2c8b8c1d 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -17,17 +17,32 @@ #include <iostream> #include "interactive_shell.h" + #include "expr/command.h" #include "parser/input.h" #include "parser/parser.h" #include "parser/parser_builder.h" +#include "util/options.h" using namespace std; namespace CVC4 { +using namespace parser; + const string InteractiveShell::INPUT_FILENAME = "<shell>"; +InteractiveShell::InteractiveShell(ExprManager& exprManager, + const Options& options) : + d_in(*options.in), + d_out(*options.out), + d_language(options.inputLanguage) { + ParserBuilder parserBuilder(exprManager,INPUT_FILENAME,options); + /* Create parser with bogus input. */ + d_parser = parserBuilder.withStringInput("").build(); +} + + Command* InteractiveShell::readCommand() { /* Don't do anything if the input is closed. */ if( d_in.eof() ) { diff --git a/src/main/interactive_shell.h b/src/main/interactive_shell.h index a60278eba..faa80fb84 100644 --- a/src/main/interactive_shell.h +++ b/src/main/interactive_shell.h @@ -20,34 +20,29 @@ #include <iostream> #include <string> -#include "parser/parser_builder.h" #include "util/language.h" -#include "util/options.h" namespace CVC4 { class Command; + class ExprManager; + class Options; - using namespace parser; + namespace parser { + class Parser; + } class CVC4_PUBLIC InteractiveShell { std::istream& d_in; std::ostream& d_out; - Parser* d_parser; + parser::Parser* d_parser; const InputLanguage d_language; static const std::string INPUT_FILENAME; public: InteractiveShell(ExprManager& exprManager, - const Options& options) : - d_in(*options.in), - d_out(*options.out), - d_language(options.inputLanguage) { - ParserBuilder parserBuilder(exprManager,INPUT_FILENAME,options); - /* Create parser with bogus input. */ - d_parser = parserBuilder.withStringInput("").build(); - } + const Options& options); /** Read a command from the interactive shell. This will read as many lines as necessary to parse a well-formed command. */ |