1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mathias Preiner, Aina Niemetz |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
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. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Contains code for handling command-line options. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.h file. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__OPTIONS__PARSER_H |
22 |
|
#define CVC5__OPTIONS__PARSER_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
|
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace options { |
32 |
|
|
33 |
|
// clang-format off |
34 |
|
|
35 |
|
// clang-format on |
36 |
|
|
37 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
38 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
39 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
40 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
41 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
42 |
|
|
43 |
63263 |
struct HolderPARSER |
44 |
|
{ |
45 |
|
// clang-format off |
46 |
|
bool filesystemAccess = true;\ |
47 |
|
bool filesystemAccess__setByUser__ = false; |
48 |
|
std::string forceLogicString;\ |
49 |
|
bool forceLogicString__setByUser__ = false; |
50 |
|
bool globalDeclarations = false;\ |
51 |
|
bool globalDeclarations__setByUser__ = false; |
52 |
|
bool memoryMap;\ |
53 |
|
bool memoryMap__setByUser__ = false; |
54 |
|
bool semanticChecks = DO_SEMANTIC_CHECKS_BY_DEFAULT;\ |
55 |
|
bool semanticChecks__setByUser__ = false; |
56 |
|
bool strictParsing;\ |
57 |
|
bool strictParsing__setByUser__ = false; |
58 |
|
// clang-format on |
59 |
|
}; |
60 |
|
|
61 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
62 |
|
|
63 |
|
// clang-format off |
64 |
|
extern struct filesystemAccess__option_t |
65 |
|
{ |
66 |
|
typedef bool type; |
67 |
|
type operator()() const; |
68 |
|
} thread_local filesystemAccess; |
69 |
|
extern struct forceLogicString__option_t |
70 |
|
{ |
71 |
|
typedef std::string type; |
72 |
|
type operator()() const; |
73 |
|
} thread_local forceLogicString; |
74 |
|
extern struct globalDeclarations__option_t |
75 |
|
{ |
76 |
|
typedef bool type; |
77 |
|
type operator()() const; |
78 |
|
} thread_local globalDeclarations; |
79 |
|
extern struct memoryMap__option_t |
80 |
|
{ |
81 |
|
typedef bool type; |
82 |
|
type operator()() const; |
83 |
|
} thread_local memoryMap; |
84 |
|
extern struct semanticChecks__option_t |
85 |
|
{ |
86 |
|
typedef bool type; |
87 |
|
type operator()() const; |
88 |
|
} thread_local semanticChecks; |
89 |
|
extern struct strictParsing__option_t |
90 |
|
{ |
91 |
|
typedef bool type; |
92 |
|
type operator()() const; |
93 |
|
} thread_local strictParsing; |
94 |
|
// clang-format on |
95 |
|
|
96 |
|
namespace parser |
97 |
|
{ |
98 |
|
// clang-format off |
99 |
|
static constexpr const char* filesystemAccess__name = "filesystem-access"; |
100 |
|
static constexpr const char* forceLogicString__name = "force-logic"; |
101 |
|
static constexpr const char* globalDeclarations__name = "global-declarations"; |
102 |
|
static constexpr const char* memoryMap__name = "mmap"; |
103 |
|
static constexpr const char* semanticChecks__name = "semantic-checks"; |
104 |
|
static constexpr const char* strictParsing__name = "strict-parsing"; |
105 |
|
// clang-format on |
106 |
|
} |
107 |
|
|
108 |
|
} // namespace options |
109 |
|
|
110 |
|
// clang-format off |
111 |
|
template <> options::filesystemAccess__option_t::type& Options::ref( |
112 |
|
options::filesystemAccess__option_t); |
113 |
|
template <> const options::filesystemAccess__option_t::type& Options::operator[]( |
114 |
|
options::filesystemAccess__option_t) const; |
115 |
|
template <> bool Options::wasSetByUser(options::filesystemAccess__option_t) const; |
116 |
|
template <> options::forceLogicString__option_t::type& Options::ref( |
117 |
|
options::forceLogicString__option_t); |
118 |
|
template <> const options::forceLogicString__option_t::type& Options::operator[]( |
119 |
|
options::forceLogicString__option_t) const; |
120 |
|
template <> bool Options::wasSetByUser(options::forceLogicString__option_t) const; |
121 |
|
template <> options::globalDeclarations__option_t::type& Options::ref( |
122 |
|
options::globalDeclarations__option_t); |
123 |
|
template <> const options::globalDeclarations__option_t::type& Options::operator[]( |
124 |
|
options::globalDeclarations__option_t) const; |
125 |
|
template <> bool Options::wasSetByUser(options::globalDeclarations__option_t) const; |
126 |
|
template <> options::memoryMap__option_t::type& Options::ref( |
127 |
|
options::memoryMap__option_t); |
128 |
|
template <> const options::memoryMap__option_t::type& Options::operator[]( |
129 |
|
options::memoryMap__option_t) const; |
130 |
|
template <> bool Options::wasSetByUser(options::memoryMap__option_t) const; |
131 |
|
template <> options::semanticChecks__option_t::type& Options::ref( |
132 |
|
options::semanticChecks__option_t); |
133 |
|
template <> const options::semanticChecks__option_t::type& Options::operator[]( |
134 |
|
options::semanticChecks__option_t) const; |
135 |
|
template <> bool Options::wasSetByUser(options::semanticChecks__option_t) const; |
136 |
|
template <> options::strictParsing__option_t::type& Options::ref( |
137 |
|
options::strictParsing__option_t); |
138 |
|
template <> const options::strictParsing__option_t::type& Options::operator[]( |
139 |
|
options::strictParsing__option_t) const; |
140 |
|
template <> bool Options::wasSetByUser(options::strictParsing__option_t) const; |
141 |
|
// clang-format on |
142 |
|
|
143 |
|
namespace options { |
144 |
|
// clang-format off |
145 |
|
inline filesystemAccess__option_t::type filesystemAccess__option_t::operator()() const |
146 |
|
{ |
147 |
|
return Options::current()[*this]; |
148 |
|
} |
149 |
|
inline forceLogicString__option_t::type forceLogicString__option_t::operator()() const |
150 |
|
{ |
151 |
|
return Options::current()[*this]; |
152 |
|
} |
153 |
|
inline globalDeclarations__option_t::type globalDeclarations__option_t::operator()() const |
154 |
|
{ |
155 |
|
return Options::current()[*this]; |
156 |
|
} |
157 |
|
inline memoryMap__option_t::type memoryMap__option_t::operator()() const |
158 |
|
{ |
159 |
|
return Options::current()[*this]; |
160 |
|
} |
161 |
|
inline semanticChecks__option_t::type semanticChecks__option_t::operator()() const |
162 |
|
{ |
163 |
|
return Options::current()[*this]; |
164 |
|
} |
165 |
|
inline strictParsing__option_t::type strictParsing__option_t::operator()() const |
166 |
|
{ |
167 |
|
return Options::current()[*this]; |
168 |
|
} |
169 |
|
// clang-format on |
170 |
|
|
171 |
|
} // namespace options |
172 |
|
} // namespace cvc5 |
173 |
|
|
174 |
|
#endif /* CVC5__OPTIONS__PARSER_H */ |