cvc4-1.4
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
28namespace CVC4 {
29
30class ExprManager;
31class Options;
32
33namespace parser {
34
35class 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 bool d_logicIsForced;
85
87 std::string d_forcedLogic;
88
90 void init(ExprManager* exprManager, const std::string& filename);
91
92public:
93
95 ParserBuilder(ExprManager* exprManager, const std::string& filename);
96
97 ParserBuilder(ExprManager* exprManager, const std::string& filename,
98 const Options& options);
99
102
104 ParserBuilder& withChecks(bool flag = true);
105
107 ParserBuilder& withExprManager(ExprManager* exprManager);
108
110 ParserBuilder& withFileInput();
111
118 ParserBuilder& withFilename(const std::string& filename);
119
125 ParserBuilder& withInputLanguage(InputLanguage lang);
126
133 ParserBuilder& withMmap(bool flag = true);
134
146 ParserBuilder& withParseOnly(bool flag = true);
147
149 ParserBuilder& withOptions(const Options& options);
150
156 ParserBuilder& withStrictMode(bool flag = true);
157
163 ParserBuilder& withIncludeFile(bool flag = true);
164
166 ParserBuilder& withStreamInput(std::istream& input);
167
169 ParserBuilder& withLineBufferedStreamInput(std::istream& input);
170
172 ParserBuilder& withStringInput(const std::string& input);
173
175 ParserBuilder& withForcedLogic(const std::string& logic);
176};/* class ParserBuilder */
177
178}/* CVC4::parser namespace */
179}/* CVC4 namespace */
180
181#endif /* __CVC4__PARSER__PARSER_BUILDER_H */
void * ExprManager
A builder for input language parsers.
Parser * build()
Build the parser, using the current settings.
ParserBuilder(ExprManager *exprManager, const std::string &filename)
Create a parser builder using the given ExprManager and filename.
ParserBuilder(ExprManager *exprManager, const std::string &filename, const Options &options)
This class encapsulates all of the state of a parser, including the name of the file,...
Definition parser.h:106
#define CVC4_PUBLIC
Definition cvc4_public.h:30
Macros that should be defined everywhere during the building of the libraries and driver binary,...
Base for parser inputs.
Definition of input and output languages.
Definition expr.h:106
STL namespace.