diff options
Diffstat (limited to 'src/main/interactive_shell.cpp')
-rw-r--r-- | src/main/interactive_shell.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 3d37ade43..587c07495 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -18,6 +18,7 @@ #include "interactive_shell.h" #include "expr/command.h" +#include "parser/input.h" #include "parser/parser.h" #include "parser/parser_builder.h" @@ -25,6 +26,8 @@ using namespace std; namespace CVC4 { +const string InteractiveShell::INPUT_FILENAME = "<shell>"; + Command* InteractiveShell::readCommand() { /* Don't do anything if the input is closed. */ if( d_in.eof() ) { @@ -90,23 +93,26 @@ Command* InteractiveShell::readCommand() { } } - Parser *parser = - d_parserBuilder - .withStringInput(input) - .withStateFrom(d_lastParser) - .build(); + d_parser->setInput(Input::newStringInput(d_language,input,INPUT_FILENAME)); + // Parser *parser = + // d_parserBuilder + // .withStringInput(input) + // .withStateFrom(d_lastParser) + // .build(); /* There may be more than one command in the input. Build up a sequence. */ CommandSequence *cmd_seq = new CommandSequence(); Command *cmd; - while( (cmd = parser->nextCommand()) ) { + while( (cmd = d_parser->nextCommand()) ) { cmd_seq->addCommand(cmd); } - delete d_lastParser; - d_lastParser = parser; + // if( d_lastParser ) { + // delete d_lastParser; + // } + // d_lastParser = parser; return cmd_seq; } |