summaryrefslogtreecommitdiff
path: root/src/main/interactive_shell.h
blob: 85610618742fe4c5c4003fbc82a2e19c493e28ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/******************************************************************************
 * Top contributors (to current version):
 *   Morgan Deters, Christopher L. Conway, Mathias Preiner
 *
 * This file is part of the cvc5 project.
 *
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
 * in the top-level source directory and their institutional affiliations.
 * All rights reserved.  See the file COPYING in the top-level source
 * directory for licensing information.
 * ****************************************************************************
 *
 * Interactive shell for cvc5.
 */

#ifndef CVC5__INTERACTIVE_SHELL_H
#define CVC5__INTERACTIVE_SHELL_H

#include <iosfwd>
#include <string>

#include "options/language.h"
#include "options/options.h"
#include "util/unsafe_interrupt_exception.h"

namespace cvc5 {

class Command;
class Options;

namespace api {
class Solver;
}

namespace parser {
  class Parser;
  }  // namespace parser

class SymbolManager;

class InteractiveShell
{
  const Options& d_options;
  std::istream& d_in;
  std::ostream& d_out;
  std::unique_ptr<parser::Parser> d_parser;
  bool d_quit;
  bool d_usingEditline;

  std::string d_historyFilename;

  static const std::string INPUT_FILENAME;
  static const unsigned s_historyLimit = 500;

public:
 InteractiveShell(api::Solver* solver, SymbolManager* sm);

 /**
  * Close out the interactive session.
  */
 ~InteractiveShell();

 /**
  * Read a command from the interactive shell. This will read as
  * many lines as necessary to parse a well-formed command.
  */
 Command* readCommand();

 /**
  * Return the internal parser being used.
  */
 parser::Parser* getParser() { return d_parser.get(); }

};/* class InteractiveShell */

}  // namespace cvc5

#endif /* CVC5__INTERACTIVE_SHELL_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback