Rename namespace CVC5 to cvc5. (#6258)
[cvc5.git] / src / main / interactive_shell.h
1 /********************* */
2 /*! \file interactive_shell.h
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Morgan Deters, Christopher L. Conway, Aina Niemetz
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 ** in the top-level source directory and their institutional affiliations.
9 ** All rights reserved. See the file COPYING in the top-level source
10 ** directory for licensing 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 <iosfwd>
19 #include <string>
20
21 #include "options/language.h"
22 #include "options/options.h"
23 #include "util/unsafe_interrupt_exception.h"
24
25 namespace cvc5 {
26
27 class Command;
28 class Options;
29
30 namespace api {
31 class Solver;
32 }
33
34 namespace parser {
35 class Parser;
36 } // namespace parser
37
38 class SymbolManager;
39
40 class InteractiveShell
41 {
42 const Options& d_options;
43 std::istream& d_in;
44 std::ostream& d_out;
45 parser::Parser* d_parser;
46 bool d_quit;
47 bool d_usingEditline;
48
49 std::string d_historyFilename;
50
51 static const std::string INPUT_FILENAME;
52 static const unsigned s_historyLimit = 500;
53
54 public:
55 InteractiveShell(api::Solver* solver, SymbolManager* sm);
56
57 /**
58 * Close out the interactive session.
59 */
60 ~InteractiveShell();
61
62 /**
63 * Read a command from the interactive shell. This will read as
64 * many lines as necessary to parse a well-formed command.
65 */
66 Command* readCommand();
67
68 /**
69 * Return the internal parser being used.
70 */
71 parser::Parser* getParser() { return d_parser; }
72
73 };/* class InteractiveShell */
74
75 } // namespace cvc5
76
77 #endif /* CVC4__INTERACTIVE_SHELL_H */