Update copyrights.
[cvc5.git] / src / main / interactive_shell.h
1 /********************* */
2 /*! \file interactive_shell.h
3 ** \verbatim
4 ** Original author: Christopher L. Conway
5 ** Major contributors: Morgan Deters
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
11 **
12 ** \brief Interactive shell for CVC4
13 **/
14
15 #ifndef __CVC4__INTERACTIVE_SHELL_H
16 #define __CVC4__INTERACTIVE_SHELL_H
17
18 #include <iostream>
19 #include <string>
20
21 #include "util/language.h"
22 #include "options/options.h"
23
24 namespace CVC4 {
25
26 class Command;
27 class ExprManager;
28 class Options;
29
30 namespace parser {
31 class Parser;
32 }/* CVC4::parser namespace */
33
34 class CVC4_PUBLIC InteractiveShell {
35 std::istream& d_in;
36 std::ostream& d_out;
37 parser::Parser* d_parser;
38 const Options& d_options;
39 bool d_quit;
40 bool d_usingReadline;
41
42 std::string d_historyFilename;
43
44 static const std::string INPUT_FILENAME;
45 static const unsigned s_historyLimit = 500;
46
47 public:
48 InteractiveShell(ExprManager& exprManager, const Options& options);
49
50 /**
51 * Close out the interactive session.
52 */
53 ~InteractiveShell();
54
55 /**
56 * Read a command from the interactive shell. This will read as
57 * many lines as necessary to parse a well-formed command.
58 */
59 Command* readCommand();
60
61 /**
62 * Return the internal parser being used.
63 */
64 parser::Parser* getParser() {
65 return d_parser;
66 }
67
68 };/* class InteractiveShell */
69
70 }/* CVC4 namespace */
71
72 #endif /* __CVC4__INTERACTIVE_SHELL_H */