cvc4-1.3
parser_builder.h
Go to the documentation of this file.
1 /********************* */
17 #include "cvc4parser_public.h"
18 
19 #ifndef __CVC4__PARSER__PARSER_BUILDER_H
20 #define __CVC4__PARSER__PARSER_BUILDER_H
21 
22 #include <string>
23 
24 #include "parser/input.h"
25 
26 #include "util/language.h"
27 
28 namespace CVC4 {
29 
30 class ExprManager;
31 class Options;
32 
33 namespace parser {
34 
35 class Parser;
36 
43  enum InputType {
44  FILE_INPUT,
45  LINE_BUFFERED_STREAM_INPUT,
46  STREAM_INPUT,
47  STRING_INPUT
48  };
49 
51  InputType d_inputType;
52 
54  InputLanguage d_lang;
55 
57  std::string d_filename;
58 
60  std::string d_stringInput;
61 
63  std::istream* d_streamInput;
64 
66  ExprManager* d_exprManager;
67 
69  bool d_checksEnabled;
70 
72  bool d_strictMode;
73 
75  bool d_canIncludeFile;
76 
78  bool d_mmap;
79 
81  bool d_parseOnly;
82 
84  void init(ExprManager* exprManager, const std::string& filename);
85 
86 public:
87 
89  ParserBuilder(ExprManager* exprManager, const std::string& filename);
90 
91  ParserBuilder(ExprManager* exprManager, const std::string& filename,
92  const Options& options);
93 
95  Parser *build() throw (InputStreamException);
96 
98  ParserBuilder& withChecks(bool flag = true);
99 
101  ParserBuilder& withExprManager(ExprManager* exprManager);
102 
104  ParserBuilder& withFileInput();
105 
112  ParserBuilder& withFilename(const std::string& filename);
113 
119  ParserBuilder& withInputLanguage(InputLanguage lang);
120 
127  ParserBuilder& withMmap(bool flag = true);
128 
140  ParserBuilder& withParseOnly(bool flag = true);
141 
143  ParserBuilder& withOptions(const Options& options);
144 
150  ParserBuilder& withStrictMode(bool flag = true);
151 
157  ParserBuilder& withIncludeFile(bool flag = true);
158 
160  ParserBuilder& withStreamInput(std::istream& input);
161 
163  ParserBuilder& withLineBufferedStreamInput(std::istream& input);
164 
166  ParserBuilder& withStringInput(const std::string& input);
167 };/* class ParserBuilder */
168 
169 }/* CVC4::parser namespace */
170 }/* CVC4 namespace */
171 
172 #endif /* __CVC4__PARSER__PARSER_BUILDER_H */
Base for parser inputs.
void * ExprManager
This is CVC4 release version For build and installation please see the INSTALL file included with this distribution This first official release of CVC4 is the result of more than three years of efforts by researchers at New York University and The University of Iowa The project leaders are Clark please refer to the AUTHORS file in the source distribution CVC4 is a tool for determining the satisfiability of a first order formula modulo a first order CVC CVC3 but does not directly incorporate code from any previous version CVC4 is intended to be an open and extensible SMT engine It can be used as a stand alone tool or as a library It has been designed to increase the performance and reduce the memory overhead of its predecessors It is written entirely in C and is released under a free software see the INSTALL file that comes with this distribution We recommend that you visit our CVC4 tutorials online please write to the cvc users cs nyu edu mailing list *if you need to report a bug with CVC4
Definition: README:39
#define CVC4_PUBLIC
Definition: cvc4_public.h:30
Definition of input and output languages.
A builder for input language parsers.
Macros that should be defined everywhere during the building of the libraries and driver binary...
This class encapsulates all of the state of a parser, including the name of the file, line number and column information, and in-scope declarations.
Definition: parser.h:106