Merge lp:~verifydtapn-contributers/verifydtapn/partial-order into lp:verifydtapn
- partial-order
- Merge into trunk
Proposed by
Peter Gjøl Jensen
Status: | Merged |
---|---|
Approved by: | Jiri Srba |
Approved revision: | 378 |
Merged at revision: | 337 |
Proposed branch: | lp:~verifydtapn-contributers/verifydtapn/partial-order |
Merge into: | lp:verifydtapn |
Diff against target: |
11921 lines (+5598/-3307) 89 files modified
makefile.linux64 (+2/-2) src/Core/ArgsParser.cpp (+54/-2) src/Core/ArgsParser.hpp (+1/-0) src/Core/QueryParser/AST.cpp (+13/-13) src/Core/QueryParser/AST.hpp (+461/-384) src/Core/QueryParser/Generated/lexer.cpp (+118/-108) src/Core/QueryParser/Generated/location.hh (+104/-86) src/Core/QueryParser/Generated/parser.cpp (+945/-835) src/Core/QueryParser/Generated/parser.hpp (+412/-271) src/Core/QueryParser/Generated/position.hh (+94/-79) src/Core/QueryParser/Generated/stack.hh (+91/-74) src/Core/QueryParser/NormalizationVisitor.cpp (+54/-54) src/Core/QueryParser/NormalizationVisitor.hpp (+14/-14) src/Core/QueryParser/Visitor.hpp (+13/-13) src/Core/QueryParser/flex.ll (+4/-2) src/Core/QueryParser/grammar.yy (+4/-2) src/Core/TAPN/TimeInterval.cpp (+10/-2) src/Core/TAPN/TimeInterval.hpp (+33/-4) src/Core/TAPN/TimeInvariant.cpp (+7/-4) src/Core/TAPN/TimeInvariant.hpp (+2/-1) src/Core/TAPN/TimedArcPetriNet.cpp (+10/-1) src/Core/TAPN/TimedArcPetriNet.hpp (+2/-1) src/Core/TAPN/TimedPlace.hpp (+3/-0) src/Core/TAPN/TimedTransition.cpp (+35/-0) src/Core/TAPN/TimedTransition.hpp (+11/-1) src/Core/TAPNParser/TAPNXmlParser.cpp (+49/-27) src/Core/TAPNParser/TAPNXmlParser.hpp (+4/-1) src/Core/VerificationOptions.cpp (+1/-0) src/Core/VerificationOptions.hpp (+24/-2) src/DiscreteVerification/DataStructures/MarkingEncoder.h (+22/-8) src/DiscreteVerification/DataStructures/MarkingStore.h (+100/-0) src/DiscreteVerification/DataStructures/MetaData.h (+63/-0) src/DiscreteVerification/DataStructures/NonStrictMarking.hpp (+1/-40) src/DiscreteVerification/DataStructures/NonStrictMarkingBase.cpp (+24/-10) src/DiscreteVerification/DataStructures/NonStrictMarkingBase.hpp (+11/-0) src/DiscreteVerification/DataStructures/PTrieMarkingStore.h (+107/-0) src/DiscreteVerification/DataStructures/PWList.hpp (+1/-1) src/DiscreteVerification/DataStructures/SimpleMarkingStore.h (+160/-0) src/DiscreteVerification/DataStructures/TimeDartLivenessPWList.hpp (+1/-1) src/DiscreteVerification/DataStructures/TimeDartPWList.hpp (+1/-1) src/DiscreteVerification/DataStructures/Waiting.h (+178/-0) src/DiscreteVerification/DataStructures/binarywrapper.h (+11/-4) src/DiscreteVerification/DataStructures/light_deque.h (+70/-0) src/DiscreteVerification/DataStructures/ptrie.h (+140/-85) src/DiscreteVerification/DeadlockVisitor.cpp (+37/-37) src/DiscreteVerification/DeadlockVisitor.hpp (+13/-13) src/DiscreteVerification/DiscreteVerification.cpp (+91/-15) src/DiscreteVerification/Generator.cpp (+482/-0) src/DiscreteVerification/Generator.h (+69/-0) src/DiscreteVerification/PlaceVisitor.cpp (+22/-22) src/DiscreteVerification/PlaceVisitor.hpp (+14/-14) src/DiscreteVerification/QueryVisitor.hpp (+47/-33) src/DiscreteVerification/ReducingGenerator.cpp (+577/-0) src/DiscreteVerification/ReducingGenerator.hpp (+85/-0) src/DiscreteVerification/SearchStrategies/LivenessWeightQueryVisitor.cpp (+14/-14) src/DiscreteVerification/SearchStrategies/LivenessWeightQueryVisitor.hpp (+13/-13) src/DiscreteVerification/SearchStrategies/NonStrictBFS.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/NonStrictDFS.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/NonStrictDFSHeuristic.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/NonStrictDFSRandom.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/NonStrictHeuristic.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/NonStrictRandom.hpp (+0/-2) src/DiscreteVerification/SearchStrategies/SearchFactory.h (+3/-2) src/DiscreteVerification/SearchStrategies/WeightQueryVisitor.cpp (+14/-14) src/DiscreteVerification/SearchStrategies/WeightQueryVisitor.hpp (+13/-13) src/DiscreteVerification/SearchStrategies/WorkflowMinFirst.hpp (+0/-2) src/DiscreteVerification/SuccessorGenerator.hpp (+0/-463) src/DiscreteVerification/TimeDartSuccessorGenerator.cpp (+0/-232) src/DiscreteVerification/TimeDartSuccessorGenerator.hpp (+0/-63) src/DiscreteVerification/VerificationTypes/AbstractNaiveVerification.hpp (+40/-14) src/DiscreteVerification/VerificationTypes/LivenessSearch.cpp (+9/-8) src/DiscreteVerification/VerificationTypes/LivenessSearch.hpp (+3/-4) src/DiscreteVerification/VerificationTypes/ReachabilitySearch.cpp (+0/-120) src/DiscreteVerification/VerificationTypes/ReachabilitySearch.hpp (+105/-12) src/DiscreteVerification/VerificationTypes/SafetySynthesis.cpp (+310/-0) src/DiscreteVerification/VerificationTypes/SafetySynthesis.h (+86/-0) src/DiscreteVerification/VerificationTypes/TimeDartLiveness.cpp (+6/-6) src/DiscreteVerification/VerificationTypes/TimeDartLiveness.hpp (+2/-2) src/DiscreteVerification/VerificationTypes/TimeDartReachabilitySearch.cpp (+7/-8) src/DiscreteVerification/VerificationTypes/TimeDartReachabilitySearch.hpp (+4/-4) src/DiscreteVerification/VerificationTypes/TimeDartVerification.cpp (+27/-5) src/DiscreteVerification/VerificationTypes/TimeDartVerification.hpp (+7/-5) src/DiscreteVerification/VerificationTypes/Verification.hpp (+2/-2) src/DiscreteVerification/VerificationTypes/Workflow.hpp (+4/-4) src/DiscreteVerification/VerificationTypes/WorkflowSoundness.cpp (+5/-5) src/DiscreteVerification/VerificationTypes/WorkflowSoundness.hpp (+2/-4) src/DiscreteVerification/VerificationTypes/WorkflowStrongSoundness.cpp (+5/-5) src/DiscreteVerification/VerificationTypes/WorkflowStrongSoundness.hpp (+2/-3) src/main.cpp (+13/-1) |
To merge this branch: | bzr merge lp:~verifydtapn-contributers/verifydtapn/partial-order |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jiri Srba | Approve | ||
Review via email: mp+335804@code.launchpad.net |
Commit message
Description of the change
Adds zero-time partial order reduction to the engine.
Adds support for timed-safety-games to the engine.
Also refactores all around for improved performance.
New successor-
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'makefile.linux64' |
2 | --- makefile.linux64 2015-08-20 13:27:02 +0000 |
3 | +++ makefile.linux64 2018-01-07 20:09:44 +0000 |
4 | @@ -8,9 +8,9 @@ |
5 | CUT = cut |
6 | |
7 | # Compiler and linker flags |
8 | -CFLAGS = -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2 |
9 | +CFLAGS = -std=c++14 -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2 |
10 | |
11 | -LDFLAGS = -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2 |
12 | +LDFLAGS = -std=c++14 -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2 |
13 | |
14 | # Input files |
15 | SOURCES = $(shell find * -name "*.cpp") |
16 | |
17 | === modified file 'src/Core/ArgsParser.cpp' |
18 | --- src/Core/ArgsParser.cpp 2017-09-15 14:38:02 +0000 |
19 | +++ src/Core/ArgsParser.cpp 2018-01-07 20:09:44 +0000 |
20 | @@ -20,6 +20,8 @@ |
21 | static const std::string WORKFLOW = "workflow"; |
22 | static const std::string STRONG_WORKFLOW_BOUND = "strong-workflow-bound"; |
23 | static const std::string CALCULATE_CMAX = "calculate-cmax"; |
24 | +static const std::string REPLACE = "replace"; |
25 | +static const std::string ORDER = "partial-order"; |
26 | |
27 | std::ostream& operator<<(std::ostream& out, const Switch& flag) { |
28 | flag.print(out); |
29 | @@ -181,7 +183,13 @@ |
30 | parsers.push_back( |
31 | new Switch ("n", CALCULATE_CMAX, |
32 | "Calculate the place bounds")); |
33 | - |
34 | + parsers.push_back( |
35 | + new SwitchWithStringArg("r", REPLACE, |
36 | + "Replace placeholder in model with value, format PLACEHOLDER=VALUE;..", "")); |
37 | + parsers.push_back( |
38 | + new Switch("i", ORDER, |
39 | + "Disable partial order reduction")); |
40 | + |
41 | }; |
42 | |
43 | void ArgsParser::printHelp() const { |
44 | @@ -404,6 +412,45 @@ |
45 | return result; |
46 | } |
47 | |
48 | +std::map<std::string, int> ArgsParser::parseReplace(const option& option) const |
49 | +{ |
50 | + std::map<std::string, int> replace; |
51 | + const std::string param = option.second; |
52 | + |
53 | + size_t split = 0; |
54 | + do { |
55 | + size_t equal = param.find("=", split); |
56 | + if(equal != std::string::npos) |
57 | + { |
58 | + std::string name = param.substr(split, equal - split); |
59 | + std::string val; |
60 | + split = param.find(":", equal); |
61 | + ++equal; |
62 | + if(split == std::string::npos) |
63 | + val = param.substr(equal, param.size() - equal); |
64 | + else |
65 | + val = param.substr(equal, split - equal); |
66 | + |
67 | + try{ |
68 | + int res = boost::lexical_cast<unsigned long long>(val); |
69 | + replace[name] = res; |
70 | + } catch (boost::bad_lexical_cast & e) { |
71 | + std::cout << "Invalid value '" << option.second << "' for option '--" |
72 | + << option.first << "'" << std::endl; |
73 | + exit(1); |
74 | + } |
75 | + if(split >= param.size()) break; |
76 | + ++split; |
77 | + } |
78 | + else |
79 | + { |
80 | + break; |
81 | + } |
82 | + |
83 | + } while(split != std::string::npos); |
84 | + return replace; |
85 | +} |
86 | + |
87 | std::vector<std::string> ArgsParser::parseIncPlaces( |
88 | const std::string& string) const { |
89 | std::vector<std::string> vec; |
90 | @@ -452,13 +499,18 @@ |
91 | bool calculateCmax = boost::lexical_cast<bool>( |
92 | map.find(CALCULATE_CMAX)->second); |
93 | |
94 | + std::map<std::string, int> replace = parseReplace(*map.find(REPLACE)); |
95 | |
96 | assert(map.find(GCD) != map.end()); |
97 | bool enableGCDLowerGuards = boost::lexical_cast<bool>( |
98 | map.find(GCD)->second); |
99 | + |
100 | + bool order = boost::lexical_cast<bool>( |
101 | + map.find(ORDER)->second); |
102 | |
103 | return VerificationOptions(search, verification, memoptimization, kbound, trace, |
104 | - xml_trace, max_constant, keep_dead, enableGCDLowerGuards, workflow, workflowBound, calculateCmax); |
105 | + xml_trace, max_constant, keep_dead, enableGCDLowerGuards, workflow, |
106 | + workflowBound, calculateCmax, replace, !order); |
107 | |
108 | } |
109 | } |
110 | |
111 | === modified file 'src/Core/ArgsParser.hpp' |
112 | --- src/Core/ArgsParser.hpp 2017-09-18 13:45:47 +0000 |
113 | +++ src/Core/ArgsParser.hpp 2018-01-07 20:09:44 +0000 |
114 | @@ -89,6 +89,7 @@ |
115 | unsigned int tryParseInt(const option& option) const; |
116 | unsigned long long tryParseLongLong(const option& option) const; |
117 | std::vector<std::string> parseIncPlaces(const std::string& string) const; |
118 | + std::map<std::string, int> parseReplace(const option& option) const; |
119 | void initialize(); |
120 | void printHelp() const; |
121 | void printVersion() const; |
122 | |
123 | === modified file 'src/Core/QueryParser/AST.cpp' |
124 | --- src/Core/QueryParser/AST.cpp 2014-02-16 19:20:25 +0000 |
125 | +++ src/Core/QueryParser/AST.cpp 2018-01-07 20:09:44 +0000 |
126 | @@ -8,12 +8,12 @@ |
127 | return new NotExpression(*this); |
128 | } |
129 | |
130 | - void NotExpression::accept(Visitor& visitor, Result& context) const |
131 | + void NotExpression::accept(Visitor& visitor, Result& context) |
132 | { |
133 | visitor.visit(*this, context); |
134 | } |
135 | |
136 | - void BoolExpression::accept(Visitor& visitor, Result& context) const |
137 | + void BoolExpression::accept(Visitor& visitor, Result& context) |
138 | { |
139 | visitor.visit(*this, context); |
140 | } |
141 | @@ -23,7 +23,7 @@ |
142 | return new BoolExpression(*this); |
143 | } |
144 | |
145 | - void DeadlockExpression::accept(Visitor& visitor, Result& context) const |
146 | + void DeadlockExpression::accept(Visitor& visitor, Result& context) |
147 | { |
148 | visitor.visit(*this, context); |
149 | } |
150 | @@ -33,7 +33,7 @@ |
151 | return new DeadlockExpression(*this); |
152 | } |
153 | |
154 | - void AtomicProposition::accept(Visitor& visitor, Result& context) const |
155 | + void AtomicProposition::accept(Visitor& visitor, Result& context) |
156 | { |
157 | visitor.visit(*this, context); |
158 | } |
159 | @@ -48,7 +48,7 @@ |
160 | return new AndExpression(*this); |
161 | } |
162 | |
163 | - void AndExpression::accept(Visitor& visitor, Result& context) const |
164 | + void AndExpression::accept(Visitor& visitor, Result& context) |
165 | { |
166 | visitor.visit(*this, context); |
167 | } |
168 | @@ -58,12 +58,12 @@ |
169 | return new OrExpression(*this); |
170 | } |
171 | |
172 | - void OrExpression::accept(Visitor& visitor, Result& context) const |
173 | + void OrExpression::accept(Visitor& visitor, Result& context) |
174 | { |
175 | visitor.visit(*this, context); |
176 | } |
177 | |
178 | - void PlusExpression::accept(Visitor& visitor, Result& context) const |
179 | + void PlusExpression::accept(Visitor& visitor, Result& context) |
180 | { |
181 | visitor.visit(*this, context); |
182 | } |
183 | @@ -73,7 +73,7 @@ |
184 | return new PlusExpression(*this); |
185 | } |
186 | |
187 | - void SubtractExpression::accept(Visitor& visitor, Result& context) const |
188 | + void SubtractExpression::accept(Visitor& visitor, Result& context) |
189 | { |
190 | visitor.visit(*this, context); |
191 | } |
192 | @@ -83,7 +83,7 @@ |
193 | return new SubtractExpression(*this); |
194 | } |
195 | |
196 | - void MinusExpression::accept(Visitor& visitor, Result& context) const |
197 | + void MinusExpression::accept(Visitor& visitor, Result& context) |
198 | { |
199 | visitor.visit(*this, context); |
200 | } |
201 | @@ -93,7 +93,7 @@ |
202 | return new MinusExpression(*this); |
203 | } |
204 | |
205 | - void MultiplyExpression::accept(Visitor& visitor, Result& context) const |
206 | + void MultiplyExpression::accept(Visitor& visitor, Result& context) |
207 | { |
208 | visitor.visit(*this, context); |
209 | } |
210 | @@ -103,7 +103,7 @@ |
211 | return new MultiplyExpression(*this); |
212 | } |
213 | |
214 | - void NumberExpression::accept(Visitor& visitor, Result& context) const |
215 | + void NumberExpression::accept(Visitor& visitor, Result& context) |
216 | { |
217 | visitor.visit(*this, context); |
218 | } |
219 | @@ -113,7 +113,7 @@ |
220 | return new NumberExpression(*this); |
221 | } |
222 | |
223 | - void IdentifierExpression::accept(Visitor& visitor, Result& context) const |
224 | + void IdentifierExpression::accept(Visitor& visitor, Result& context) |
225 | { |
226 | visitor.visit(*this, context); |
227 | } |
228 | @@ -128,7 +128,7 @@ |
229 | return new Query(*this); |
230 | } |
231 | |
232 | - void Query::accept(Visitor& visitor, Result& context) const |
233 | + void Query::accept(Visitor& visitor, Result& context) |
234 | { |
235 | visitor.visit(*this, context); |
236 | } |
237 | |
238 | === modified file 'src/Core/QueryParser/AST.hpp' |
239 | --- src/Core/QueryParser/AST.hpp 2014-02-16 19:20:25 +0000 |
240 | +++ src/Core/QueryParser/AST.hpp 2018-01-07 20:09:44 +0000 |
241 | @@ -5,390 +5,467 @@ |
242 | #include <iostream> |
243 | #include "Visitor.hpp" |
244 | |
245 | -namespace VerifyTAPN{ |
246 | - namespace AST { |
247 | - |
248 | - class Visitable |
249 | - { |
250 | - public: |
251 | - virtual void accept(Visitor& visitor, Result& context) const = 0; |
252 | - }; |
253 | - |
254 | - class Expression : public Visitable |
255 | - { |
256 | - public: |
257 | - virtual ~Expression() { }; |
258 | - virtual Expression* clone() const = 0; |
259 | - }; |
260 | - |
261 | - class NotExpression : public Expression |
262 | - { |
263 | - public: |
264 | - explicit NotExpression(Expression* expr) : expr(expr) { }; |
265 | - NotExpression(const NotExpression& other) : expr(other.expr->clone()) { }; |
266 | - NotExpression& operator=(const NotExpression& other) |
267 | - { |
268 | - if(&other != this){ |
269 | - delete expr; |
270 | - expr = other.expr->clone(); |
271 | - } |
272 | - |
273 | - return *this; |
274 | - } |
275 | - |
276 | - virtual ~NotExpression(){ |
277 | - if( expr ) delete expr; |
278 | - }; |
279 | - |
280 | - virtual NotExpression* clone() const; |
281 | - virtual void accept(Visitor& visitor, Result& context) const; |
282 | - |
283 | - const Expression& getChild() const { return *expr; } |
284 | - private: |
285 | - Expression* expr; |
286 | - }; |
287 | - |
288 | - class DeadlockExpression : public Expression |
289 | - { |
290 | - public: |
291 | - explicit DeadlockExpression() {}; |
292 | - virtual ~DeadlockExpression() { }; |
293 | - |
294 | - virtual DeadlockExpression* clone() const; |
295 | - virtual void accept(Visitor& visitor, Result& context) const; |
296 | - }; |
297 | - |
298 | - class BoolExpression : public Expression |
299 | - { |
300 | - public: |
301 | - explicit BoolExpression(bool value) : value(value) {}; |
302 | - virtual ~BoolExpression() { }; |
303 | - |
304 | - virtual BoolExpression* clone() const; |
305 | - virtual void accept(Visitor& visitor, Result& context) const; |
306 | - |
307 | - bool getValue() const { return value; }; |
308 | - private: |
309 | - bool value; |
310 | - }; |
311 | - |
312 | - class AtomicProposition : public Expression |
313 | - { |
314 | - public: |
315 | - AtomicProposition(ArithmeticExpression* left, std::string* op,ArithmeticExpression* right) : left(left), op(op->begin(), op->end()), right(right){}; |
316 | - AtomicProposition(const AtomicProposition& other) : left(other.left), op(other.op), right(other.right) { }; |
317 | - AtomicProposition& operator=(const AtomicProposition& other) |
318 | - { |
319 | - if(&other != this){ |
320 | - left = other.left; |
321 | - op = other.op; |
322 | - right = other.right; |
323 | - } |
324 | - return *this; |
325 | - } |
326 | - |
327 | - virtual ~AtomicProposition() { }; |
328 | - |
329 | - ArithmeticExpression& getLeft() const {return *left;}; |
330 | - ArithmeticExpression& getRight() const {return *right;}; |
331 | - std::string getOperator() const {return op;}; |
332 | - |
333 | - virtual AtomicProposition* clone() const; |
334 | - virtual void accept(Visitor& visitor, Result& context) const; |
335 | - |
336 | - private: |
337 | - ArithmeticExpression* left; |
338 | - std::string op; |
339 | - ArithmeticExpression* right; |
340 | - }; |
341 | - |
342 | - class AndExpression : public Expression |
343 | - { |
344 | - public: |
345 | - AndExpression(Expression* left, Expression* right) : left(left), right(right) { }; |
346 | - AndExpression(const AndExpression& other) : left(other.left->clone()), right(other.right->clone()) {}; |
347 | - AndExpression& operator=(const AndExpression& other) |
348 | - { |
349 | - if(&other != this){ |
350 | - delete left; |
351 | - delete right; |
352 | - |
353 | - left = other.left->clone(); |
354 | - right = other.right->clone(); |
355 | - } |
356 | - return *this; |
357 | - } |
358 | - |
359 | - virtual ~AndExpression() { |
360 | - if( left ) delete left; |
361 | - if( right ) delete right; |
362 | - } |
363 | - |
364 | - virtual AndExpression* clone() const; |
365 | - void accept(Visitor& visitor, Result& context) const; |
366 | - |
367 | - const Expression& getLeft() const { return *left; } |
368 | - const Expression& getRight() const { return *right; } |
369 | - private: |
370 | - Expression* left; |
371 | - Expression* right; |
372 | - }; |
373 | - |
374 | - class OrExpression : public Expression |
375 | - { |
376 | - public: |
377 | - OrExpression(Expression* left, Expression* right) : left(left), right(right) { }; |
378 | - OrExpression(const OrExpression& other) : left(other.left->clone()), right(other.right->clone()) { }; |
379 | - OrExpression& operator=(const OrExpression& other) |
380 | - { |
381 | - if(&other != this){ |
382 | - delete left; |
383 | - delete right; |
384 | - |
385 | - left = other.left->clone(); |
386 | - right = other.right->clone(); |
387 | - } |
388 | - return *this; |
389 | - } |
390 | - |
391 | - |
392 | - virtual ~OrExpression(){ |
393 | - if( left ) delete left; |
394 | - if( right ) delete right; |
395 | - }; |
396 | - |
397 | - |
398 | - |
399 | - virtual OrExpression* clone() const; |
400 | - virtual void accept(Visitor& visitor, Result& context) const; |
401 | - |
402 | - const Expression& getLeft() const { return *left; } |
403 | - const Expression& getRight() const { return *right; } |
404 | - private: |
405 | - Expression* left; |
406 | - Expression* right; |
407 | - }; |
408 | - |
409 | - class ArithmeticExpression : public Visitable |
410 | - { |
411 | - public: |
412 | - virtual ~ArithmeticExpression() { }; |
413 | - virtual ArithmeticExpression* clone() const = 0; |
414 | - }; |
415 | - |
416 | - class OperationExpression : public ArithmeticExpression { |
417 | - protected: |
418 | - |
419 | - OperationExpression(ArithmeticExpression* left, ArithmeticExpression* right) : left(left), right(right) { |
420 | - }; |
421 | - |
422 | - OperationExpression(const OperationExpression& other) : left(other.left), right(other.right) { |
423 | - }; |
424 | - |
425 | - OperationExpression& operator=(const OperationExpression& other) { |
426 | - if (&other != this) { |
427 | - delete left; |
428 | - left = other.left; |
429 | - delete right; |
430 | - right = other.right; |
431 | - } |
432 | - return *this; |
433 | - } |
434 | - |
435 | - virtual ~OperationExpression() { |
436 | - }; |
437 | - |
438 | - public: |
439 | - ArithmeticExpression& getLeft() const {return *left;}; |
440 | - ArithmeticExpression& getRight() const {return *right;}; |
441 | - |
442 | - protected: |
443 | - ArithmeticExpression* left; |
444 | - ArithmeticExpression* right; |
445 | - }; |
446 | - |
447 | - class PlusExpression : public OperationExpression { |
448 | - public: |
449 | - |
450 | - PlusExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
451 | - : OperationExpression(left, right) { |
452 | - }; |
453 | - |
454 | - PlusExpression(const PlusExpression& other) |
455 | - : OperationExpression(other) { |
456 | - }; |
457 | - |
458 | - PlusExpression& operator=(const PlusExpression& other) { |
459 | - if (&other != this) { |
460 | - left = other.left; |
461 | - right = other.right; |
462 | - } |
463 | - return *this; |
464 | - } |
465 | - |
466 | - virtual ~PlusExpression() { |
467 | - }; |
468 | - |
469 | - virtual PlusExpression* clone() const; |
470 | - virtual void accept(Visitor& visitor, Result& context) const; |
471 | - |
472 | - }; |
473 | - |
474 | - class SubtractExpression : public OperationExpression { |
475 | - public: |
476 | - |
477 | - SubtractExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
478 | - : OperationExpression(left, right) { |
479 | - }; |
480 | - |
481 | - SubtractExpression(const SubtractExpression& other) |
482 | - : OperationExpression(other) { |
483 | - }; |
484 | - |
485 | - SubtractExpression& operator=(const SubtractExpression& other) { |
486 | - if (&other != this) { |
487 | - left = other.left; |
488 | - right = other.right; |
489 | - } |
490 | - return *this; |
491 | - } |
492 | - |
493 | - virtual ~SubtractExpression() { |
494 | - }; |
495 | - |
496 | - virtual SubtractExpression* clone() const; |
497 | - virtual void accept(Visitor& visitor, Result& context) const; |
498 | - }; |
499 | - |
500 | - class MinusExpression : public ArithmeticExpression { |
501 | - public: |
502 | - MinusExpression(ArithmeticExpression* value) : value(value) { |
503 | - }; |
504 | - |
505 | - MinusExpression(const MinusExpression& other) |
506 | - : value(other.value) { |
507 | - }; |
508 | - |
509 | - MinusExpression& operator=(const MinusExpression& other) { |
510 | - if (&other != this) { |
511 | - value = other.value; |
512 | - } |
513 | - return *this; |
514 | - } |
515 | - |
516 | - ArithmeticExpression& getValue() const { return *value;}; |
517 | - |
518 | - virtual ~MinusExpression() { |
519 | - }; |
520 | - virtual MinusExpression* clone() const; |
521 | - virtual void accept(Visitor& visitor, Result& context) const; |
522 | - private: |
523 | - ArithmeticExpression* value; |
524 | - }; |
525 | - |
526 | - class MultiplyExpression : public OperationExpression { |
527 | - public: |
528 | - |
529 | - MultiplyExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
530 | - : OperationExpression(left, right) { |
531 | - }; |
532 | - |
533 | - MultiplyExpression(const MultiplyExpression& other) |
534 | - : OperationExpression(other) { |
535 | - }; |
536 | - |
537 | - MultiplyExpression& operator=(const MultiplyExpression& other) { |
538 | - if (&other != this) { |
539 | - left = other.left; |
540 | - right = other.right; |
541 | - } |
542 | - return *this; |
543 | - } |
544 | - |
545 | - virtual ~MultiplyExpression() { |
546 | - }; |
547 | - virtual MultiplyExpression* clone() const; |
548 | - virtual void accept(Visitor& visitor, Result& context) const; |
549 | - }; |
550 | - |
551 | - class NumberExpression : public ArithmeticExpression { |
552 | - public: |
553 | - |
554 | - NumberExpression(int i) : value(i) { |
555 | - } |
556 | - |
557 | - NumberExpression(const NumberExpression& other) : value(other.value) { |
558 | - }; |
559 | - |
560 | - NumberExpression& operator=(const NumberExpression& other) { |
561 | - value = other.value; |
562 | - return *this; |
563 | - }; |
564 | - |
565 | - int getValue() const {return value;}; |
566 | - |
567 | - virtual ~NumberExpression() { |
568 | - }; |
569 | - virtual NumberExpression* clone() const; |
570 | - virtual void accept(Visitor& visitor, Result& context) const; |
571 | - private: |
572 | - int value; |
573 | - }; |
574 | - |
575 | - class IdentifierExpression : public ArithmeticExpression { |
576 | - public: |
577 | - |
578 | - IdentifierExpression(int placeIndex) : place(placeIndex) { |
579 | - } |
580 | - |
581 | - IdentifierExpression(const IdentifierExpression& other) : place(other.place) { |
582 | - }; |
583 | - |
584 | - IdentifierExpression& operator=(const IdentifierExpression& other) { |
585 | - place = other.place; |
586 | - return *this; |
587 | - }; |
588 | - |
589 | - int getPlace() const { return place;}; |
590 | - |
591 | - virtual ~IdentifierExpression() { |
592 | - }; |
593 | - virtual IdentifierExpression* clone() const; |
594 | - virtual void accept(Visitor& visitor, Result& context) const; |
595 | - private: |
596 | - int place; |
597 | - }; |
598 | - |
599 | - |
600 | - enum Quantifier { EF, AG, EG, AF}; |
601 | - |
602 | - class Query : public Visitable |
603 | - { |
604 | - public: |
605 | - Query(Quantifier quantifier, Expression* expr) : quantifier(quantifier), expr(expr) { }; |
606 | - Query(const Query& other) : quantifier(other.quantifier), expr(other.expr->clone()) { }; |
607 | - Query& operator=(const Query& other) |
608 | - { |
609 | - if(&other != this){ |
610 | - delete expr; |
611 | - expr = other.expr->clone(); |
612 | - } |
613 | - return *this; |
614 | - } |
615 | - |
616 | - virtual ~Query() { if( expr ) delete expr; } |
617 | - |
618 | - virtual Query* clone() const; |
619 | - virtual void accept(Visitor& visitor, Result& context) const; |
620 | - |
621 | - Quantifier getQuantifier() const { return quantifier; } |
622 | - const Expression& getChild() const { return *expr; } |
623 | - void setQuantifier(Quantifier q){ quantifier = q; } |
624 | - private: |
625 | - Quantifier quantifier; |
626 | - Expression* expr; |
627 | - }; |
628 | - } |
629 | +namespace VerifyTAPN { |
630 | + namespace AST { |
631 | + |
632 | + class Visitable { |
633 | + public: |
634 | + virtual void accept(Visitor& visitor, Result& context) = 0; |
635 | + int32_t eval = 0; |
636 | + }; |
637 | + |
638 | + class Expression : public Visitable { |
639 | + public: |
640 | + |
641 | + virtual ~Expression() { |
642 | + }; |
643 | + virtual Expression* clone() const = 0; |
644 | + }; |
645 | + |
646 | + class NotExpression : public Expression { |
647 | + public: |
648 | + |
649 | + explicit NotExpression(Expression* expr) : expr(expr) { |
650 | + }; |
651 | + |
652 | + NotExpression(const NotExpression& other) : expr(other.expr->clone()) { |
653 | + }; |
654 | + |
655 | + NotExpression& operator=(const NotExpression& other) { |
656 | + if (&other != this) { |
657 | + delete expr; |
658 | + expr = other.expr->clone(); |
659 | + } |
660 | + |
661 | + return *this; |
662 | + } |
663 | + |
664 | + virtual ~NotExpression() { |
665 | + if (expr) delete expr; |
666 | + }; |
667 | + |
668 | + virtual NotExpression* clone() const; |
669 | + virtual void accept(Visitor& visitor, Result& context); |
670 | + |
671 | + Expression& getChild() const { |
672 | + return *expr; |
673 | + } |
674 | + private: |
675 | + Expression* expr; |
676 | + }; |
677 | + |
678 | + class DeadlockExpression : public Expression { |
679 | + public: |
680 | + |
681 | + explicit DeadlockExpression() { |
682 | + }; |
683 | + |
684 | + virtual ~DeadlockExpression() { |
685 | + }; |
686 | + |
687 | + virtual DeadlockExpression* clone() const; |
688 | + virtual void accept(Visitor& visitor, Result& context); |
689 | + }; |
690 | + |
691 | + class BoolExpression : public Expression { |
692 | + public: |
693 | + |
694 | + explicit BoolExpression(bool value) : value(value) { |
695 | + }; |
696 | + |
697 | + virtual ~BoolExpression() { |
698 | + }; |
699 | + |
700 | + virtual BoolExpression* clone() const; |
701 | + virtual void accept(Visitor& visitor, Result& context); |
702 | + |
703 | + bool getValue() const { |
704 | + return value; |
705 | + }; |
706 | + private: |
707 | + bool value; |
708 | + }; |
709 | + |
710 | + class AtomicProposition : public Expression { |
711 | + public: |
712 | + |
713 | + AtomicProposition(ArithmeticExpression* left, std::string* op, ArithmeticExpression* right) : left(left), op(op->begin(), op->end()), right(right) { |
714 | + }; |
715 | + |
716 | + AtomicProposition(const AtomicProposition& other) : left(other.left), op(other.op), right(other.right) { |
717 | + }; |
718 | + |
719 | + AtomicProposition& operator=(const AtomicProposition& other) { |
720 | + if (&other != this) { |
721 | + left = other.left; |
722 | + op = other.op; |
723 | + right = other.right; |
724 | + } |
725 | + return *this; |
726 | + } |
727 | + |
728 | + virtual ~AtomicProposition() { |
729 | + }; |
730 | + |
731 | + ArithmeticExpression& getLeft() const { |
732 | + return *left; |
733 | + }; |
734 | + |
735 | + ArithmeticExpression& getRight() const { |
736 | + return *right; |
737 | + }; |
738 | + |
739 | + std::string getOperator() const { |
740 | + return op; |
741 | + }; |
742 | + |
743 | + virtual AtomicProposition* clone() const; |
744 | + virtual void accept(Visitor& visitor, Result& context); |
745 | + |
746 | + private: |
747 | + ArithmeticExpression* left; |
748 | + std::string op; |
749 | + ArithmeticExpression* right; |
750 | + }; |
751 | + |
752 | + class AndExpression : public Expression { |
753 | + public: |
754 | + |
755 | + AndExpression(Expression* left, Expression* right) : left(left), right(right) { |
756 | + }; |
757 | + |
758 | + AndExpression(const AndExpression& other) : left(other.left->clone()), right(other.right->clone()) { |
759 | + }; |
760 | + |
761 | + AndExpression& operator=(const AndExpression& other) { |
762 | + if (&other != this) { |
763 | + delete left; |
764 | + delete right; |
765 | + |
766 | + left = other.left->clone(); |
767 | + right = other.right->clone(); |
768 | + } |
769 | + return *this; |
770 | + } |
771 | + |
772 | + virtual ~AndExpression() { |
773 | + if (left) delete left; |
774 | + if (right) delete right; |
775 | + } |
776 | + |
777 | + virtual AndExpression* clone() const; |
778 | + void accept(Visitor& visitor, Result& context); |
779 | + |
780 | + Expression& getLeft() const { |
781 | + return *left; |
782 | + } |
783 | + |
784 | + Expression& getRight() const { |
785 | + return *right; |
786 | + } |
787 | + private: |
788 | + Expression* left; |
789 | + Expression* right; |
790 | + }; |
791 | + |
792 | + class OrExpression : public Expression { |
793 | + public: |
794 | + |
795 | + OrExpression(Expression* left, Expression* right) : left(left), right(right) { |
796 | + }; |
797 | + |
798 | + OrExpression(const OrExpression& other) : left(other.left->clone()), right(other.right->clone()) { |
799 | + }; |
800 | + |
801 | + OrExpression& operator=(const OrExpression& other) { |
802 | + if (&other != this) { |
803 | + delete left; |
804 | + delete right; |
805 | + |
806 | + left = other.left->clone(); |
807 | + right = other.right->clone(); |
808 | + } |
809 | + return *this; |
810 | + } |
811 | + |
812 | + virtual ~OrExpression() { |
813 | + if (left) delete left; |
814 | + if (right) delete right; |
815 | + }; |
816 | + |
817 | + |
818 | + |
819 | + virtual OrExpression* clone() const; |
820 | + virtual void accept(Visitor& visitor, Result& context); |
821 | + |
822 | + Expression& getLeft() const { |
823 | + return *left; |
824 | + } |
825 | + |
826 | + Expression& getRight() const { |
827 | + return *right; |
828 | + } |
829 | + private: |
830 | + Expression* left; |
831 | + Expression* right; |
832 | + }; |
833 | + |
834 | + class ArithmeticExpression : public Visitable { |
835 | + public: |
836 | + |
837 | + virtual ~ArithmeticExpression() { |
838 | + }; |
839 | + virtual ArithmeticExpression* clone() const = 0; |
840 | + }; |
841 | + |
842 | + class OperationExpression : public ArithmeticExpression { |
843 | + protected: |
844 | + |
845 | + OperationExpression(ArithmeticExpression* left, ArithmeticExpression* right) : left(left), right(right) { |
846 | + }; |
847 | + |
848 | + OperationExpression(const OperationExpression& other) : left(other.left), right(other.right) { |
849 | + }; |
850 | + |
851 | + OperationExpression& operator=(const OperationExpression& other) { |
852 | + if (&other != this) { |
853 | + delete left; |
854 | + left = other.left; |
855 | + delete right; |
856 | + right = other.right; |
857 | + } |
858 | + return *this; |
859 | + } |
860 | + |
861 | + virtual ~OperationExpression() { |
862 | + }; |
863 | + |
864 | + public: |
865 | + |
866 | + ArithmeticExpression& getLeft() { |
867 | + return *left; |
868 | + }; |
869 | + |
870 | + ArithmeticExpression& getRight() { |
871 | + return *right; |
872 | + }; |
873 | + |
874 | + protected: |
875 | + ArithmeticExpression* left; |
876 | + ArithmeticExpression* right; |
877 | + }; |
878 | + |
879 | + class PlusExpression : public OperationExpression { |
880 | + public: |
881 | + |
882 | + PlusExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
883 | + : OperationExpression(left, right) { |
884 | + }; |
885 | + |
886 | + PlusExpression(const PlusExpression& other) |
887 | + : OperationExpression(other) { |
888 | + }; |
889 | + |
890 | + PlusExpression& operator=(const PlusExpression& other) { |
891 | + if (&other != this) { |
892 | + left = other.left; |
893 | + right = other.right; |
894 | + } |
895 | + return *this; |
896 | + } |
897 | + |
898 | + virtual ~PlusExpression() { |
899 | + }; |
900 | + |
901 | + virtual PlusExpression* clone() const; |
902 | + virtual void accept(Visitor& visitor, Result& context); |
903 | + |
904 | + }; |
905 | + |
906 | + class SubtractExpression : public OperationExpression { |
907 | + public: |
908 | + |
909 | + SubtractExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
910 | + : OperationExpression(left, right) { |
911 | + }; |
912 | + |
913 | + SubtractExpression(const SubtractExpression& other) |
914 | + : OperationExpression(other) { |
915 | + }; |
916 | + |
917 | + SubtractExpression& operator=(const SubtractExpression& other) { |
918 | + if (&other != this) { |
919 | + left = other.left; |
920 | + right = other.right; |
921 | + } |
922 | + return *this; |
923 | + } |
924 | + |
925 | + virtual ~SubtractExpression() { |
926 | + }; |
927 | + |
928 | + virtual SubtractExpression* clone() const; |
929 | + virtual void accept(Visitor& visitor, Result& context); |
930 | + }; |
931 | + |
932 | + class MinusExpression : public ArithmeticExpression { |
933 | + public: |
934 | + |
935 | + MinusExpression(ArithmeticExpression* value) : value(value) { |
936 | + }; |
937 | + |
938 | + MinusExpression(const MinusExpression& other) |
939 | + : value(other.value) { |
940 | + }; |
941 | + |
942 | + MinusExpression& operator=(const MinusExpression& other) { |
943 | + if (&other != this) { |
944 | + value = other.value; |
945 | + } |
946 | + return *this; |
947 | + } |
948 | + |
949 | + ArithmeticExpression& getValue() const { |
950 | + return *value; |
951 | + }; |
952 | + |
953 | + virtual ~MinusExpression() { |
954 | + }; |
955 | + virtual MinusExpression* clone() const; |
956 | + virtual void accept(Visitor& visitor, Result& context); |
957 | + private: |
958 | + ArithmeticExpression* value; |
959 | + }; |
960 | + |
961 | + class MultiplyExpression : public OperationExpression { |
962 | + public: |
963 | + |
964 | + MultiplyExpression(ArithmeticExpression* left, ArithmeticExpression* right) |
965 | + : OperationExpression(left, right) { |
966 | + }; |
967 | + |
968 | + MultiplyExpression(const MultiplyExpression& other) |
969 | + : OperationExpression(other) { |
970 | + }; |
971 | + |
972 | + MultiplyExpression& operator=(const MultiplyExpression& other) { |
973 | + if (&other != this) { |
974 | + left = other.left; |
975 | + right = other.right; |
976 | + } |
977 | + return *this; |
978 | + } |
979 | + |
980 | + virtual ~MultiplyExpression() { |
981 | + }; |
982 | + virtual MultiplyExpression* clone() const; |
983 | + virtual void accept(Visitor& visitor, Result& context); |
984 | + }; |
985 | + |
986 | + class NumberExpression : public ArithmeticExpression { |
987 | + public: |
988 | + |
989 | + NumberExpression(int i) : value(i) { |
990 | + } |
991 | + |
992 | + NumberExpression(const NumberExpression& other) : value(other.value) { |
993 | + }; |
994 | + |
995 | + NumberExpression& operator=(const NumberExpression& other) { |
996 | + value = other.value; |
997 | + return *this; |
998 | + }; |
999 | + |
1000 | + int getValue() const { |
1001 | + return value; |
1002 | + }; |
1003 | + |
1004 | + virtual ~NumberExpression() { |
1005 | + }; |
1006 | + virtual NumberExpression* clone() const; |
1007 | + virtual void accept(Visitor& visitor, Result& context); |
1008 | + private: |
1009 | + int value; |
1010 | + }; |
1011 | + |
1012 | + class IdentifierExpression : public ArithmeticExpression { |
1013 | + public: |
1014 | + |
1015 | + IdentifierExpression(int placeIndex) : place(placeIndex) { |
1016 | + } |
1017 | + |
1018 | + IdentifierExpression(const IdentifierExpression& other) : place(other.place) { |
1019 | + }; |
1020 | + |
1021 | + IdentifierExpression& operator=(const IdentifierExpression& other) { |
1022 | + place = other.place; |
1023 | + return *this; |
1024 | + }; |
1025 | + |
1026 | + int getPlace() const { |
1027 | + return place; |
1028 | + }; |
1029 | + |
1030 | + virtual ~IdentifierExpression() { |
1031 | + }; |
1032 | + virtual IdentifierExpression* clone() const; |
1033 | + virtual void accept(Visitor& visitor, Result& context); |
1034 | + private: |
1035 | + int place; |
1036 | + }; |
1037 | + |
1038 | + enum Quantifier { |
1039 | + EF, AG, EG, AF, CF, CG |
1040 | + }; |
1041 | + |
1042 | + class Query : public Visitable { |
1043 | + public: |
1044 | + |
1045 | + Query(Quantifier quantifier, Expression* expr) : quantifier(quantifier), expr(expr) { |
1046 | + }; |
1047 | + |
1048 | + Query(const Query& other) : quantifier(other.quantifier), expr(other.expr->clone()) { |
1049 | + }; |
1050 | + |
1051 | + Query& operator=(const Query& other) { |
1052 | + if (&other != this) { |
1053 | + delete expr; |
1054 | + expr = other.expr->clone(); |
1055 | + } |
1056 | + return *this; |
1057 | + } |
1058 | + |
1059 | + virtual ~Query() { |
1060 | + if (expr) delete expr; |
1061 | + } |
1062 | + |
1063 | + virtual Query* clone() const; |
1064 | + virtual void accept(Visitor& visitor, Result& context); |
1065 | + |
1066 | + Quantifier getQuantifier() const { |
1067 | + return quantifier; |
1068 | + } |
1069 | + |
1070 | + const Expression& getConstChild() const { |
1071 | + return *expr; |
1072 | + } |
1073 | + |
1074 | + Expression* getChild() { |
1075 | + return expr; |
1076 | + } |
1077 | + |
1078 | + void setChild(Expression* expr) { |
1079 | + this->expr = expr; |
1080 | + } |
1081 | + |
1082 | + void setQuantifier(Quantifier q) { |
1083 | + quantifier = q; |
1084 | + } |
1085 | + private: |
1086 | + Quantifier quantifier; |
1087 | + Expression* expr; |
1088 | + }; |
1089 | + } |
1090 | } |
1091 | |
1092 | #endif /* AST_HPP_ */ |
1093 | |
1094 | === modified file 'src/Core/QueryParser/Generated/lexer.cpp' |
1095 | --- src/Core/QueryParser/Generated/lexer.cpp 2014-08-07 20:48:41 +0000 |
1096 | +++ src/Core/QueryParser/Generated/lexer.cpp 2018-01-07 20:09:44 +0000 |
1097 | @@ -9,7 +9,7 @@ |
1098 | #define FLEX_SCANNER |
1099 | #define YY_FLEX_MAJOR_VERSION 2 |
1100 | #define YY_FLEX_MINOR_VERSION 5 |
1101 | -#define YY_FLEX_SUBMINOR_VERSION 35 |
1102 | +#define YY_FLEX_SUBMINOR_VERSION 37 |
1103 | #if YY_FLEX_SUBMINOR_VERSION > 0 |
1104 | #define FLEX_BETA |
1105 | #endif |
1106 | @@ -47,7 +47,6 @@ |
1107 | typedef uint16_t flex_uint16_t; |
1108 | typedef int32_t flex_int32_t; |
1109 | typedef uint32_t flex_uint32_t; |
1110 | -typedef uint64_t flex_uint64_t; |
1111 | #else |
1112 | typedef signed char flex_int8_t; |
1113 | typedef short int flex_int16_t; |
1114 | @@ -55,7 +54,6 @@ |
1115 | typedef unsigned char flex_uint8_t; |
1116 | typedef unsigned short int flex_uint16_t; |
1117 | typedef unsigned int flex_uint32_t; |
1118 | -#endif /* ! C99 */ |
1119 | |
1120 | /* Limits of integral types. */ |
1121 | #ifndef INT8_MIN |
1122 | @@ -86,6 +84,8 @@ |
1123 | #define UINT32_MAX (4294967295U) |
1124 | #endif |
1125 | |
1126 | +#endif /* ! C99 */ |
1127 | + |
1128 | #endif /* ! FLEXINT_H */ |
1129 | |
1130 | #ifdef __cplusplus |
1131 | @@ -333,7 +333,7 @@ |
1132 | |
1133 | /* Begin user sect3 */ |
1134 | |
1135 | -#define yywrap(n) 1 |
1136 | +#define yywrap() 1 |
1137 | #define YY_SKIP_YYWRAP |
1138 | |
1139 | typedef unsigned char YY_CHAR; |
1140 | @@ -359,13 +359,13 @@ |
1141 | */ |
1142 | #define YY_DO_BEFORE_ACTION \ |
1143 | (yytext_ptr) = yy_bp; \ |
1144 | - yyleng = (yy_size_t) (yy_cp - yy_bp); \ |
1145 | + yyleng = (size_t) (yy_cp - yy_bp); \ |
1146 | (yy_hold_char) = *yy_cp; \ |
1147 | *yy_cp = '\0'; \ |
1148 | (yy_c_buf_p) = yy_cp; |
1149 | |
1150 | -#define YY_NUM_RULES 26 |
1151 | -#define YY_END_OF_BUFFER 27 |
1152 | +#define YY_NUM_RULES 28 |
1153 | +#define YY_END_OF_BUFFER 29 |
1154 | /* This struct is not used in this scanner, |
1155 | but its presence is necessary. */ |
1156 | struct yy_trans_info |
1157 | @@ -373,14 +373,15 @@ |
1158 | flex_int32_t yy_verify; |
1159 | flex_int32_t yy_nxt; |
1160 | }; |
1161 | -static yyconst flex_int16_t yy_accept[61] = |
1162 | +static yyconst flex_int16_t yy_accept[69] = |
1163 | { 0, |
1164 | - 0, 0, 27, 26, 1, 2, 13, 26, 20, 21, |
1165 | - 24, 22, 23, 3, 14, 16, 19, 25, 25, 25, |
1166 | - 25, 25, 25, 25, 26, 25, 25, 1, 2, 9, |
1167 | - 3, 15, 17, 18, 25, 25, 25, 25, 25, 8, |
1168 | - 25, 8, 6, 5, 4, 7, 9, 25, 25, 13, |
1169 | - 25, 25, 25, 10, 25, 11, 25, 25, 12, 0 |
1170 | + 0, 0, 29, 28, 1, 2, 14, 28, 21, 22, |
1171 | + 25, 23, 24, 3, 26, 15, 17, 20, 27, 27, |
1172 | + 27, 27, 27, 27, 27, 27, 28, 27, 27, 1, |
1173 | + 2, 10, 3, 16, 18, 19, 27, 6, 5, 27, |
1174 | + 27, 27, 27, 9, 27, 9, 4, 7, 27, 10, |
1175 | + 27, 27, 14, 27, 27, 27, 27, 11, 27, 27, |
1176 | + 12, 27, 27, 27, 27, 8, 13, 0 |
1177 | } ; |
1178 | |
1179 | static yyconst flex_int32_t yy_ec[256] = |
1180 | @@ -390,15 +391,15 @@ |
1181 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1182 | 1, 2, 4, 1, 1, 1, 1, 5, 1, 6, |
1183 | 7, 8, 9, 1, 10, 1, 1, 11, 11, 11, |
1184 | - 11, 11, 11, 11, 11, 11, 11, 1, 1, 12, |
1185 | - 13, 14, 1, 1, 15, 16, 16, 16, 17, 18, |
1186 | - 19, 16, 16, 16, 16, 16, 16, 16, 16, 16, |
1187 | - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, |
1188 | - 1, 1, 1, 1, 16, 1, 20, 16, 21, 22, |
1189 | + 11, 11, 11, 11, 11, 11, 11, 12, 1, 13, |
1190 | + 14, 15, 1, 1, 16, 17, 17, 17, 18, 19, |
1191 | + 20, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
1192 | + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
1193 | + 1, 1, 1, 1, 17, 1, 21, 17, 22, 23, |
1194 | |
1195 | - 23, 24, 16, 16, 16, 16, 25, 26, 16, 27, |
1196 | - 28, 16, 16, 29, 30, 31, 32, 16, 16, 16, |
1197 | - 16, 16, 1, 33, 1, 1, 1, 1, 1, 1, |
1198 | + 24, 25, 17, 17, 17, 17, 26, 27, 17, 28, |
1199 | + 29, 17, 17, 30, 31, 32, 33, 17, 17, 17, |
1200 | + 17, 17, 1, 34, 1, 1, 1, 1, 1, 1, |
1201 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1202 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1203 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1204 | @@ -415,66 +416,68 @@ |
1205 | 1, 1, 1, 1, 1 |
1206 | } ; |
1207 | |
1208 | -static yyconst flex_int32_t yy_meta[34] = |
1209 | +static yyconst flex_int32_t yy_meta[35] = |
1210 | { 0, |
1211 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1212 | - 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, |
1213 | + 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, |
1214 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
1215 | - 2, 2, 1 |
1216 | - } ; |
1217 | - |
1218 | -static yyconst flex_int16_t yy_base[62] = |
1219 | - { 0, |
1220 | - 0, 19, 71, 72, 68, 66, 72, 63, 72, 72, |
1221 | - 72, 72, 72, 56, 53, 52, 51, 0, 36, 39, |
1222 | - 41, 32, 30, 29, 24, 19, 21, 54, 52, 72, |
1223 | - 43, 72, 72, 72, 0, 31, 32, 25, 19, 0, |
1224 | - 17, 72, 0, 0, 0, 0, 0, 26, 17, 0, |
1225 | - 23, 19, 21, 0, 15, 0, 21, 16, 0, 72, |
1226 | - 33 |
1227 | - } ; |
1228 | - |
1229 | -static yyconst flex_int16_t yy_def[62] = |
1230 | - { 0, |
1231 | - 60, 1, 60, 60, 60, 60, 60, 60, 60, 60, |
1232 | - 60, 60, 60, 60, 60, 60, 60, 61, 61, 61, |
1233 | - 61, 61, 61, 61, 60, 61, 61, 60, 60, 60, |
1234 | - 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, |
1235 | - 61, 60, 61, 61, 61, 61, 61, 61, 61, 61, |
1236 | - 61, 61, 61, 61, 61, 61, 61, 61, 61, 0, |
1237 | - 60 |
1238 | - } ; |
1239 | - |
1240 | -static yyconst flex_int16_t yy_nxt[106] = |
1241 | + 2, 2, 2, 1 |
1242 | + } ; |
1243 | + |
1244 | +static yyconst flex_int16_t yy_base[70] = |
1245 | + { 0, |
1246 | + 0, 17, 78, 79, 75, 73, 79, 70, 79, 79, |
1247 | + 79, 79, 79, 63, 79, 59, 58, 57, 17, 0, |
1248 | + 42, 45, 47, 38, 36, 35, 30, 21, 34, 60, |
1249 | + 58, 79, 49, 79, 79, 79, 0, 0, 0, 36, |
1250 | + 37, 30, 24, 0, 22, 79, 0, 0, 26, 0, |
1251 | + 30, 21, 0, 27, 18, 22, 24, 0, 17, 17, |
1252 | + 0, 16, 22, 16, 16, 0, 0, 79, 36 |
1253 | + } ; |
1254 | + |
1255 | +static yyconst flex_int16_t yy_def[70] = |
1256 | + { 0, |
1257 | + 68, 1, 68, 68, 68, 68, 68, 68, 68, 68, |
1258 | + 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, |
1259 | + 69, 69, 69, 69, 69, 69, 68, 69, 69, 68, |
1260 | + 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, |
1261 | + 69, 69, 69, 69, 69, 68, 69, 69, 69, 69, |
1262 | + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, |
1263 | + 69, 69, 69, 69, 69, 69, 69, 0, 68 |
1264 | + } ; |
1265 | + |
1266 | +static yyconst flex_int16_t yy_nxt[114] = |
1267 | { 0, |
1268 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, |
1269 | - 14, 15, 16, 17, 18, 18, 18, 18, 18, 19, |
1270 | - 18, 20, 18, 21, 18, 18, 22, 23, 18, 18, |
1271 | - 24, 18, 25, 26, 35, 27, 43, 44, 45, 46, |
1272 | - 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, |
1273 | - 49, 48, 47, 31, 29, 28, 42, 41, 40, 39, |
1274 | - 38, 37, 36, 34, 33, 32, 31, 30, 29, 28, |
1275 | - 60, 3, 60, 60, 60, 60, 60, 60, 60, 60, |
1276 | - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
1277 | - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
1278 | + 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, |
1279 | + 21, 20, 22, 20, 23, 20, 20, 24, 25, 20, |
1280 | + 20, 26, 20, 27, 28, 38, 39, 37, 29, 47, |
1281 | + 48, 67, 66, 65, 64, 63, 62, 61, 60, 59, |
1282 | + 58, 57, 56, 55, 54, 53, 52, 51, 50, 33, |
1283 | + 31, 30, 49, 46, 45, 44, 43, 42, 41, 40, |
1284 | + 36, 35, 34, 33, 32, 31, 30, 68, 3, 68, |
1285 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1286 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1287 | |
1288 | - 60, 60, 60, 60, 60 |
1289 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1290 | + 68, 68, 68 |
1291 | } ; |
1292 | |
1293 | -static yyconst flex_int16_t yy_chk[106] = |
1294 | +static yyconst flex_int16_t yy_chk[114] = |
1295 | { 0, |
1296 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1297 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1298 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1299 | - 1, 1, 1, 2, 61, 2, 26, 26, 27, 27, |
1300 | - 58, 57, 55, 53, 52, 51, 49, 48, 41, 39, |
1301 | - 38, 37, 36, 31, 29, 28, 25, 24, 23, 22, |
1302 | - 21, 20, 19, 17, 16, 15, 14, 8, 6, 5, |
1303 | - 3, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
1304 | - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
1305 | - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, |
1306 | + 1, 1, 1, 1, 2, 19, 19, 69, 2, 28, |
1307 | + 28, 65, 64, 63, 62, 60, 59, 57, 56, 55, |
1308 | + 54, 52, 51, 49, 45, 43, 42, 41, 40, 33, |
1309 | + 31, 30, 29, 27, 26, 25, 24, 23, 22, 21, |
1310 | + 18, 17, 16, 14, 8, 6, 5, 3, 68, 68, |
1311 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1312 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1313 | |
1314 | - 60, 60, 60, 60, 60 |
1315 | + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
1316 | + 68, 68, 68 |
1317 | } ; |
1318 | |
1319 | static yy_state_type yy_last_accepting_state; |
1320 | @@ -510,7 +513,7 @@ |
1321 | #define yyterminate() return token::END |
1322 | #line 26 "src/Core/QueryParser/flex.ll" |
1323 | # define YY_USER_ACTION yylloc->columns (yyleng); |
1324 | -#line 514 "src/Core/QueryParser/Generated/lexer.cpp" |
1325 | +#line 517 "src/Core/QueryParser/Generated/lexer.cpp" |
1326 | |
1327 | #define INITIAL 0 |
1328 | |
1329 | @@ -597,7 +600,7 @@ |
1330 | /* This used to be an fputs(), but since the string might contain NUL's, |
1331 | * we now use fwrite(). |
1332 | */ |
1333 | -#define ECHO fwrite( yytext, yyleng, 1, yyout ) |
1334 | +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) |
1335 | #endif |
1336 | |
1337 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
1338 | @@ -608,7 +611,7 @@ |
1339 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
1340 | { \ |
1341 | int c = '*'; \ |
1342 | - yy_size_t n; \ |
1343 | + size_t n; \ |
1344 | for ( n = 0; n < max_size && \ |
1345 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
1346 | buf[n] = (char) c; \ |
1347 | @@ -698,7 +701,7 @@ |
1348 | |
1349 | yylloc->step (); |
1350 | |
1351 | -#line 702 "src/Core/QueryParser/Generated/lexer.cpp" |
1352 | +#line 705 "src/Core/QueryParser/Generated/lexer.cpp" |
1353 | |
1354 | if ( !(yy_init) ) |
1355 | { |
1356 | @@ -752,13 +755,13 @@ |
1357 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1358 | { |
1359 | yy_current_state = (int) yy_def[yy_current_state]; |
1360 | - if ( yy_current_state >= 61 ) |
1361 | + if ( yy_current_state >= 69 ) |
1362 | yy_c = yy_meta[(unsigned int) yy_c]; |
1363 | } |
1364 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
1365 | ++yy_cp; |
1366 | } |
1367 | - while ( yy_current_state != 60 ); |
1368 | + while ( yy_current_state != 68 ); |
1369 | yy_cp = (yy_last_accepting_cpos); |
1370 | yy_current_state = (yy_last_accepting_state); |
1371 | |
1372 | @@ -820,47 +823,47 @@ |
1373 | case 8: |
1374 | YY_RULE_SETUP |
1375 | #line 44 "src/Core/QueryParser/flex.ll" |
1376 | -{ return token::OR; } |
1377 | +{ return token::CONTROL; } |
1378 | YY_BREAK |
1379 | case 9: |
1380 | YY_RULE_SETUP |
1381 | #line 45 "src/Core/QueryParser/flex.ll" |
1382 | -{ return token::AND; } |
1383 | +{ return token::OR; } |
1384 | YY_BREAK |
1385 | case 10: |
1386 | YY_RULE_SETUP |
1387 | #line 46 "src/Core/QueryParser/flex.ll" |
1388 | -{ return token::BOOL_TRUE; } |
1389 | +{ return token::AND; } |
1390 | YY_BREAK |
1391 | case 11: |
1392 | YY_RULE_SETUP |
1393 | #line 47 "src/Core/QueryParser/flex.ll" |
1394 | -{ return token::BOOL_FALSE; } |
1395 | +{ return token::BOOL_TRUE; } |
1396 | YY_BREAK |
1397 | case 12: |
1398 | YY_RULE_SETUP |
1399 | #line 48 "src/Core/QueryParser/flex.ll" |
1400 | -{ return token::DEADLOCK; } |
1401 | +{ return token::BOOL_FALSE; } |
1402 | YY_BREAK |
1403 | case 13: |
1404 | YY_RULE_SETUP |
1405 | #line 49 "src/Core/QueryParser/flex.ll" |
1406 | -{ return token::NOT; } |
1407 | +{ return token::DEADLOCK; } |
1408 | YY_BREAK |
1409 | case 14: |
1410 | YY_RULE_SETUP |
1411 | #line 50 "src/Core/QueryParser/flex.ll" |
1412 | -{ yylval->string = new std::string(yytext); return token::LESS; } |
1413 | +{ return token::NOT; } |
1414 | YY_BREAK |
1415 | case 15: |
1416 | YY_RULE_SETUP |
1417 | #line 51 "src/Core/QueryParser/flex.ll" |
1418 | -{ yylval->string = new std::string(yytext); return token::LESSEQUAL; } |
1419 | +{ yylval->string = new std::string(yytext); return token::LESS; } |
1420 | YY_BREAK |
1421 | case 16: |
1422 | YY_RULE_SETUP |
1423 | #line 52 "src/Core/QueryParser/flex.ll" |
1424 | -{ yylval->string = new std::string(yytext); return token::EQUAL; } |
1425 | +{ yylval->string = new std::string(yytext); return token::LESSEQUAL; } |
1426 | YY_BREAK |
1427 | case 17: |
1428 | YY_RULE_SETUP |
1429 | @@ -870,49 +873,59 @@ |
1430 | case 18: |
1431 | YY_RULE_SETUP |
1432 | #line 54 "src/Core/QueryParser/flex.ll" |
1433 | -{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; } |
1434 | +{ yylval->string = new std::string(yytext); return token::EQUAL; } |
1435 | YY_BREAK |
1436 | case 19: |
1437 | YY_RULE_SETUP |
1438 | #line 55 "src/Core/QueryParser/flex.ll" |
1439 | -{ yylval->string = new std::string(yytext); return token::GREATER; } |
1440 | +{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; } |
1441 | YY_BREAK |
1442 | case 20: |
1443 | YY_RULE_SETUP |
1444 | #line 56 "src/Core/QueryParser/flex.ll" |
1445 | -{return token::LPARAN;} |
1446 | +{ yylval->string = new std::string(yytext); return token::GREATER; } |
1447 | YY_BREAK |
1448 | case 21: |
1449 | YY_RULE_SETUP |
1450 | #line 57 "src/Core/QueryParser/flex.ll" |
1451 | -{return token::RPARAN;} |
1452 | +{return token::LPARAN;} |
1453 | YY_BREAK |
1454 | case 22: |
1455 | YY_RULE_SETUP |
1456 | #line 58 "src/Core/QueryParser/flex.ll" |
1457 | -{return token::PLUS;} |
1458 | +{return token::RPARAN;} |
1459 | YY_BREAK |
1460 | case 23: |
1461 | YY_RULE_SETUP |
1462 | #line 59 "src/Core/QueryParser/flex.ll" |
1463 | -{return token::MINUS;} |
1464 | +{return token::PLUS;} |
1465 | YY_BREAK |
1466 | case 24: |
1467 | YY_RULE_SETUP |
1468 | #line 60 "src/Core/QueryParser/flex.ll" |
1469 | +{return token::MINUS;} |
1470 | + YY_BREAK |
1471 | +case 25: |
1472 | +YY_RULE_SETUP |
1473 | +#line 61 "src/Core/QueryParser/flex.ll" |
1474 | {return token::MULTIPLY;} |
1475 | YY_BREAK |
1476 | -case 25: |
1477 | +case 26: |
1478 | YY_RULE_SETUP |
1479 | #line 62 "src/Core/QueryParser/flex.ll" |
1480 | +{return token::COLON;} |
1481 | + YY_BREAK |
1482 | +case 27: |
1483 | +YY_RULE_SETUP |
1484 | +#line 64 "src/Core/QueryParser/flex.ll" |
1485 | { yylval->string = new std::string(yytext); return token::IDENTIFIER; } |
1486 | YY_BREAK |
1487 | -case 26: |
1488 | +case 28: |
1489 | YY_RULE_SETUP |
1490 | -#line 64 "src/Core/QueryParser/flex.ll" |
1491 | +#line 66 "src/Core/QueryParser/flex.ll" |
1492 | ECHO; |
1493 | YY_BREAK |
1494 | -#line 916 "src/Core/QueryParser/Generated/lexer.cpp" |
1495 | +#line 929 "src/Core/QueryParser/Generated/lexer.cpp" |
1496 | case YY_STATE_EOF(INITIAL): |
1497 | yyterminate(); |
1498 | |
1499 | @@ -1106,7 +1119,7 @@ |
1500 | { /* Not enough room in the buffer - grow it. */ |
1501 | |
1502 | /* just a shorter name for the current buffer */ |
1503 | - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; |
1504 | + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
1505 | |
1506 | int yy_c_buf_p_offset = |
1507 | (int) ((yy_c_buf_p) - b->yy_ch_buf); |
1508 | @@ -1206,7 +1219,7 @@ |
1509 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1510 | { |
1511 | yy_current_state = (int) yy_def[yy_current_state]; |
1512 | - if ( yy_current_state >= 61 ) |
1513 | + if ( yy_current_state >= 69 ) |
1514 | yy_c = yy_meta[(unsigned int) yy_c]; |
1515 | } |
1516 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
1517 | @@ -1234,13 +1247,13 @@ |
1518 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1519 | { |
1520 | yy_current_state = (int) yy_def[yy_current_state]; |
1521 | - if ( yy_current_state >= 61 ) |
1522 | + if ( yy_current_state >= 69 ) |
1523 | yy_c = yy_meta[(unsigned int) yy_c]; |
1524 | } |
1525 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
1526 | - yy_is_jam = (yy_current_state == 60); |
1527 | + yy_is_jam = (yy_current_state == 68); |
1528 | |
1529 | - return yy_is_jam ? 0 : yy_current_state; |
1530 | + return yy_is_jam ? 0 : yy_current_state; |
1531 | } |
1532 | |
1533 | #ifndef YY_NO_INPUT |
1534 | @@ -1291,7 +1304,7 @@ |
1535 | case EOB_ACT_END_OF_FILE: |
1536 | { |
1537 | if ( yywrap( ) ) |
1538 | - return 0; |
1539 | + return EOF; |
1540 | |
1541 | if ( ! (yy_did_buffer_switch_on_eof) ) |
1542 | YY_NEW_FILE; |
1543 | @@ -1429,10 +1442,6 @@ |
1544 | yyfree((void *) b ); |
1545 | } |
1546 | |
1547 | -#ifndef __cplusplus |
1548 | -extern int isatty (int ); |
1549 | -#endif /* __cplusplus */ |
1550 | - |
1551 | /* Initializes or reinitializes a buffer. |
1552 | * This function is sometimes called more than once on the same buffer, |
1553 | * such as during a yyrestart() or at EOF. |
1554 | @@ -1637,8 +1646,8 @@ |
1555 | |
1556 | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
1557 | * scan from a @e copy of @a bytes. |
1558 | - * @param bytes the byte buffer to scan |
1559 | - * @param len the number of bytes in the buffer pointed to by @a bytes. |
1560 | + * @param yybytes the byte buffer to scan |
1561 | + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
1562 | * |
1563 | * @return the newly allocated buffer state object. |
1564 | */ |
1565 | @@ -1646,7 +1655,8 @@ |
1566 | { |
1567 | YY_BUFFER_STATE b; |
1568 | char *buf; |
1569 | - yy_size_t n, i; |
1570 | + yy_size_t n; |
1571 | + yy_size_t i; |
1572 | |
1573 | /* Get memory for full buffer, including space for trailing EOB's. */ |
1574 | n = _yybytes_len + 2; |
1575 | @@ -1876,7 +1886,7 @@ |
1576 | |
1577 | #define YYTABLES_NAME "yytables" |
1578 | |
1579 | -#line 64 "src/Core/QueryParser/flex.ll" |
1580 | +#line 66 "src/Core/QueryParser/flex.ll" |
1581 | |
1582 | |
1583 | namespace VerifyTAPN |
1584 | |
1585 | === modified file 'src/Core/QueryParser/Generated/location.hh' |
1586 | --- src/Core/QueryParser/Generated/location.hh 2014-08-07 20:48:41 +0000 |
1587 | +++ src/Core/QueryParser/Generated/location.hh 2018-01-07 20:09:44 +0000 |
1588 | @@ -1,72 +1,83 @@ |
1589 | - |
1590 | -/* A Bison parser, made by GNU Bison 2.4.1. */ |
1591 | - |
1592 | -/* Locations for Bison parsers in C++ |
1593 | - |
1594 | - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
1595 | - |
1596 | - This program is free software: you can redistribute it and/or modify |
1597 | - it under the terms of the GNU General Public License as published by |
1598 | - the Free Software Foundation, either version 3 of the License, or |
1599 | - (at your option) any later version. |
1600 | - |
1601 | - This program is distributed in the hope that it will be useful, |
1602 | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
1603 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1604 | - GNU General Public License for more details. |
1605 | - |
1606 | - You should have received a copy of the GNU General Public License |
1607 | - along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1608 | - |
1609 | -/* As a special exception, you may create a larger work that contains |
1610 | - part or all of the Bison parser skeleton and distribute that work |
1611 | - under terms of your choice, so long as that work isn't itself a |
1612 | - parser generator using the skeleton or a modified version thereof |
1613 | - as a parser skeleton. Alternatively, if you modify or redistribute |
1614 | - the parser skeleton itself, you may (at your option) remove this |
1615 | - special exception, which will cause the skeleton and the resulting |
1616 | - Bison output files to be licensed under the GNU General Public |
1617 | - License without this special exception. |
1618 | - |
1619 | - This special exception was added by the Free Software Foundation in |
1620 | - version 2.2 of Bison. */ |
1621 | +// A Bison parser, made by GNU Bison 3.0.2. |
1622 | + |
1623 | +// Locations for Bison parsers in C++ |
1624 | + |
1625 | +// Copyright (C) 2002-2013 Free Software Foundation, Inc. |
1626 | + |
1627 | +// This program is free software: you can redistribute it and/or modify |
1628 | +// it under the terms of the GNU General Public License as published by |
1629 | +// the Free Software Foundation, either version 3 of the License, or |
1630 | +// (at your option) any later version. |
1631 | + |
1632 | +// This program is distributed in the hope that it will be useful, |
1633 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1634 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1635 | +// GNU General Public License for more details. |
1636 | + |
1637 | +// You should have received a copy of the GNU General Public License |
1638 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
1639 | + |
1640 | +// As a special exception, you may create a larger work that contains |
1641 | +// part or all of the Bison parser skeleton and distribute that work |
1642 | +// under terms of your choice, so long as that work isn't itself a |
1643 | +// parser generator using the skeleton or a modified version thereof |
1644 | +// as a parser skeleton. Alternatively, if you modify or redistribute |
1645 | +// the parser skeleton itself, you may (at your option) remove this |
1646 | +// special exception, which will cause the skeleton and the resulting |
1647 | +// Bison output files to be licensed under the GNU General Public |
1648 | +// License without this special exception. |
1649 | + |
1650 | +// This special exception was added by the Free Software Foundation in |
1651 | +// version 2.2 of Bison. |
1652 | |
1653 | /** |
1654 | - ** \file location.hh |
1655 | + ** \file src/Core/QueryParser/Generated/location.hh |
1656 | ** Define the VerifyTAPN::location class. |
1657 | */ |
1658 | |
1659 | -#ifndef BISON_LOCATION_HH |
1660 | -# define BISON_LOCATION_HH |
1661 | +#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED |
1662 | +# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED |
1663 | |
1664 | -# include <iostream> |
1665 | -# include <string> |
1666 | # include "position.hh" |
1667 | |
1668 | - |
1669 | -/* Line 162 of location.cc */ |
1670 | -#line 5 "src/Core/QueryParser/grammar.yy" |
1671 | +#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291 |
1672 | namespace VerifyTAPN { |
1673 | - |
1674 | -/* Line 162 of location.cc */ |
1675 | -#line 53 "src/Core/QueryParser/Generated/location.hh" |
1676 | - |
1677 | +#line 46 "src/Core/QueryParser/Generated/location.hh" // location.cc:291 |
1678 | /// Abstract a location. |
1679 | class location |
1680 | { |
1681 | public: |
1682 | |
1683 | - /// Construct a location. |
1684 | - location () |
1685 | - : begin (), end () |
1686 | + /// Construct a location from \a b to \a e. |
1687 | + location (const position& b, const position& e) |
1688 | + : begin (b) |
1689 | + , end (e) |
1690 | + { |
1691 | + } |
1692 | + |
1693 | + /// Construct a 0-width location in \a p. |
1694 | + explicit location (const position& p = position ()) |
1695 | + : begin (p) |
1696 | + , end (p) |
1697 | + { |
1698 | + } |
1699 | + |
1700 | + /// Construct a 0-width location in \a f, \a l, \a c. |
1701 | + explicit location (std::string* f, |
1702 | + unsigned int l = 1u, |
1703 | + unsigned int c = 1u) |
1704 | + : begin (f, l, c) |
1705 | + , end (f, l, c) |
1706 | { |
1707 | } |
1708 | |
1709 | |
1710 | /// Initialization. |
1711 | - inline void initialize (std::string* fn) |
1712 | + void initialize (std::string* f = YY_NULLPTR, |
1713 | + unsigned int l = 1u, |
1714 | + unsigned int c = 1u) |
1715 | { |
1716 | - begin.initialize (fn); |
1717 | + begin.initialize (f, l, c); |
1718 | end = begin; |
1719 | } |
1720 | |
1721 | @@ -74,19 +85,19 @@ |
1722 | ** \{ */ |
1723 | public: |
1724 | /// Reset initial location to final location. |
1725 | - inline void step () |
1726 | + void step () |
1727 | { |
1728 | begin = end; |
1729 | } |
1730 | |
1731 | /// Extend the current location to the COUNT next columns. |
1732 | - inline void columns (unsigned int count = 1) |
1733 | + void columns (int count = 1) |
1734 | { |
1735 | end += count; |
1736 | } |
1737 | |
1738 | /// Extend the current location to the COUNT next lines. |
1739 | - inline void lines (unsigned int count = 1) |
1740 | + void lines (int count = 1) |
1741 | { |
1742 | end.lines (count); |
1743 | } |
1744 | @@ -101,26 +112,35 @@ |
1745 | }; |
1746 | |
1747 | /// Join two location objects to create a location. |
1748 | - inline const location operator+ (const location& begin, const location& end) |
1749 | + inline location operator+ (location res, const location& end) |
1750 | { |
1751 | - location res = begin; |
1752 | res.end = end.end; |
1753 | return res; |
1754 | } |
1755 | |
1756 | - /// Add two location objects. |
1757 | - inline const location operator+ (const location& begin, unsigned int width) |
1758 | - { |
1759 | - location res = begin; |
1760 | - res.columns (width); |
1761 | - return res; |
1762 | - } |
1763 | - |
1764 | - /// Add and assign a location. |
1765 | - inline location& operator+= (location& res, unsigned int width) |
1766 | - { |
1767 | - res.columns (width); |
1768 | - return res; |
1769 | + /// Change end position in place. |
1770 | + inline location& operator+= (location& res, int width) |
1771 | + { |
1772 | + res.columns (width); |
1773 | + return res; |
1774 | + } |
1775 | + |
1776 | + /// Change end position. |
1777 | + inline location operator+ (location res, int width) |
1778 | + { |
1779 | + return res += width; |
1780 | + } |
1781 | + |
1782 | + /// Change end position in place. |
1783 | + inline location& operator-= (location& res, int width) |
1784 | + { |
1785 | + return res += -width; |
1786 | + } |
1787 | + |
1788 | + /// Change end position. |
1789 | + inline location operator- (const location& begin, int width) |
1790 | + { |
1791 | + return begin + -width; |
1792 | } |
1793 | |
1794 | /// Compare two location objects. |
1795 | @@ -143,27 +163,25 @@ |
1796 | ** |
1797 | ** Avoid duplicate information. |
1798 | */ |
1799 | - inline std::ostream& operator<< (std::ostream& ostr, const location& loc) |
1800 | + template <typename YYChar> |
1801 | + inline std::basic_ostream<YYChar>& |
1802 | + operator<< (std::basic_ostream<YYChar>& ostr, const location& loc) |
1803 | { |
1804 | - position last = loc.end - 1; |
1805 | - ostr << loc.begin; |
1806 | - if (last.filename |
1807 | - && (!loc.begin.filename |
1808 | - || *loc.begin.filename != *last.filename)) |
1809 | - ostr << '-' << last; |
1810 | - else if (loc.begin.line != last.line) |
1811 | - ostr << '-' << last.line << '.' << last.column; |
1812 | - else if (loc.begin.column != last.column) |
1813 | - ostr << '-' << last.column; |
1814 | + unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; |
1815 | + ostr << loc.begin// << "(" << loc.end << ") " |
1816 | +; |
1817 | + if (loc.end.filename |
1818 | + && (!loc.begin.filename |
1819 | + || *loc.begin.filename != *loc.end.filename)) |
1820 | + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; |
1821 | + else if (loc.begin.line < loc.end.line) |
1822 | + ostr << '-' << loc.end.line << '.' << end_col; |
1823 | + else if (loc.begin.column < end_col) |
1824 | + ostr << '-' << end_col; |
1825 | return ostr; |
1826 | } |
1827 | |
1828 | - |
1829 | -/* Line 271 of location.cc */ |
1830 | -#line 5 "src/Core/QueryParser/grammar.yy" |
1831 | +#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291 |
1832 | } // VerifyTAPN |
1833 | - |
1834 | -/* Line 271 of location.cc */ |
1835 | -#line 168 "src/Core/QueryParser/Generated/location.hh" |
1836 | - |
1837 | -#endif // not BISON_LOCATION_HH |
1838 | +#line 187 "src/Core/QueryParser/Generated/location.hh" // location.cc:291 |
1839 | +#endif // !YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED |
1840 | |
1841 | === modified file 'src/Core/QueryParser/Generated/parser.cpp' |
1842 | --- src/Core/QueryParser/Generated/parser.cpp 2014-08-07 20:48:41 +0000 |
1843 | +++ src/Core/QueryParser/Generated/parser.cpp 2018-01-07 20:09:44 +0000 |
1844 | @@ -1,68 +1,65 @@ |
1845 | - |
1846 | -/* A Bison parser, made by GNU Bison 2.4.1. */ |
1847 | - |
1848 | -/* Skeleton implementation for Bison LALR(1) parsers in C++ |
1849 | - |
1850 | - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software |
1851 | - Foundation, Inc. |
1852 | - |
1853 | - This program is free software: you can redistribute it and/or modify |
1854 | - it under the terms of the GNU General Public License as published by |
1855 | - the Free Software Foundation, either version 3 of the License, or |
1856 | - (at your option) any later version. |
1857 | - |
1858 | - This program is distributed in the hope that it will be useful, |
1859 | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
1860 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1861 | - GNU General Public License for more details. |
1862 | - |
1863 | - You should have received a copy of the GNU General Public License |
1864 | - along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
1865 | - |
1866 | -/* As a special exception, you may create a larger work that contains |
1867 | - part or all of the Bison parser skeleton and distribute that work |
1868 | - under terms of your choice, so long as that work isn't itself a |
1869 | - parser generator using the skeleton or a modified version thereof |
1870 | - as a parser skeleton. Alternatively, if you modify or redistribute |
1871 | - the parser skeleton itself, you may (at your option) remove this |
1872 | - special exception, which will cause the skeleton and the resulting |
1873 | - Bison output files to be licensed under the GNU General Public |
1874 | - License without this special exception. |
1875 | - |
1876 | - This special exception was added by the Free Software Foundation in |
1877 | - version 2.2 of Bison. */ |
1878 | - |
1879 | - |
1880 | -/* First part of user declarations. */ |
1881 | - |
1882 | - |
1883 | -/* Line 311 of lalr1.cc */ |
1884 | -#line 41 "src/Core/QueryParser/Generated/parser.cpp" |
1885 | - |
1886 | +// A Bison parser, made by GNU Bison 3.0.2. |
1887 | + |
1888 | +// Skeleton implementation for Bison LALR(1) parsers in C++ |
1889 | + |
1890 | +// Copyright (C) 2002-2013 Free Software Foundation, Inc. |
1891 | + |
1892 | +// This program is free software: you can redistribute it and/or modify |
1893 | +// it under the terms of the GNU General Public License as published by |
1894 | +// the Free Software Foundation, either version 3 of the License, or |
1895 | +// (at your option) any later version. |
1896 | + |
1897 | +// This program is distributed in the hope that it will be useful, |
1898 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1899 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1900 | +// GNU General Public License for more details. |
1901 | + |
1902 | +// You should have received a copy of the GNU General Public License |
1903 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
1904 | + |
1905 | +// As a special exception, you may create a larger work that contains |
1906 | +// part or all of the Bison parser skeleton and distribute that work |
1907 | +// under terms of your choice, so long as that work isn't itself a |
1908 | +// parser generator using the skeleton or a modified version thereof |
1909 | +// as a parser skeleton. Alternatively, if you modify or redistribute |
1910 | +// the parser skeleton itself, you may (at your option) remove this |
1911 | +// special exception, which will cause the skeleton and the resulting |
1912 | +// Bison output files to be licensed under the GNU General Public |
1913 | +// License without this special exception. |
1914 | + |
1915 | +// This special exception was added by the Free Software Foundation in |
1916 | +// version 2.2 of Bison. |
1917 | + |
1918 | + |
1919 | +// First part of user declarations. |
1920 | + |
1921 | +#line 37 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:399 |
1922 | + |
1923 | +# ifndef YY_NULLPTR |
1924 | +# if defined __cplusplus && 201103L <= __cplusplus |
1925 | +# define YY_NULLPTR nullptr |
1926 | +# else |
1927 | +# define YY_NULLPTR 0 |
1928 | +# endif |
1929 | +# endif |
1930 | |
1931 | #include "parser.hpp" |
1932 | |
1933 | -/* User implementation prologue. */ |
1934 | - |
1935 | - |
1936 | -/* Line 317 of lalr1.cc */ |
1937 | -#line 50 "src/Core/QueryParser/Generated/parser.cpp" |
1938 | -/* Unqualified %code blocks. */ |
1939 | - |
1940 | -/* Line 318 of lalr1.cc */ |
1941 | -#line 38 "src/Core/QueryParser/grammar.yy" |
1942 | +// User implementation prologue. |
1943 | + |
1944 | +#line 51 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:407 |
1945 | +// Unqualified %code blocks. |
1946 | +#line 38 "src/Core/QueryParser/grammar.yy" // lalr1.cc:408 |
1947 | |
1948 | #include "../TAPNQueryParser.hpp" |
1949 | |
1950 | - |
1951 | - |
1952 | -/* Line 318 of lalr1.cc */ |
1953 | -#line 61 "src/Core/QueryParser/Generated/parser.cpp" |
1954 | +#line 57 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:408 |
1955 | + |
1956 | |
1957 | #ifndef YY_ |
1958 | -# if YYENABLE_NLS |
1959 | +# if defined YYENABLE_NLS && YYENABLE_NLS |
1960 | # if ENABLE_NLS |
1961 | -# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ |
1962 | +# include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE. |
1963 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
1964 | # endif |
1965 | # endif |
1966 | @@ -71,62 +68,78 @@ |
1967 | # endif |
1968 | #endif |
1969 | |
1970 | -/* Suppress unused-variable warnings by "using" E. */ |
1971 | -#define YYUSE(e) ((void) (e)) |
1972 | - |
1973 | -/* Enable debugging if requested. */ |
1974 | +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) |
1975 | +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
1976 | + If N is 0, then set CURRENT to the empty location which ends |
1977 | + the previous symbol: RHS[0] (always defined). */ |
1978 | + |
1979 | +# ifndef YYLLOC_DEFAULT |
1980 | +# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
1981 | + do \ |
1982 | + if (N) \ |
1983 | + { \ |
1984 | + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ |
1985 | + (Current).end = YYRHSLOC (Rhs, N).end; \ |
1986 | + } \ |
1987 | + else \ |
1988 | + { \ |
1989 | + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ |
1990 | + } \ |
1991 | + while (/*CONSTCOND*/ false) |
1992 | +# endif |
1993 | + |
1994 | + |
1995 | +// Suppress unused-variable warnings by "using" E. |
1996 | +#define YYUSE(E) ((void) (E)) |
1997 | + |
1998 | +// Enable debugging if requested. |
1999 | #if YYDEBUG |
2000 | |
2001 | -/* A pseudo ostream that takes yydebug_ into account. */ |
2002 | +// A pseudo ostream that takes yydebug_ into account. |
2003 | # define YYCDEBUG if (yydebug_) (*yycdebug_) |
2004 | |
2005 | -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
2006 | -do { \ |
2007 | - if (yydebug_) \ |
2008 | - { \ |
2009 | - *yycdebug_ << Title << ' '; \ |
2010 | - yy_symbol_print_ ((Type), (Value), (Location)); \ |
2011 | - *yycdebug_ << std::endl; \ |
2012 | - } \ |
2013 | -} while (false) |
2014 | - |
2015 | -# define YY_REDUCE_PRINT(Rule) \ |
2016 | -do { \ |
2017 | - if (yydebug_) \ |
2018 | - yy_reduce_print_ (Rule); \ |
2019 | -} while (false) |
2020 | - |
2021 | -# define YY_STACK_PRINT() \ |
2022 | -do { \ |
2023 | - if (yydebug_) \ |
2024 | - yystack_print_ (); \ |
2025 | -} while (false) |
2026 | - |
2027 | -#else /* !YYDEBUG */ |
2028 | +# define YY_SYMBOL_PRINT(Title, Symbol) \ |
2029 | + do { \ |
2030 | + if (yydebug_) \ |
2031 | + { \ |
2032 | + *yycdebug_ << Title << ' '; \ |
2033 | + yy_print_ (*yycdebug_, Symbol); \ |
2034 | + *yycdebug_ << std::endl; \ |
2035 | + } \ |
2036 | + } while (false) |
2037 | + |
2038 | +# define YY_REDUCE_PRINT(Rule) \ |
2039 | + do { \ |
2040 | + if (yydebug_) \ |
2041 | + yy_reduce_print_ (Rule); \ |
2042 | + } while (false) |
2043 | + |
2044 | +# define YY_STACK_PRINT() \ |
2045 | + do { \ |
2046 | + if (yydebug_) \ |
2047 | + yystack_print_ (); \ |
2048 | + } while (false) |
2049 | + |
2050 | +#else // !YYDEBUG |
2051 | |
2052 | # define YYCDEBUG if (false) std::cerr |
2053 | -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
2054 | -# define YY_REDUCE_PRINT(Rule) |
2055 | -# define YY_STACK_PRINT() |
2056 | - |
2057 | -#endif /* !YYDEBUG */ |
2058 | - |
2059 | -#define yyerrok (yyerrstatus_ = 0) |
2060 | -#define yyclearin (yychar = yyempty_) |
2061 | - |
2062 | -#define YYACCEPT goto yyacceptlab |
2063 | -#define YYABORT goto yyabortlab |
2064 | -#define YYERROR goto yyerrorlab |
2065 | +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol) |
2066 | +# define YY_REDUCE_PRINT(Rule) static_cast<void>(0) |
2067 | +# define YY_STACK_PRINT() static_cast<void>(0) |
2068 | + |
2069 | +#endif // !YYDEBUG |
2070 | + |
2071 | +#define yyerrok (yyerrstatus_ = 0) |
2072 | +#define yyclearin (yyempty = true) |
2073 | + |
2074 | +#define YYACCEPT goto yyacceptlab |
2075 | +#define YYABORT goto yyabortlab |
2076 | +#define YYERROR goto yyerrorlab |
2077 | #define YYRECOVERING() (!!yyerrstatus_) |
2078 | |
2079 | - |
2080 | -/* Line 380 of lalr1.cc */ |
2081 | -#line 5 "src/Core/QueryParser/grammar.yy" |
2082 | +#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:474 |
2083 | namespace VerifyTAPN { |
2084 | - |
2085 | -/* Line 380 of lalr1.cc */ |
2086 | -#line 129 "src/Core/QueryParser/Generated/parser.cpp" |
2087 | -#if YYERROR_VERBOSE |
2088 | +#line 143 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:474 |
2089 | |
2090 | /* Return YYSTR after stripping away unnecessary quotes and |
2091 | backslashes, so that it's suitable for yyerror. The heuristic is |
2092 | @@ -151,7 +164,7 @@ |
2093 | case '\\': |
2094 | if (*++yyp != '\\') |
2095 | goto do_not_strip_quotes; |
2096 | - /* Fall through. */ |
2097 | + // Fall through. |
2098 | default: |
2099 | yyr += *yyp; |
2100 | break; |
2101 | @@ -165,7 +178,6 @@ |
2102 | return yystr; |
2103 | } |
2104 | |
2105 | -#endif |
2106 | |
2107 | /// Build a parser object. |
2108 | Parser::Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg) |
2109 | @@ -175,230 +187,344 @@ |
2110 | yycdebug_ (&std::cerr), |
2111 | #endif |
2112 | driver (driver_yyarg) |
2113 | - { |
2114 | - } |
2115 | + {} |
2116 | |
2117 | Parser::~Parser () |
2118 | - { |
2119 | + {} |
2120 | + |
2121 | + |
2122 | + /*---------------. |
2123 | + | Symbol types. | |
2124 | + `---------------*/ |
2125 | + |
2126 | + inline |
2127 | + Parser::syntax_error::syntax_error (const location_type& l, const std::string& m) |
2128 | + : std::runtime_error (m) |
2129 | + , location (l) |
2130 | + {} |
2131 | + |
2132 | + // basic_symbol. |
2133 | + template <typename Base> |
2134 | + inline |
2135 | + Parser::basic_symbol<Base>::basic_symbol () |
2136 | + : value () |
2137 | + {} |
2138 | + |
2139 | + template <typename Base> |
2140 | + inline |
2141 | + Parser::basic_symbol<Base>::basic_symbol (const basic_symbol& other) |
2142 | + : Base (other) |
2143 | + , value () |
2144 | + , location (other.location) |
2145 | + { |
2146 | + value = other.value; |
2147 | + } |
2148 | + |
2149 | + |
2150 | + template <typename Base> |
2151 | + inline |
2152 | + Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l) |
2153 | + : Base (t) |
2154 | + , value (v) |
2155 | + , location (l) |
2156 | + {} |
2157 | + |
2158 | + |
2159 | + /// Constructor for valueless symbols. |
2160 | + template <typename Base> |
2161 | + inline |
2162 | + Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l) |
2163 | + : Base (t) |
2164 | + , value () |
2165 | + , location (l) |
2166 | + {} |
2167 | + |
2168 | + template <typename Base> |
2169 | + inline |
2170 | + Parser::basic_symbol<Base>::~basic_symbol () |
2171 | + { |
2172 | + } |
2173 | + |
2174 | + template <typename Base> |
2175 | + inline |
2176 | + void |
2177 | + Parser::basic_symbol<Base>::move (basic_symbol& s) |
2178 | + { |
2179 | + super_type::move(s); |
2180 | + value = s.value; |
2181 | + location = s.location; |
2182 | + } |
2183 | + |
2184 | + // by_type. |
2185 | + inline |
2186 | + Parser::by_type::by_type () |
2187 | + : type (empty) |
2188 | + {} |
2189 | + |
2190 | + inline |
2191 | + Parser::by_type::by_type (const by_type& other) |
2192 | + : type (other.type) |
2193 | + {} |
2194 | + |
2195 | + inline |
2196 | + Parser::by_type::by_type (token_type t) |
2197 | + : type (yytranslate_ (t)) |
2198 | + {} |
2199 | + |
2200 | + inline |
2201 | + void |
2202 | + Parser::by_type::move (by_type& that) |
2203 | + { |
2204 | + type = that.type; |
2205 | + that.type = empty; |
2206 | + } |
2207 | + |
2208 | + inline |
2209 | + int |
2210 | + Parser::by_type::type_get () const |
2211 | + { |
2212 | + return type; |
2213 | + } |
2214 | + |
2215 | + |
2216 | + // by_state. |
2217 | + inline |
2218 | + Parser::by_state::by_state () |
2219 | + : state (empty) |
2220 | + {} |
2221 | + |
2222 | + inline |
2223 | + Parser::by_state::by_state (const by_state& other) |
2224 | + : state (other.state) |
2225 | + {} |
2226 | + |
2227 | + inline |
2228 | + void |
2229 | + Parser::by_state::move (by_state& that) |
2230 | + { |
2231 | + state = that.state; |
2232 | + that.state = empty; |
2233 | + } |
2234 | + |
2235 | + inline |
2236 | + Parser::by_state::by_state (state_type s) |
2237 | + : state (s) |
2238 | + {} |
2239 | + |
2240 | + inline |
2241 | + Parser::symbol_number_type |
2242 | + Parser::by_state::type_get () const |
2243 | + { |
2244 | + return state == empty ? 0 : yystos_[state]; |
2245 | + } |
2246 | + |
2247 | + inline |
2248 | + Parser::stack_symbol_type::stack_symbol_type () |
2249 | + {} |
2250 | + |
2251 | + |
2252 | + inline |
2253 | + Parser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) |
2254 | + : super_type (s, that.location) |
2255 | + { |
2256 | + value = that.value; |
2257 | + // that is emptied. |
2258 | + that.type = empty; |
2259 | + } |
2260 | + |
2261 | + inline |
2262 | + Parser::stack_symbol_type& |
2263 | + Parser::stack_symbol_type::operator= (const stack_symbol_type& that) |
2264 | + { |
2265 | + state = that.state; |
2266 | + value = that.value; |
2267 | + location = that.location; |
2268 | + return *this; |
2269 | + } |
2270 | + |
2271 | + |
2272 | + template <typename Base> |
2273 | + inline |
2274 | + void |
2275 | + Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const |
2276 | + { |
2277 | + if (yymsg) |
2278 | + YY_SYMBOL_PRINT (yymsg, yysym); |
2279 | + |
2280 | + // User destructor. |
2281 | + switch (yysym.type_get ()) |
2282 | + { |
2283 | + case 3: // IDENTIFIER |
2284 | + |
2285 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2286 | + { delete (yysym.value.string); } |
2287 | +#line 362 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2288 | + break; |
2289 | + |
2290 | + case 4: // LESS |
2291 | + |
2292 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2293 | + { delete (yysym.value.string); } |
2294 | +#line 369 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2295 | + break; |
2296 | + |
2297 | + case 5: // LESSEQUAL |
2298 | + |
2299 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2300 | + { delete (yysym.value.string); } |
2301 | +#line 376 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2302 | + break; |
2303 | + |
2304 | + case 6: // EQUAL |
2305 | + |
2306 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2307 | + { delete (yysym.value.string); } |
2308 | +#line 383 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2309 | + break; |
2310 | + |
2311 | + case 7: // GREATEREQUAL |
2312 | + |
2313 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2314 | + { delete (yysym.value.string); } |
2315 | +#line 390 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2316 | + break; |
2317 | + |
2318 | + case 8: // GREATER |
2319 | + |
2320 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2321 | + { delete (yysym.value.string); } |
2322 | +#line 397 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2323 | + break; |
2324 | + |
2325 | + case 28: // query |
2326 | + |
2327 | +#line 58 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2328 | + { delete (yysym.value.query); } |
2329 | +#line 404 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2330 | + break; |
2331 | + |
2332 | + case 29: // expression |
2333 | + |
2334 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2335 | + { delete (yysym.value.expr); } |
2336 | +#line 411 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2337 | + break; |
2338 | + |
2339 | + case 30: // arithmeticExpression |
2340 | + |
2341 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2342 | + { delete (yysym.value.arexpr); } |
2343 | +#line 418 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2344 | + break; |
2345 | + |
2346 | + case 31: // multiplyExpression |
2347 | + |
2348 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2349 | + { delete (yysym.value.arexpr); } |
2350 | +#line 425 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2351 | + break; |
2352 | + |
2353 | + case 32: // arithmeticParantheses |
2354 | + |
2355 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2356 | + { delete (yysym.value.arexpr); } |
2357 | +#line 432 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2358 | + break; |
2359 | + |
2360 | + case 33: // parExpression |
2361 | + |
2362 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2363 | + { delete (yysym.value.expr); } |
2364 | +#line 439 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2365 | + break; |
2366 | + |
2367 | + case 34: // notExpression |
2368 | + |
2369 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2370 | + { delete (yysym.value.expr); } |
2371 | +#line 446 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2372 | + break; |
2373 | + |
2374 | + case 35: // orExpression |
2375 | + |
2376 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2377 | + { delete (yysym.value.expr); } |
2378 | +#line 453 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2379 | + break; |
2380 | + |
2381 | + case 36: // andExpression |
2382 | + |
2383 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2384 | + { delete (yysym.value.expr); } |
2385 | +#line 460 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2386 | + break; |
2387 | + |
2388 | + case 37: // boolExpression |
2389 | + |
2390 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2391 | + { delete (yysym.value.expr); } |
2392 | +#line 467 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2393 | + break; |
2394 | + |
2395 | + case 38: // atomicProposition |
2396 | + |
2397 | +#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2398 | + { delete (yysym.value.expr); } |
2399 | +#line 474 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2400 | + break; |
2401 | + |
2402 | + case 39: // compareOp |
2403 | + |
2404 | +#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599 |
2405 | + { delete (yysym.value.string); } |
2406 | +#line 481 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599 |
2407 | + break; |
2408 | + |
2409 | + |
2410 | + default: |
2411 | + break; |
2412 | + } |
2413 | } |
2414 | |
2415 | #if YYDEBUG |
2416 | - /*--------------------------------. |
2417 | - | Print this symbol on YYOUTPUT. | |
2418 | - `--------------------------------*/ |
2419 | - |
2420 | - inline void |
2421 | - Parser::yy_symbol_value_print_ (int yytype, |
2422 | - const semantic_type* yyvaluep, const location_type* yylocationp) |
2423 | - { |
2424 | - YYUSE (yylocationp); |
2425 | - YYUSE (yyvaluep); |
2426 | - switch (yytype) |
2427 | - { |
2428 | - default: |
2429 | - break; |
2430 | - } |
2431 | - } |
2432 | - |
2433 | - |
2434 | + template <typename Base> |
2435 | void |
2436 | - Parser::yy_symbol_print_ (int yytype, |
2437 | - const semantic_type* yyvaluep, const location_type* yylocationp) |
2438 | + Parser::yy_print_ (std::ostream& yyo, |
2439 | + const basic_symbol<Base>& yysym) const |
2440 | { |
2441 | - *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") |
2442 | - << ' ' << yytname_[yytype] << " (" |
2443 | - << *yylocationp << ": "; |
2444 | - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); |
2445 | - *yycdebug_ << ')'; |
2446 | + std::ostream& yyoutput = yyo; |
2447 | + YYUSE (yyoutput); |
2448 | + symbol_number_type yytype = yysym.type_get (); |
2449 | + yyo << (yytype < yyntokens_ ? "token" : "nterm") |
2450 | + << ' ' << yytname_[yytype] << " (" |
2451 | + << yysym.location << ": "; |
2452 | + YYUSE (yytype); |
2453 | + yyo << ')'; |
2454 | } |
2455 | #endif |
2456 | |
2457 | - void |
2458 | - Parser::yydestruct_ (const char* yymsg, |
2459 | - int yytype, semantic_type* yyvaluep, location_type* yylocationp) |
2460 | - { |
2461 | - YYUSE (yylocationp); |
2462 | - YYUSE (yymsg); |
2463 | - YYUSE (yyvaluep); |
2464 | - |
2465 | - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
2466 | - |
2467 | - switch (yytype) |
2468 | - { |
2469 | - case 3: /* "IDENTIFIER" */ |
2470 | - |
2471 | -/* Line 480 of lalr1.cc */ |
2472 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2473 | - { delete (yyvaluep->string); }; |
2474 | - |
2475 | -/* Line 480 of lalr1.cc */ |
2476 | -#line 236 "src/Core/QueryParser/Generated/parser.cpp" |
2477 | - break; |
2478 | - case 4: /* "LESS" */ |
2479 | - |
2480 | -/* Line 480 of lalr1.cc */ |
2481 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2482 | - { delete (yyvaluep->string); }; |
2483 | - |
2484 | -/* Line 480 of lalr1.cc */ |
2485 | -#line 245 "src/Core/QueryParser/Generated/parser.cpp" |
2486 | - break; |
2487 | - case 5: /* "LESSEQUAL" */ |
2488 | - |
2489 | -/* Line 480 of lalr1.cc */ |
2490 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2491 | - { delete (yyvaluep->string); }; |
2492 | - |
2493 | -/* Line 480 of lalr1.cc */ |
2494 | -#line 254 "src/Core/QueryParser/Generated/parser.cpp" |
2495 | - break; |
2496 | - case 6: /* "EQUAL" */ |
2497 | - |
2498 | -/* Line 480 of lalr1.cc */ |
2499 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2500 | - { delete (yyvaluep->string); }; |
2501 | - |
2502 | -/* Line 480 of lalr1.cc */ |
2503 | -#line 263 "src/Core/QueryParser/Generated/parser.cpp" |
2504 | - break; |
2505 | - case 7: /* "GREATEREQUAL" */ |
2506 | - |
2507 | -/* Line 480 of lalr1.cc */ |
2508 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2509 | - { delete (yyvaluep->string); }; |
2510 | - |
2511 | -/* Line 480 of lalr1.cc */ |
2512 | -#line 272 "src/Core/QueryParser/Generated/parser.cpp" |
2513 | - break; |
2514 | - case 8: /* "GREATER" */ |
2515 | - |
2516 | -/* Line 480 of lalr1.cc */ |
2517 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2518 | - { delete (yyvaluep->string); }; |
2519 | - |
2520 | -/* Line 480 of lalr1.cc */ |
2521 | -#line 281 "src/Core/QueryParser/Generated/parser.cpp" |
2522 | - break; |
2523 | - case 26: /* "query" */ |
2524 | - |
2525 | -/* Line 480 of lalr1.cc */ |
2526 | -#line 58 "src/Core/QueryParser/grammar.yy" |
2527 | - { delete (yyvaluep->query); }; |
2528 | - |
2529 | -/* Line 480 of lalr1.cc */ |
2530 | -#line 290 "src/Core/QueryParser/Generated/parser.cpp" |
2531 | - break; |
2532 | - case 27: /* "expression" */ |
2533 | - |
2534 | -/* Line 480 of lalr1.cc */ |
2535 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2536 | - { delete (yyvaluep->expr); }; |
2537 | - |
2538 | -/* Line 480 of lalr1.cc */ |
2539 | -#line 299 "src/Core/QueryParser/Generated/parser.cpp" |
2540 | - break; |
2541 | - case 28: /* "arithmeticExpression" */ |
2542 | - |
2543 | -/* Line 480 of lalr1.cc */ |
2544 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2545 | - { delete (yyvaluep->arexpr); }; |
2546 | - |
2547 | -/* Line 480 of lalr1.cc */ |
2548 | -#line 308 "src/Core/QueryParser/Generated/parser.cpp" |
2549 | - break; |
2550 | - case 29: /* "multiplyExpression" */ |
2551 | - |
2552 | -/* Line 480 of lalr1.cc */ |
2553 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2554 | - { delete (yyvaluep->arexpr); }; |
2555 | - |
2556 | -/* Line 480 of lalr1.cc */ |
2557 | -#line 317 "src/Core/QueryParser/Generated/parser.cpp" |
2558 | - break; |
2559 | - case 30: /* "arithmeticParantheses" */ |
2560 | - |
2561 | -/* Line 480 of lalr1.cc */ |
2562 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2563 | - { delete (yyvaluep->arexpr); }; |
2564 | - |
2565 | -/* Line 480 of lalr1.cc */ |
2566 | -#line 326 "src/Core/QueryParser/Generated/parser.cpp" |
2567 | - break; |
2568 | - case 31: /* "parExpression" */ |
2569 | - |
2570 | -/* Line 480 of lalr1.cc */ |
2571 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2572 | - { delete (yyvaluep->expr); }; |
2573 | - |
2574 | -/* Line 480 of lalr1.cc */ |
2575 | -#line 335 "src/Core/QueryParser/Generated/parser.cpp" |
2576 | - break; |
2577 | - case 32: /* "notExpression" */ |
2578 | - |
2579 | -/* Line 480 of lalr1.cc */ |
2580 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2581 | - { delete (yyvaluep->expr); }; |
2582 | - |
2583 | -/* Line 480 of lalr1.cc */ |
2584 | -#line 344 "src/Core/QueryParser/Generated/parser.cpp" |
2585 | - break; |
2586 | - case 33: /* "orExpression" */ |
2587 | - |
2588 | -/* Line 480 of lalr1.cc */ |
2589 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2590 | - { delete (yyvaluep->expr); }; |
2591 | - |
2592 | -/* Line 480 of lalr1.cc */ |
2593 | -#line 353 "src/Core/QueryParser/Generated/parser.cpp" |
2594 | - break; |
2595 | - case 34: /* "andExpression" */ |
2596 | - |
2597 | -/* Line 480 of lalr1.cc */ |
2598 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2599 | - { delete (yyvaluep->expr); }; |
2600 | - |
2601 | -/* Line 480 of lalr1.cc */ |
2602 | -#line 362 "src/Core/QueryParser/Generated/parser.cpp" |
2603 | - break; |
2604 | - case 35: /* "boolExpression" */ |
2605 | - |
2606 | -/* Line 480 of lalr1.cc */ |
2607 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2608 | - { delete (yyvaluep->expr); }; |
2609 | - |
2610 | -/* Line 480 of lalr1.cc */ |
2611 | -#line 371 "src/Core/QueryParser/Generated/parser.cpp" |
2612 | - break; |
2613 | - case 36: /* "atomicProposition" */ |
2614 | - |
2615 | -/* Line 480 of lalr1.cc */ |
2616 | -#line 57 "src/Core/QueryParser/grammar.yy" |
2617 | - { delete (yyvaluep->expr); }; |
2618 | - |
2619 | -/* Line 480 of lalr1.cc */ |
2620 | -#line 380 "src/Core/QueryParser/Generated/parser.cpp" |
2621 | - break; |
2622 | - case 37: /* "compareOp" */ |
2623 | - |
2624 | -/* Line 480 of lalr1.cc */ |
2625 | -#line 56 "src/Core/QueryParser/grammar.yy" |
2626 | - { delete (yyvaluep->string); }; |
2627 | - |
2628 | -/* Line 480 of lalr1.cc */ |
2629 | -#line 389 "src/Core/QueryParser/Generated/parser.cpp" |
2630 | - break; |
2631 | - |
2632 | - default: |
2633 | - break; |
2634 | - } |
2635 | - } |
2636 | - |
2637 | + inline |
2638 | + void |
2639 | + Parser::yypush_ (const char* m, state_type s, symbol_type& sym) |
2640 | + { |
2641 | + stack_symbol_type t (s, sym); |
2642 | + yypush_ (m, t); |
2643 | + } |
2644 | + |
2645 | + inline |
2646 | + void |
2647 | + Parser::yypush_ (const char* m, stack_symbol_type& s) |
2648 | + { |
2649 | + if (m) |
2650 | + YY_SYMBOL_PRINT (m, s); |
2651 | + yystack_.push (s); |
2652 | + } |
2653 | + |
2654 | + inline |
2655 | void |
2656 | Parser::yypop_ (unsigned int n) |
2657 | { |
2658 | - yystate_stack_.pop (n); |
2659 | - yysemantic_stack_.pop (n); |
2660 | - yylocation_stack_.pop (n); |
2661 | + yystack_.pop (n); |
2662 | } |
2663 | |
2664 | #if YYDEBUG |
2665 | @@ -426,140 +552,144 @@ |
2666 | { |
2667 | yydebug_ = l; |
2668 | } |
2669 | -#endif |
2670 | +#endif // YYDEBUG |
2671 | + |
2672 | + inline Parser::state_type |
2673 | + Parser::yy_lr_goto_state_ (state_type yystate, int yysym) |
2674 | + { |
2675 | + int yyr = yypgoto_[yysym - yyntokens_] + yystate; |
2676 | + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) |
2677 | + return yytable_[yyr]; |
2678 | + else |
2679 | + return yydefgoto_[yysym - yyntokens_]; |
2680 | + } |
2681 | + |
2682 | + inline bool |
2683 | + Parser::yy_pact_value_is_default_ (int yyvalue) |
2684 | + { |
2685 | + return yyvalue == yypact_ninf_; |
2686 | + } |
2687 | + |
2688 | + inline bool |
2689 | + Parser::yy_table_value_is_error_ (int yyvalue) |
2690 | + { |
2691 | + return yyvalue == yytable_ninf_; |
2692 | + } |
2693 | |
2694 | int |
2695 | Parser::parse () |
2696 | { |
2697 | - /// Lookahead and lookahead in internal form. |
2698 | - int yychar = yyempty_; |
2699 | - int yytoken = 0; |
2700 | + /// Whether yyla contains a lookahead. |
2701 | + bool yyempty = true; |
2702 | |
2703 | - /* State. */ |
2704 | + // State. |
2705 | int yyn; |
2706 | + /// Length of the RHS of the rule being reduced. |
2707 | int yylen = 0; |
2708 | - int yystate = 0; |
2709 | |
2710 | - /* Error handling. */ |
2711 | + // Error handling. |
2712 | int yynerrs_ = 0; |
2713 | int yyerrstatus_ = 0; |
2714 | |
2715 | - /// Semantic value of the lookahead. |
2716 | - semantic_type yylval; |
2717 | - /// Location of the lookahead. |
2718 | - location_type yylloc; |
2719 | + /// The lookahead symbol. |
2720 | + symbol_type yyla; |
2721 | + |
2722 | /// The locations where the error started and ended. |
2723 | - location_type yyerror_range[2]; |
2724 | - |
2725 | - /// $$. |
2726 | - semantic_type yyval; |
2727 | - /// @$. |
2728 | - location_type yyloc; |
2729 | - |
2730 | + stack_symbol_type yyerror_range[3]; |
2731 | + |
2732 | + /// The return value of parse (). |
2733 | int yyresult; |
2734 | |
2735 | + // FIXME: This shoud be completely indented. It is not yet to |
2736 | + // avoid gratuitous conflicts when merging into the master branch. |
2737 | + try |
2738 | + { |
2739 | YYCDEBUG << "Starting parse" << std::endl; |
2740 | |
2741 | |
2742 | - /* User initialization code. */ |
2743 | - |
2744 | -/* Line 559 of lalr1.cc */ |
2745 | -#line 21 "src/Core/QueryParser/grammar.yy" |
2746 | + // User initialization code. |
2747 | + #line 21 "src/Core/QueryParser/grammar.yy" // lalr1.cc:725 |
2748 | { |
2749 | // Initialize the initial location. |
2750 | - yylloc.begin.filename = yylloc.end.filename = &driver.file; |
2751 | + yyla.location.begin.filename = yyla.location.end.filename = &driver.file; |
2752 | } |
2753 | |
2754 | -/* Line 559 of lalr1.cc */ |
2755 | -#line 475 "src/Core/QueryParser/Generated/parser.cpp" |
2756 | +#line 618 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:725 |
2757 | |
2758 | - /* Initialize the stacks. The initial state will be pushed in |
2759 | + /* Initialize the stack. The initial state will be set in |
2760 | yynewstate, since the latter expects the semantical and the |
2761 | location values to have been already stored, initialize these |
2762 | stacks with a primary value. */ |
2763 | - yystate_stack_ = state_stack_type (0); |
2764 | - yysemantic_stack_ = semantic_stack_type (0); |
2765 | - yylocation_stack_ = location_stack_type (0); |
2766 | - yysemantic_stack_.push (yylval); |
2767 | - yylocation_stack_.push (yylloc); |
2768 | + yystack_.clear (); |
2769 | + yypush_ (YY_NULLPTR, 0, yyla); |
2770 | |
2771 | - /* New state. */ |
2772 | + // A new symbol was pushed on the stack. |
2773 | yynewstate: |
2774 | - yystate_stack_.push (yystate); |
2775 | - YYCDEBUG << "Entering state " << yystate << std::endl; |
2776 | + YYCDEBUG << "Entering state " << yystack_[0].state << std::endl; |
2777 | |
2778 | - /* Accept? */ |
2779 | - if (yystate == yyfinal_) |
2780 | + // Accept? |
2781 | + if (yystack_[0].state == yyfinal_) |
2782 | goto yyacceptlab; |
2783 | |
2784 | goto yybackup; |
2785 | |
2786 | - /* Backup. */ |
2787 | + // Backup. |
2788 | yybackup: |
2789 | |
2790 | - /* Try to take a decision without lookahead. */ |
2791 | - yyn = yypact_[yystate]; |
2792 | - if (yyn == yypact_ninf_) |
2793 | - goto yydefault; |
2794 | - |
2795 | - /* Read a lookahead token. */ |
2796 | - if (yychar == yyempty_) |
2797 | - { |
2798 | - YYCDEBUG << "Reading a token: "; |
2799 | - yychar = yylex (&yylval, &yylloc, driver); |
2800 | - } |
2801 | - |
2802 | - |
2803 | - /* Convert token to internal form. */ |
2804 | - if (yychar <= yyeof_) |
2805 | - { |
2806 | - yychar = yytoken = yyeof_; |
2807 | - YYCDEBUG << "Now at end of input." << std::endl; |
2808 | - } |
2809 | - else |
2810 | - { |
2811 | - yytoken = yytranslate_ (yychar); |
2812 | - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
2813 | - } |
2814 | - |
2815 | - /* If the proper action on seeing token YYTOKEN is to reduce or to |
2816 | - detect an error, take that action. */ |
2817 | - yyn += yytoken; |
2818 | - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) |
2819 | - goto yydefault; |
2820 | - |
2821 | - /* Reduce or error. */ |
2822 | + // Try to take a decision without lookahead. |
2823 | + yyn = yypact_[yystack_[0].state]; |
2824 | + if (yy_pact_value_is_default_ (yyn)) |
2825 | + goto yydefault; |
2826 | + |
2827 | + // Read a lookahead token. |
2828 | + if (yyempty) |
2829 | + { |
2830 | + YYCDEBUG << "Reading a token: "; |
2831 | + try |
2832 | + { |
2833 | + yyla.type = yytranslate_ (yylex (&yyla.value, &yyla.location, driver)); |
2834 | + } |
2835 | + catch (const syntax_error& yyexc) |
2836 | + { |
2837 | + error (yyexc); |
2838 | + goto yyerrlab1; |
2839 | + } |
2840 | + yyempty = false; |
2841 | + } |
2842 | + YY_SYMBOL_PRINT ("Next token is", yyla); |
2843 | + |
2844 | + /* If the proper action on seeing token YYLA.TYPE is to reduce or |
2845 | + to detect an error, take that action. */ |
2846 | + yyn += yyla.type_get (); |
2847 | + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ()) |
2848 | + goto yydefault; |
2849 | + |
2850 | + // Reduce or error. |
2851 | yyn = yytable_[yyn]; |
2852 | if (yyn <= 0) |
2853 | { |
2854 | - if (yyn == 0 || yyn == yytable_ninf_) |
2855 | - goto yyerrlab; |
2856 | - yyn = -yyn; |
2857 | - goto yyreduce; |
2858 | + if (yy_table_value_is_error_ (yyn)) |
2859 | + goto yyerrlab; |
2860 | + yyn = -yyn; |
2861 | + goto yyreduce; |
2862 | } |
2863 | |
2864 | - /* Shift the lookahead token. */ |
2865 | - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
2866 | - |
2867 | - /* Discard the token being shifted. */ |
2868 | - yychar = yyempty_; |
2869 | - |
2870 | - yysemantic_stack_.push (yylval); |
2871 | - yylocation_stack_.push (yylloc); |
2872 | - |
2873 | - /* Count tokens shifted since error; after three, turn off error |
2874 | - status. */ |
2875 | + // Discard the token being shifted. |
2876 | + yyempty = true; |
2877 | + |
2878 | + // Count tokens shifted since error; after three, turn off error status. |
2879 | if (yyerrstatus_) |
2880 | --yyerrstatus_; |
2881 | |
2882 | - yystate = yyn; |
2883 | + // Shift the lookahead token. |
2884 | + yypush_ ("Shifting", yyn, yyla); |
2885 | goto yynewstate; |
2886 | |
2887 | /*-----------------------------------------------------------. |
2888 | | yydefault -- do the default action for the current state. | |
2889 | `-----------------------------------------------------------*/ |
2890 | yydefault: |
2891 | - yyn = yydefact_[yystate]; |
2892 | + yyn = yydefact_[yystack_[0].state]; |
2893 | if (yyn == 0) |
2894 | goto yyerrlab; |
2895 | goto yyreduce; |
2896 | @@ -569,276 +699,262 @@ |
2897 | `-----------------------------*/ |
2898 | yyreduce: |
2899 | yylen = yyr2_[yyn]; |
2900 | - /* If YYLEN is nonzero, implement the default value of the action: |
2901 | - `$$ = $1'. Otherwise, use the top of the stack. |
2902 | - |
2903 | - Otherwise, the following line sets YYVAL to garbage. |
2904 | - This behavior is undocumented and Bison |
2905 | - users should not rely upon it. */ |
2906 | - if (yylen) |
2907 | - yyval = yysemantic_stack_[yylen - 1]; |
2908 | - else |
2909 | - yyval = yysemantic_stack_[0]; |
2910 | - |
2911 | { |
2912 | - slice<location_type, location_stack_type> slice (yylocation_stack_, yylen); |
2913 | - YYLLOC_DEFAULT (yyloc, slice, yylen); |
2914 | - } |
2915 | - YY_REDUCE_PRINT (yyn); |
2916 | - switch (yyn) |
2917 | + stack_symbol_type yylhs; |
2918 | + yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]); |
2919 | + /* If YYLEN is nonzero, implement the default value of the |
2920 | + action: '$$ = $1'. Otherwise, use the top of the stack. |
2921 | + |
2922 | + Otherwise, the following line sets YYLHS.VALUE to garbage. |
2923 | + This behavior is undocumented and Bison users should not rely |
2924 | + upon it. */ |
2925 | + if (yylen) |
2926 | + yylhs.value = yystack_[yylen - 1].value; |
2927 | + else |
2928 | + yylhs.value = yystack_[0].value; |
2929 | + |
2930 | + // Compute the default @$. |
2931 | { |
2932 | - case 2: |
2933 | + slice<stack_symbol_type, stack_type> slice (yystack_, yylen); |
2934 | + YYLLOC_DEFAULT (yylhs.location, slice, yylen); |
2935 | + } |
2936 | |
2937 | -/* Line 678 of lalr1.cc */ |
2938 | -#line 62 "src/Core/QueryParser/grammar.yy" |
2939 | - { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); } |
2940 | + // Perform the reduction. |
2941 | + YY_REDUCE_PRINT (yyn); |
2942 | + try |
2943 | + { |
2944 | + switch (yyn) |
2945 | + { |
2946 | + case 2: |
2947 | +#line 62 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2948 | + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query)); } |
2949 | +#line 732 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
2950 | break; |
2951 | |
2952 | case 3: |
2953 | - |
2954 | -/* Line 678 of lalr1.cc */ |
2955 | -#line 63 "src/Core/QueryParser/grammar.yy" |
2956 | - { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AG, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); } |
2957 | +#line 63 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2958 | + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AG, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query)); } |
2959 | +#line 738 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
2960 | break; |
2961 | |
2962 | case 4: |
2963 | - |
2964 | -/* Line 678 of lalr1.cc */ |
2965 | -#line 64 "src/Core/QueryParser/grammar.yy" |
2966 | - { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EG, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); } |
2967 | +#line 64 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2968 | + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EG, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query)); } |
2969 | +#line 744 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
2970 | break; |
2971 | |
2972 | case 5: |
2973 | - |
2974 | -/* Line 678 of lalr1.cc */ |
2975 | -#line 65 "src/Core/QueryParser/grammar.yy" |
2976 | - { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AF, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); } |
2977 | +#line 65 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2978 | + { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AF, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query)); } |
2979 | +#line 750 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
2980 | break; |
2981 | |
2982 | case 6: |
2983 | - |
2984 | -/* Line 678 of lalr1.cc */ |
2985 | -#line 68 "src/Core/QueryParser/grammar.yy" |
2986 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
2987 | +#line 66 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2988 | + {(yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::CF, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query));} |
2989 | +#line 756 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
2990 | break; |
2991 | |
2992 | case 7: |
2993 | - |
2994 | -/* Line 678 of lalr1.cc */ |
2995 | -#line 69 "src/Core/QueryParser/grammar.yy" |
2996 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
2997 | +#line 67 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
2998 | + {(yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::CG, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query));} |
2999 | +#line 762 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3000 | break; |
3001 | |
3002 | case 8: |
3003 | - |
3004 | -/* Line 678 of lalr1.cc */ |
3005 | -#line 70 "src/Core/QueryParser/grammar.yy" |
3006 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
3007 | +#line 70 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3008 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3009 | +#line 768 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3010 | break; |
3011 | |
3012 | case 9: |
3013 | - |
3014 | -/* Line 678 of lalr1.cc */ |
3015 | -#line 71 "src/Core/QueryParser/grammar.yy" |
3016 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
3017 | +#line 71 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3018 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3019 | +#line 774 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3020 | break; |
3021 | |
3022 | case 10: |
3023 | - |
3024 | -/* Line 678 of lalr1.cc */ |
3025 | -#line 72 "src/Core/QueryParser/grammar.yy" |
3026 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
3027 | +#line 72 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3028 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3029 | +#line 780 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3030 | break; |
3031 | |
3032 | case 11: |
3033 | - |
3034 | -/* Line 678 of lalr1.cc */ |
3035 | -#line 73 "src/Core/QueryParser/grammar.yy" |
3036 | - { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } |
3037 | +#line 73 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3038 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3039 | +#line 786 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3040 | break; |
3041 | |
3042 | case 12: |
3043 | - |
3044 | -/* Line 678 of lalr1.cc */ |
3045 | -#line 79 "src/Core/QueryParser/grammar.yy" |
3046 | - { (yyval.arexpr) = new VerifyTAPN::AST::PlusExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); } |
3047 | +#line 74 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3048 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3049 | +#line 792 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3050 | break; |
3051 | |
3052 | case 13: |
3053 | - |
3054 | -/* Line 678 of lalr1.cc */ |
3055 | -#line 80 "src/Core/QueryParser/grammar.yy" |
3056 | - { (yyval.arexpr) = new VerifyTAPN::AST::SubtractExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); } |
3057 | +#line 75 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3058 | + { (yylhs.value.expr) = (yystack_[0].value.expr); } |
3059 | +#line 798 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3060 | break; |
3061 | |
3062 | case 14: |
3063 | - |
3064 | -/* Line 678 of lalr1.cc */ |
3065 | -#line 81 "src/Core/QueryParser/grammar.yy" |
3066 | - { (yyval.arexpr) = new VerifyTAPN::AST::MinusExpression((yysemantic_stack_[(2) - (2)].arexpr)); } |
3067 | +#line 81 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3068 | + { (yylhs.value.arexpr) = new VerifyTAPN::AST::PlusExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } |
3069 | +#line 804 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3070 | break; |
3071 | |
3072 | case 15: |
3073 | - |
3074 | -/* Line 678 of lalr1.cc */ |
3075 | -#line 82 "src/Core/QueryParser/grammar.yy" |
3076 | - { (yyval.arexpr) = (yysemantic_stack_[(1) - (1)].arexpr); } |
3077 | +#line 82 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3078 | + { (yylhs.value.arexpr) = new VerifyTAPN::AST::SubtractExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } |
3079 | +#line 810 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3080 | break; |
3081 | |
3082 | case 16: |
3083 | - |
3084 | -/* Line 678 of lalr1.cc */ |
3085 | -#line 85 "src/Core/QueryParser/grammar.yy" |
3086 | - { (yyval.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); } |
3087 | +#line 83 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3088 | + { (yylhs.value.arexpr) = new VerifyTAPN::AST::MinusExpression((yystack_[0].value.arexpr)); } |
3089 | +#line 816 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3090 | break; |
3091 | |
3092 | case 17: |
3093 | - |
3094 | -/* Line 678 of lalr1.cc */ |
3095 | -#line 86 "src/Core/QueryParser/grammar.yy" |
3096 | - { (yyval.arexpr) = (yysemantic_stack_[(1) - (1)].arexpr); } |
3097 | +#line 84 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3098 | + { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } |
3099 | +#line 822 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3100 | break; |
3101 | |
3102 | case 18: |
3103 | - |
3104 | -/* Line 678 of lalr1.cc */ |
3105 | -#line 89 "src/Core/QueryParser/grammar.yy" |
3106 | - { (yyval.arexpr) = (yysemantic_stack_[(3) - (2)].arexpr); } |
3107 | +#line 87 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3108 | + { (yylhs.value.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); } |
3109 | +#line 828 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3110 | break; |
3111 | |
3112 | case 19: |
3113 | - |
3114 | -/* Line 678 of lalr1.cc */ |
3115 | -#line 90 "src/Core/QueryParser/grammar.yy" |
3116 | - { (yyval.arexpr) = new VerifyTAPN::AST::NumberExpression((yysemantic_stack_[(1) - (1)].number));} |
3117 | +#line 88 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3118 | + { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); } |
3119 | +#line 834 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3120 | break; |
3121 | |
3122 | case 20: |
3123 | - |
3124 | -/* Line 678 of lalr1.cc */ |
3125 | -#line 91 "src/Core/QueryParser/grammar.yy" |
3126 | +#line 91 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3127 | + { (yylhs.value.arexpr) = (yystack_[1].value.arexpr); } |
3128 | +#line 840 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3129 | + break; |
3130 | + |
3131 | + case 21: |
3132 | +#line 92 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3133 | + { (yylhs.value.arexpr) = new VerifyTAPN::AST::NumberExpression((yystack_[0].value.number));} |
3134 | +#line 846 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3135 | + break; |
3136 | + |
3137 | + case 22: |
3138 | +#line 93 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3139 | { |
3140 | - int placeIndex = driver.getTAPN().getPlaceIndex(*(yysemantic_stack_[(1) - (1)].string)); |
3141 | - delete (yysemantic_stack_[(1) - (1)].string); |
3142 | - if(placeIndex == -1) error((yylocation_stack_[(1) - (1)]), "unknown place"); |
3143 | - (yyval.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex); |
3144 | + int placeIndex = driver.getTAPN().getPlaceIndex(*(yystack_[0].value.string)); |
3145 | + delete (yystack_[0].value.string); |
3146 | + if(placeIndex == -1) error(yystack_[0].location, "unknown place"); |
3147 | + (yylhs.value.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex); |
3148 | } |
3149 | - break; |
3150 | - |
3151 | - case 21: |
3152 | - |
3153 | -/* Line 678 of lalr1.cc */ |
3154 | -#line 99 "src/Core/QueryParser/grammar.yy" |
3155 | - { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); } |
3156 | - break; |
3157 | - |
3158 | - case 22: |
3159 | - |
3160 | -/* Line 678 of lalr1.cc */ |
3161 | -#line 100 "src/Core/QueryParser/grammar.yy" |
3162 | - { (yyval.expr) = new VerifyTAPN::AST::NotExpression((yysemantic_stack_[(2) - (2)].expr)); } |
3163 | +#line 857 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3164 | break; |
3165 | |
3166 | case 23: |
3167 | - |
3168 | -/* Line 678 of lalr1.cc */ |
3169 | -#line 101 "src/Core/QueryParser/grammar.yy" |
3170 | - { (yyval.expr) = new VerifyTAPN::AST::OrExpression((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); } |
3171 | +#line 101 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3172 | + { (yylhs.value.expr) = (yystack_[1].value.expr); } |
3173 | +#line 863 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3174 | break; |
3175 | |
3176 | case 24: |
3177 | - |
3178 | -/* Line 678 of lalr1.cc */ |
3179 | -#line 102 "src/Core/QueryParser/grammar.yy" |
3180 | - { (yyval.expr) = new VerifyTAPN::AST::AndExpression((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); } |
3181 | +#line 102 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3182 | + { (yylhs.value.expr) = new VerifyTAPN::AST::NotExpression((yystack_[0].value.expr)); } |
3183 | +#line 869 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3184 | break; |
3185 | |
3186 | case 25: |
3187 | - |
3188 | -/* Line 678 of lalr1.cc */ |
3189 | -#line 103 "src/Core/QueryParser/grammar.yy" |
3190 | - { (yyval.expr) = new VerifyTAPN::AST::BoolExpression(true); } |
3191 | +#line 103 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3192 | + { (yylhs.value.expr) = new VerifyTAPN::AST::OrExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } |
3193 | +#line 875 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3194 | break; |
3195 | |
3196 | case 26: |
3197 | - |
3198 | -/* Line 678 of lalr1.cc */ |
3199 | -#line 104 "src/Core/QueryParser/grammar.yy" |
3200 | - { (yyval.expr) = new VerifyTAPN::AST::BoolExpression(false); } |
3201 | +#line 104 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3202 | + { (yylhs.value.expr) = new VerifyTAPN::AST::AndExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); } |
3203 | +#line 881 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3204 | break; |
3205 | |
3206 | case 27: |
3207 | - |
3208 | -/* Line 678 of lalr1.cc */ |
3209 | -#line 106 "src/Core/QueryParser/grammar.yy" |
3210 | - { (yyval.expr) = new VerifyTAPN::AST::AtomicProposition((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (2)].string), (yysemantic_stack_[(3) - (3)].arexpr)); } |
3211 | +#line 105 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3212 | + { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(true); } |
3213 | +#line 887 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3214 | break; |
3215 | |
3216 | case 28: |
3217 | - |
3218 | -/* Line 678 of lalr1.cc */ |
3219 | -#line 107 "src/Core/QueryParser/grammar.yy" |
3220 | - { (yyval.expr) = new VerifyTAPN::AST::DeadlockExpression(); } |
3221 | - break; |
3222 | - |
3223 | - |
3224 | - |
3225 | -/* Line 678 of lalr1.cc */ |
3226 | -#line 788 "src/Core/QueryParser/Generated/parser.cpp" |
3227 | - default: |
3228 | - break; |
3229 | - } |
3230 | - YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); |
3231 | - |
3232 | - yypop_ (yylen); |
3233 | - yylen = 0; |
3234 | - YY_STACK_PRINT (); |
3235 | - |
3236 | - yysemantic_stack_.push (yyval); |
3237 | - yylocation_stack_.push (yyloc); |
3238 | - |
3239 | - /* Shift the result of the reduction. */ |
3240 | - yyn = yyr1_[yyn]; |
3241 | - yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; |
3242 | - if (0 <= yystate && yystate <= yylast_ |
3243 | - && yycheck_[yystate] == yystate_stack_[0]) |
3244 | - yystate = yytable_[yystate]; |
3245 | - else |
3246 | - yystate = yydefgoto_[yyn - yyntokens_]; |
3247 | +#line 106 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3248 | + { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(false); } |
3249 | +#line 893 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3250 | + break; |
3251 | + |
3252 | + case 29: |
3253 | +#line 108 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3254 | + { (yylhs.value.expr) = new VerifyTAPN::AST::AtomicProposition((yystack_[2].value.arexpr), (yystack_[1].value.string), (yystack_[0].value.arexpr)); } |
3255 | +#line 899 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3256 | + break; |
3257 | + |
3258 | + case 30: |
3259 | +#line 109 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847 |
3260 | + { (yylhs.value.expr) = new VerifyTAPN::AST::DeadlockExpression(); } |
3261 | +#line 905 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3262 | + break; |
3263 | + |
3264 | + |
3265 | +#line 909 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847 |
3266 | + default: |
3267 | + break; |
3268 | + } |
3269 | + } |
3270 | + catch (const syntax_error& yyexc) |
3271 | + { |
3272 | + error (yyexc); |
3273 | + YYERROR; |
3274 | + } |
3275 | + YY_SYMBOL_PRINT ("-> $$ =", yylhs); |
3276 | + yypop_ (yylen); |
3277 | + yylen = 0; |
3278 | + YY_STACK_PRINT (); |
3279 | + |
3280 | + // Shift the result of the reduction. |
3281 | + yypush_ (YY_NULLPTR, yylhs); |
3282 | + } |
3283 | goto yynewstate; |
3284 | |
3285 | - /*------------------------------------. |
3286 | - | yyerrlab -- here on detecting error | |
3287 | - `------------------------------------*/ |
3288 | + /*--------------------------------------. |
3289 | + | yyerrlab -- here on detecting error. | |
3290 | + `--------------------------------------*/ |
3291 | yyerrlab: |
3292 | - /* If not already recovering from an error, report this error. */ |
3293 | + // If not already recovering from an error, report this error. |
3294 | if (!yyerrstatus_) |
3295 | { |
3296 | - ++yynerrs_; |
3297 | - error (yylloc, yysyntax_error_ (yystate, yytoken)); |
3298 | + ++yynerrs_; |
3299 | + error (yyla.location, yysyntax_error_ (yystack_[0].state, |
3300 | + yyempty ? yyempty_ : yyla.type_get ())); |
3301 | } |
3302 | |
3303 | - yyerror_range[0] = yylloc; |
3304 | + |
3305 | + yyerror_range[1].location = yyla.location; |
3306 | if (yyerrstatus_ == 3) |
3307 | { |
3308 | - /* If just tried and failed to reuse lookahead token after an |
3309 | - error, discard it. */ |
3310 | + /* If just tried and failed to reuse lookahead token after an |
3311 | + error, discard it. */ |
3312 | |
3313 | - if (yychar <= yyeof_) |
3314 | - { |
3315 | - /* Return failure if at end of input. */ |
3316 | - if (yychar == yyeof_) |
3317 | - YYABORT; |
3318 | - } |
3319 | - else |
3320 | - { |
3321 | - yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); |
3322 | - yychar = yyempty_; |
3323 | - } |
3324 | + // Return failure if at end of input. |
3325 | + if (yyla.type_get () == yyeof_) |
3326 | + YYABORT; |
3327 | + else if (!yyempty) |
3328 | + { |
3329 | + yy_destroy_ ("Error: discarding", yyla); |
3330 | + yyempty = true; |
3331 | + } |
3332 | } |
3333 | |
3334 | - /* Else will try to reuse lookahead token after shifting the error |
3335 | - token. */ |
3336 | + // Else will try to reuse lookahead token after shifting the error token. |
3337 | goto yyerrlab1; |
3338 | |
3339 | |
3340 | @@ -852,311 +968,318 @@ |
3341 | code. */ |
3342 | if (false) |
3343 | goto yyerrorlab; |
3344 | - |
3345 | - yyerror_range[0] = yylocation_stack_[yylen - 1]; |
3346 | - /* Do not reclaim the symbols of the rule which action triggered |
3347 | + yyerror_range[1].location = yystack_[yylen - 1].location; |
3348 | + /* Do not reclaim the symbols of the rule whose action triggered |
3349 | this YYERROR. */ |
3350 | yypop_ (yylen); |
3351 | yylen = 0; |
3352 | - yystate = yystate_stack_[0]; |
3353 | goto yyerrlab1; |
3354 | |
3355 | /*-------------------------------------------------------------. |
3356 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
3357 | `-------------------------------------------------------------*/ |
3358 | yyerrlab1: |
3359 | - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ |
3360 | - |
3361 | - for (;;) |
3362 | - { |
3363 | - yyn = yypact_[yystate]; |
3364 | - if (yyn != yypact_ninf_) |
3365 | - { |
3366 | - yyn += yyterror_; |
3367 | - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) |
3368 | - { |
3369 | - yyn = yytable_[yyn]; |
3370 | - if (0 < yyn) |
3371 | - break; |
3372 | - } |
3373 | - } |
3374 | - |
3375 | - /* Pop the current state because it cannot handle the error token. */ |
3376 | - if (yystate_stack_.height () == 1) |
3377 | - YYABORT; |
3378 | - |
3379 | - yyerror_range[0] = yylocation_stack_[0]; |
3380 | - yydestruct_ ("Error: popping", |
3381 | - yystos_[yystate], |
3382 | - &yysemantic_stack_[0], &yylocation_stack_[0]); |
3383 | - yypop_ (); |
3384 | - yystate = yystate_stack_[0]; |
3385 | - YY_STACK_PRINT (); |
3386 | - } |
3387 | - |
3388 | - yyerror_range[1] = yylloc; |
3389 | - // Using YYLLOC is tempting, but would change the location of |
3390 | - // the lookahead. YYLOC is available though. |
3391 | - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); |
3392 | - yysemantic_stack_.push (yylval); |
3393 | - yylocation_stack_.push (yyloc); |
3394 | - |
3395 | - /* Shift the error token. */ |
3396 | - YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], |
3397 | - &yysemantic_stack_[0], &yylocation_stack_[0]); |
3398 | - |
3399 | - yystate = yyn; |
3400 | + yyerrstatus_ = 3; // Each real token shifted decrements this. |
3401 | + { |
3402 | + stack_symbol_type error_token; |
3403 | + for (;;) |
3404 | + { |
3405 | + yyn = yypact_[yystack_[0].state]; |
3406 | + if (!yy_pact_value_is_default_ (yyn)) |
3407 | + { |
3408 | + yyn += yyterror_; |
3409 | + if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) |
3410 | + { |
3411 | + yyn = yytable_[yyn]; |
3412 | + if (0 < yyn) |
3413 | + break; |
3414 | + } |
3415 | + } |
3416 | + |
3417 | + // Pop the current state because it cannot handle the error token. |
3418 | + if (yystack_.size () == 1) |
3419 | + YYABORT; |
3420 | + |
3421 | + yyerror_range[1].location = yystack_[0].location; |
3422 | + yy_destroy_ ("Error: popping", yystack_[0]); |
3423 | + yypop_ (); |
3424 | + YY_STACK_PRINT (); |
3425 | + } |
3426 | + |
3427 | + yyerror_range[2].location = yyla.location; |
3428 | + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); |
3429 | + |
3430 | + // Shift the error token. |
3431 | + error_token.state = yyn; |
3432 | + yypush_ ("Shifting", error_token); |
3433 | + } |
3434 | goto yynewstate; |
3435 | |
3436 | - /* Accept. */ |
3437 | + // Accept. |
3438 | yyacceptlab: |
3439 | yyresult = 0; |
3440 | goto yyreturn; |
3441 | |
3442 | - /* Abort. */ |
3443 | + // Abort. |
3444 | yyabortlab: |
3445 | yyresult = 1; |
3446 | goto yyreturn; |
3447 | |
3448 | yyreturn: |
3449 | - if (yychar != yyempty_) |
3450 | - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); |
3451 | + if (!yyempty) |
3452 | + yy_destroy_ ("Cleanup: discarding lookahead", yyla); |
3453 | |
3454 | - /* Do not reclaim the symbols of the rule which action triggered |
3455 | + /* Do not reclaim the symbols of the rule whose action triggered |
3456 | this YYABORT or YYACCEPT. */ |
3457 | yypop_ (yylen); |
3458 | - while (yystate_stack_.height () != 1) |
3459 | + while (1 < yystack_.size ()) |
3460 | { |
3461 | - yydestruct_ ("Cleanup: popping", |
3462 | - yystos_[yystate_stack_[0]], |
3463 | - &yysemantic_stack_[0], |
3464 | - &yylocation_stack_[0]); |
3465 | - yypop_ (); |
3466 | + yy_destroy_ ("Cleanup: popping", yystack_[0]); |
3467 | + yypop_ (); |
3468 | } |
3469 | |
3470 | return yyresult; |
3471 | } |
3472 | + catch (...) |
3473 | + { |
3474 | + YYCDEBUG << "Exception caught: cleaning lookahead and stack" |
3475 | + << std::endl; |
3476 | + // Do not try to display the values of the reclaimed symbols, |
3477 | + // as their printer might throw an exception. |
3478 | + if (!yyempty) |
3479 | + yy_destroy_ (YY_NULLPTR, yyla); |
3480 | + |
3481 | + while (1 < yystack_.size ()) |
3482 | + { |
3483 | + yy_destroy_ (YY_NULLPTR, yystack_[0]); |
3484 | + yypop_ (); |
3485 | + } |
3486 | + throw; |
3487 | + } |
3488 | + } |
3489 | + |
3490 | + void |
3491 | + Parser::error (const syntax_error& yyexc) |
3492 | + { |
3493 | + error (yyexc.location, yyexc.what()); |
3494 | + } |
3495 | |
3496 | // Generate an error message. |
3497 | std::string |
3498 | - Parser::yysyntax_error_ (int yystate, int tok) |
3499 | + Parser::yysyntax_error_ (state_type yystate, symbol_number_type yytoken) const |
3500 | { |
3501 | - std::string res; |
3502 | - YYUSE (yystate); |
3503 | -#if YYERROR_VERBOSE |
3504 | - int yyn = yypact_[yystate]; |
3505 | - if (yypact_ninf_ < yyn && yyn <= yylast_) |
3506 | - { |
3507 | - /* Start YYX at -YYN if negative to avoid negative indexes in |
3508 | - YYCHECK. */ |
3509 | - int yyxbegin = yyn < 0 ? -yyn : 0; |
3510 | - |
3511 | - /* Stay within bounds of both yycheck and yytname. */ |
3512 | - int yychecklim = yylast_ - yyn + 1; |
3513 | - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; |
3514 | - int count = 0; |
3515 | - for (int x = yyxbegin; x < yyxend; ++x) |
3516 | - if (yycheck_[x + yyn] == x && x != yyterror_) |
3517 | - ++count; |
3518 | - |
3519 | - // FIXME: This method of building the message is not compatible |
3520 | - // with internationalization. It should work like yacc.c does it. |
3521 | - // That is, first build a string that looks like this: |
3522 | - // "syntax error, unexpected %s or %s or %s" |
3523 | - // Then, invoke YY_ on this string. |
3524 | - // Finally, use the string as a format to output |
3525 | - // yytname_[tok], etc. |
3526 | - // Until this gets fixed, this message appears in English only. |
3527 | - res = "syntax error, unexpected "; |
3528 | - res += yytnamerr_ (yytname_[tok]); |
3529 | - if (count < 5) |
3530 | - { |
3531 | - count = 0; |
3532 | - for (int x = yyxbegin; x < yyxend; ++x) |
3533 | - if (yycheck_[x + yyn] == x && x != yyterror_) |
3534 | - { |
3535 | - res += (!count++) ? ", expecting " : " or "; |
3536 | - res += yytnamerr_ (yytname_[x]); |
3537 | - } |
3538 | - } |
3539 | - } |
3540 | - else |
3541 | -#endif |
3542 | - res = YY_("syntax error"); |
3543 | - return res; |
3544 | + std::string yyres; |
3545 | + // Number of reported tokens (one for the "unexpected", one per |
3546 | + // "expected"). |
3547 | + size_t yycount = 0; |
3548 | + // Its maximum. |
3549 | + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
3550 | + // Arguments of yyformat. |
3551 | + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
3552 | + |
3553 | + /* There are many possibilities here to consider: |
3554 | + - If this state is a consistent state with a default action, then |
3555 | + the only way this function was invoked is if the default action |
3556 | + is an error action. In that case, don't check for expected |
3557 | + tokens because there are none. |
3558 | + - The only way there can be no lookahead present (in yytoken) is |
3559 | + if this state is a consistent state with a default action. |
3560 | + Thus, detecting the absence of a lookahead is sufficient to |
3561 | + determine that there is no unexpected or expected token to |
3562 | + report. In that case, just report a simple "syntax error". |
3563 | + - Don't assume there isn't a lookahead just because this state is |
3564 | + a consistent state with a default action. There might have |
3565 | + been a previous inconsistent state, consistent state with a |
3566 | + non-default action, or user semantic action that manipulated |
3567 | + yyla. (However, yyla is currently not documented for users.) |
3568 | + - Of course, the expected token list depends on states to have |
3569 | + correct lookahead information, and it depends on the parser not |
3570 | + to perform extra reductions after fetching a lookahead from the |
3571 | + scanner and before detecting a syntax error. Thus, state |
3572 | + merging (from LALR or IELR) and default reductions corrupt the |
3573 | + expected token list. However, the list is correct for |
3574 | + canonical LR with one exception: it will still contain any |
3575 | + token that will not be accepted due to an error action in a |
3576 | + later state. |
3577 | + */ |
3578 | + if (yytoken != yyempty_) |
3579 | + { |
3580 | + yyarg[yycount++] = yytname_[yytoken]; |
3581 | + int yyn = yypact_[yystate]; |
3582 | + if (!yy_pact_value_is_default_ (yyn)) |
3583 | + { |
3584 | + /* Start YYX at -YYN if negative to avoid negative indexes in |
3585 | + YYCHECK. In other words, skip the first -YYN actions for |
3586 | + this state because they are default actions. */ |
3587 | + int yyxbegin = yyn < 0 ? -yyn : 0; |
3588 | + // Stay within bounds of both yycheck and yytname. |
3589 | + int yychecklim = yylast_ - yyn + 1; |
3590 | + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; |
3591 | + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) |
3592 | + if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ |
3593 | + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) |
3594 | + { |
3595 | + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
3596 | + { |
3597 | + yycount = 1; |
3598 | + break; |
3599 | + } |
3600 | + else |
3601 | + yyarg[yycount++] = yytname_[yyx]; |
3602 | + } |
3603 | + } |
3604 | + } |
3605 | + |
3606 | + char const* yyformat = YY_NULLPTR; |
3607 | + switch (yycount) |
3608 | + { |
3609 | +#define YYCASE_(N, S) \ |
3610 | + case N: \ |
3611 | + yyformat = S; \ |
3612 | + break |
3613 | + YYCASE_(0, YY_("syntax error")); |
3614 | + YYCASE_(1, YY_("syntax error, unexpected %s")); |
3615 | + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
3616 | + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
3617 | + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
3618 | + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
3619 | +#undef YYCASE_ |
3620 | + } |
3621 | + |
3622 | + // Argument number. |
3623 | + size_t yyi = 0; |
3624 | + for (char const* yyp = yyformat; *yyp; ++yyp) |
3625 | + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) |
3626 | + { |
3627 | + yyres += yytnamerr_ (yyarg[yyi++]); |
3628 | + ++yyp; |
3629 | + } |
3630 | + else |
3631 | + yyres += *yyp; |
3632 | + return yyres; |
3633 | } |
3634 | |
3635 | |
3636 | - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
3637 | - STATE-NUM. */ |
3638 | - const signed char Parser::yypact_ninf_ = -29; |
3639 | + const signed char Parser::yypact_ninf_ = -11; |
3640 | + |
3641 | + const signed char Parser::yytable_ninf_ = -1; |
3642 | + |
3643 | const signed char |
3644 | Parser::yypact_[] = |
3645 | { |
3646 | - 46, -1, -1, -1, -1, 7, -29, -29, -1, 9, |
3647 | - -29, -29, -29, 25, -2, 43, 14, -29, -29, -29, |
3648 | - -29, -29, -29, -29, -2, -2, -2, -29, -6, 38, |
3649 | - -1, -29, 18, 14, -1, -1, -29, -29, -29, -29, |
3650 | - -29, 25, 25, 18, 25, -29, -29, 40, -5, -29, |
3651 | - 14, 14, 3, -29 |
3652 | + 49, 2, 2, 2, 2, 22, 16, -11, -11, 2, |
3653 | + 11, -11, -11, -11, 4, -9, 48, 19, -11, -11, |
3654 | + -11, -11, -11, -11, -11, -9, -9, -9, 9, -11, |
3655 | + 25, 26, 2, -11, 3, 19, 2, 2, -11, -11, |
3656 | + -11, -11, -11, 4, 4, 3, 4, 2, 2, -11, |
3657 | + -11, 33, 29, -11, 19, 19, -10, -11, -9, -9 |
3658 | }; |
3659 | |
3660 | - /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
3661 | - doesn't specify something else to do. Zero means the default is an |
3662 | - error. */ |
3663 | const unsigned char |
3664 | Parser::yydefact_[] = |
3665 | { |
3666 | - 0, 0, 0, 0, 0, 0, 20, 19, 0, 0, |
3667 | - 25, 26, 28, 0, 2, 0, 15, 17, 6, 7, |
3668 | - 8, 9, 11, 10, 3, 5, 4, 1, 0, 0, |
3669 | - 0, 22, 0, 14, 0, 0, 29, 30, 31, 32, |
3670 | - 33, 0, 0, 0, 0, 21, 18, 0, 23, 24, |
3671 | - 12, 13, 27, 16 |
3672 | + 0, 0, 0, 0, 0, 0, 0, 22, 21, 0, |
3673 | + 0, 27, 28, 30, 0, 2, 0, 17, 19, 8, |
3674 | + 9, 10, 11, 13, 12, 3, 5, 4, 0, 1, |
3675 | + 0, 0, 0, 24, 0, 16, 0, 0, 31, 32, |
3676 | + 33, 34, 35, 0, 0, 0, 0, 0, 0, 23, |
3677 | + 20, 0, 25, 26, 14, 15, 29, 18, 7, 6 |
3678 | }; |
3679 | |
3680 | - /* YYPGOTO[NTERM-NUM]. */ |
3681 | const signed char |
3682 | Parser::yypgoto_[] = |
3683 | { |
3684 | - -29, -29, 2, -8, -12, -28, 22, -29, -29, -29, |
3685 | - -29, -29, -29 |
3686 | + -11, -11, -1, -5, -6, 18, 55, -11, -11, -11, |
3687 | + -11, -11, -11 |
3688 | }; |
3689 | |
3690 | - /* YYDEFGOTO[NTERM-NUM]. */ |
3691 | const signed char |
3692 | Parser::yydefgoto_[] = |
3693 | { |
3694 | - -1, 5, 28, 15, 16, 17, 18, 19, 20, 21, |
3695 | - 22, 23, 43 |
3696 | + -1, 6, 30, 16, 17, 18, 19, 20, 21, 22, |
3697 | + 23, 24, 45 |
3698 | }; |
3699 | |
3700 | - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
3701 | - positive, shift that token. If negative, reduce the rule which |
3702 | - number is the opposite. If zero, do what YYDEFACT says. */ |
3703 | - const signed char Parser::yytable_ninf_ = -1; |
3704 | const unsigned char |
3705 | Parser::yytable_[] = |
3706 | { |
3707 | - 29, 33, 6, 14, 24, 25, 26, 27, 7, 45, |
3708 | - 34, 35, 35, 8, 34, 35, 53, 9, 10, 11, |
3709 | - 12, 6, 13, 30, 47, 41, 42, 7, 6, 50, |
3710 | - 51, 31, 32, 0, 7, 52, 48, 49, 44, 32, |
3711 | - 0, 13, 36, 37, 38, 39, 40, 36, 37, 38, |
3712 | - 39, 40, 0, 46, 0, 46, 1, 2, 3, 4, |
3713 | - 41, 42, 41, 42, 0, 41, 42 |
3714 | + 15, 25, 26, 27, 31, 7, 7, 7, 35, 36, |
3715 | + 37, 8, 8, 8, 43, 44, 29, 9, 34, 34, |
3716 | + 47, 48, 10, 11, 12, 13, 32, 14, 14, 51, |
3717 | + 38, 39, 40, 41, 42, 52, 53, 54, 55, 28, |
3718 | + 56, 49, 50, 36, 37, 46, 58, 59, 37, 50, |
3719 | + 43, 44, 38, 39, 40, 41, 42, 43, 44, 1, |
3720 | + 2, 3, 4, 5, 57, 33, 0, 0, 0, 0, |
3721 | + 0, 0, 43, 44 |
3722 | }; |
3723 | |
3724 | - /* YYCHECK. */ |
3725 | const signed char |
3726 | Parser::yycheck_[] = |
3727 | { |
3728 | - 8, 13, 3, 1, 2, 3, 4, 0, 9, 15, |
3729 | - 16, 17, 17, 14, 16, 17, 44, 18, 19, 20, |
3730 | - 21, 3, 23, 14, 32, 22, 23, 9, 3, 41, |
3731 | - 42, 9, 14, -1, 9, 43, 34, 35, 24, 14, |
3732 | - -1, 23, 4, 5, 6, 7, 8, 4, 5, 6, |
3733 | - 7, 8, -1, 15, -1, 15, 10, 11, 12, 13, |
3734 | - 22, 23, 22, 23, -1, 22, 23 |
3735 | + 1, 2, 3, 4, 9, 3, 3, 3, 14, 18, |
3736 | + 19, 9, 9, 9, 24, 25, 0, 15, 15, 15, |
3737 | + 11, 12, 20, 21, 22, 23, 15, 25, 25, 34, |
3738 | + 4, 5, 6, 7, 8, 36, 37, 43, 44, 17, |
3739 | + 45, 16, 16, 18, 19, 26, 47, 48, 19, 16, |
3740 | + 24, 25, 4, 5, 6, 7, 8, 24, 25, 10, |
3741 | + 11, 12, 13, 14, 46, 10, -1, -1, -1, -1, |
3742 | + -1, -1, 24, 25 |
3743 | }; |
3744 | |
3745 | - /* STOS_[STATE-NUM] -- The (internal number of the) accessing |
3746 | - symbol of state STATE-NUM. */ |
3747 | const unsigned char |
3748 | Parser::yystos_[] = |
3749 | { |
3750 | - 0, 10, 11, 12, 13, 26, 3, 9, 14, 18, |
3751 | - 19, 20, 21, 23, 27, 28, 29, 30, 31, 32, |
3752 | - 33, 34, 35, 36, 27, 27, 27, 0, 27, 28, |
3753 | - 14, 31, 14, 29, 16, 17, 4, 5, 6, 7, |
3754 | - 8, 22, 23, 37, 24, 15, 15, 28, 27, 27, |
3755 | - 29, 29, 28, 30 |
3756 | - }; |
3757 | - |
3758 | -#if YYDEBUG |
3759 | - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding |
3760 | - to YYLEX-NUM. */ |
3761 | - const unsigned short int |
3762 | - Parser::yytoken_number_[] = |
3763 | - { |
3764 | - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
3765 | - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
3766 | - 275, 276, 277, 278, 279 |
3767 | - }; |
3768 | -#endif |
3769 | - |
3770 | - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
3771 | + 0, 10, 11, 12, 13, 14, 28, 3, 9, 15, |
3772 | + 20, 21, 22, 23, 25, 29, 30, 31, 32, 33, |
3773 | + 34, 35, 36, 37, 38, 29, 29, 29, 17, 0, |
3774 | + 29, 30, 15, 33, 15, 31, 18, 19, 4, 5, |
3775 | + 6, 7, 8, 24, 25, 39, 26, 11, 12, 16, |
3776 | + 16, 30, 29, 29, 31, 31, 30, 32, 29, 29 |
3777 | + }; |
3778 | + |
3779 | const unsigned char |
3780 | Parser::yyr1_[] = |
3781 | { |
3782 | - 0, 25, 26, 26, 26, 26, 27, 27, 27, 27, |
3783 | - 27, 27, 28, 28, 28, 28, 29, 29, 30, 30, |
3784 | - 30, 31, 32, 33, 34, 35, 35, 36, 36, 37, |
3785 | - 37, 37, 37, 37 |
3786 | + 0, 27, 28, 28, 28, 28, 28, 28, 29, 29, |
3787 | + 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, |
3788 | + 32, 32, 32, 33, 34, 35, 36, 37, 37, 38, |
3789 | + 38, 39, 39, 39, 39, 39 |
3790 | }; |
3791 | |
3792 | - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
3793 | const unsigned char |
3794 | Parser::yyr2_[] = |
3795 | { |
3796 | - 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, |
3797 | - 1, 1, 3, 3, 2, 1, 3, 1, 3, 1, |
3798 | - 1, 3, 2, 3, 3, 1, 1, 3, 1, 1, |
3799 | - 1, 1, 1, 1 |
3800 | + 0, 2, 2, 2, 2, 2, 4, 4, 1, 1, |
3801 | + 1, 1, 1, 1, 3, 3, 2, 1, 3, 1, |
3802 | + 3, 1, 1, 3, 2, 3, 3, 1, 1, 3, |
3803 | + 1, 1, 1, 1, 1, 1 |
3804 | }; |
3805 | |
3806 | -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
3807 | - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
3808 | - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ |
3809 | + |
3810 | + |
3811 | + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
3812 | + // First, the terminals, then, starting at \a yyntokens_, nonterminals. |
3813 | const char* |
3814 | const Parser::yytname_[] = |
3815 | { |
3816 | - "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL", |
3817 | + "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL", |
3818 | "EQUAL", "GREATEREQUAL", "GREATER", "NUMBER", "EF", "AG", "AF", "EG", |
3819 | - "LPARAN", "RPARAN", "OR", "AND", "NOT", "BOOL_TRUE", "BOOL_FALSE", |
3820 | - "DEADLOCK", "PLUS", "MINUS", "MULTIPLY", "$accept", "query", |
3821 | - "expression", "arithmeticExpression", "multiplyExpression", |
3822 | + "CONTROL", "LPARAN", "RPARAN", "COLON", "OR", "AND", "NOT", "BOOL_TRUE", |
3823 | + "BOOL_FALSE", "DEADLOCK", "PLUS", "MINUS", "MULTIPLY", "$accept", |
3824 | + "query", "expression", "arithmeticExpression", "multiplyExpression", |
3825 | "arithmeticParantheses", "parExpression", "notExpression", |
3826 | "orExpression", "andExpression", "boolExpression", "atomicProposition", |
3827 | - "compareOp", 0 |
3828 | + "compareOp", YY_NULLPTR |
3829 | }; |
3830 | -#endif |
3831 | |
3832 | #if YYDEBUG |
3833 | - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
3834 | - const Parser::rhs_number_type |
3835 | - Parser::yyrhs_[] = |
3836 | - { |
3837 | - 26, 0, -1, 10, 27, -1, 11, 27, -1, 13, |
3838 | - 27, -1, 12, 27, -1, 31, -1, 32, -1, 33, |
3839 | - -1, 34, -1, 36, -1, 35, -1, 28, 22, 29, |
3840 | - -1, 28, 23, 29, -1, 23, 29, -1, 29, -1, |
3841 | - 29, 24, 30, -1, 30, -1, 14, 28, 15, -1, |
3842 | - 9, -1, 3, -1, 14, 27, 15, -1, 18, 31, |
3843 | - -1, 27, 16, 27, -1, 27, 17, 27, -1, 19, |
3844 | - -1, 20, -1, 28, 37, 28, -1, 21, -1, 4, |
3845 | - -1, 5, -1, 6, -1, 7, -1, 8, -1 |
3846 | - }; |
3847 | - |
3848 | - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
3849 | - YYRHS. */ |
3850 | - const unsigned char |
3851 | - Parser::yyprhs_[] = |
3852 | - { |
3853 | - 0, 0, 3, 6, 9, 12, 15, 17, 19, 21, |
3854 | - 23, 25, 27, 31, 35, 38, 40, 44, 46, 50, |
3855 | - 52, 54, 58, 61, 65, 69, 71, 73, 77, 79, |
3856 | - 81, 83, 85, 87 |
3857 | - }; |
3858 | - |
3859 | - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
3860 | const unsigned char |
3861 | Parser::yyrline_[] = |
3862 | { |
3863 | - 0, 62, 62, 63, 64, 65, 68, 69, 70, 71, |
3864 | - 72, 73, 79, 80, 81, 82, 85, 86, 89, 90, |
3865 | - 91, 99, 100, 101, 102, 103, 104, 106, 107, 109, |
3866 | - 109, 109, 109, 109 |
3867 | + 0, 62, 62, 63, 64, 65, 66, 67, 70, 71, |
3868 | + 72, 73, 74, 75, 81, 82, 83, 84, 87, 88, |
3869 | + 91, 92, 93, 101, 102, 103, 104, 105, 106, 108, |
3870 | + 109, 111, 111, 111, 111, 111 |
3871 | }; |
3872 | |
3873 | // Print the state stack on the debug stream. |
3874 | @@ -1164,9 +1287,11 @@ |
3875 | Parser::yystack_print_ () |
3876 | { |
3877 | *yycdebug_ << "Stack now"; |
3878 | - for (state_stack_type::const_iterator i = yystate_stack_.begin (); |
3879 | - i != yystate_stack_.end (); ++i) |
3880 | - *yycdebug_ << ' ' << *i; |
3881 | + for (stack_type::const_iterator |
3882 | + i = yystack_.begin (), |
3883 | + i_end = yystack_.end (); |
3884 | + i != i_end; ++i) |
3885 | + *yycdebug_ << ' ' << i->state; |
3886 | *yycdebug_ << std::endl; |
3887 | } |
3888 | |
3889 | @@ -1176,19 +1301,18 @@ |
3890 | { |
3891 | unsigned int yylno = yyrline_[yyrule]; |
3892 | int yynrhs = yyr2_[yyrule]; |
3893 | - /* Print the symbols being reduced, and their result. */ |
3894 | + // Print the symbols being reduced, and their result. |
3895 | *yycdebug_ << "Reducing stack by rule " << yyrule - 1 |
3896 | - << " (line " << yylno << "):" << std::endl; |
3897 | - /* The symbols being reduced. */ |
3898 | + << " (line " << yylno << "):" << std::endl; |
3899 | + // The symbols being reduced. |
3900 | for (int yyi = 0; yyi < yynrhs; yyi++) |
3901 | YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", |
3902 | - yyrhs_[yyprhs_[yyrule] + yyi], |
3903 | - &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), |
3904 | - &(yylocation_stack_[(yynrhs) - (yyi + 1)])); |
3905 | + yystack_[(yynrhs) - (yyi + 1)]); |
3906 | } |
3907 | #endif // YYDEBUG |
3908 | |
3909 | - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
3910 | + // Symbol number corresponding to token number t. |
3911 | + inline |
3912 | Parser::token_number_type |
3913 | Parser::yytranslate_ (int t) |
3914 | { |
3915 | @@ -1196,7 +1320,7 @@ |
3916 | const token_number_type |
3917 | translate_table[] = |
3918 | { |
3919 | - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3920 | + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3921 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3922 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3923 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3924 | @@ -1223,37 +1347,24 @@ |
3925 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
3926 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
3927 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
3928 | - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 |
3929 | + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
3930 | + 25, 26 |
3931 | }; |
3932 | - if ((unsigned int) t <= yyuser_token_number_max_) |
3933 | + const unsigned int user_token_number_max_ = 281; |
3934 | + const token_number_type undef_token_ = 2; |
3935 | + |
3936 | + if (static_cast<int>(t) <= yyeof_) |
3937 | + return yyeof_; |
3938 | + else if (static_cast<unsigned int> (t) <= user_token_number_max_) |
3939 | return translate_table[t]; |
3940 | else |
3941 | - return yyundef_token_; |
3942 | + return undef_token_; |
3943 | } |
3944 | |
3945 | - const int Parser::yyeof_ = 0; |
3946 | - const int Parser::yylast_ = 66; |
3947 | - const int Parser::yynnts_ = 13; |
3948 | - const int Parser::yyempty_ = -2; |
3949 | - const int Parser::yyfinal_ = 27; |
3950 | - const int Parser::yyterror_ = 1; |
3951 | - const int Parser::yyerrcode_ = 256; |
3952 | - const int Parser::yyntokens_ = 25; |
3953 | - |
3954 | - const unsigned int Parser::yyuser_token_number_max_ = 279; |
3955 | - const Parser::token_number_type Parser::yyundef_token_ = 2; |
3956 | - |
3957 | - |
3958 | -/* Line 1054 of lalr1.cc */ |
3959 | -#line 5 "src/Core/QueryParser/grammar.yy" |
3960 | +#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:1155 |
3961 | } // VerifyTAPN |
3962 | - |
3963 | -/* Line 1054 of lalr1.cc */ |
3964 | -#line 1253 "src/Core/QueryParser/Generated/parser.cpp" |
3965 | - |
3966 | - |
3967 | -/* Line 1056 of lalr1.cc */ |
3968 | -#line 111 "src/Core/QueryParser/grammar.yy" |
3969 | +#line 1367 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:1155 |
3970 | +#line 113 "src/Core/QueryParser/grammar.yy" // lalr1.cc:1156 |
3971 | |
3972 | |
3973 | void |
3974 | @@ -1263,4 +1374,3 @@ |
3975 | driver.error (l, m); |
3976 | exit(1); |
3977 | } |
3978 | - |
3979 | |
3980 | === modified file 'src/Core/QueryParser/Generated/parser.hpp' |
3981 | --- src/Core/QueryParser/Generated/parser.hpp 2014-08-07 20:48:41 +0000 |
3982 | +++ src/Core/QueryParser/Generated/parser.hpp 2018-01-07 20:09:44 +0000 |
3983 | @@ -1,46 +1,46 @@ |
3984 | - |
3985 | -/* A Bison parser, made by GNU Bison 2.4.1. */ |
3986 | - |
3987 | -/* Skeleton interface for Bison LALR(1) parsers in C++ |
3988 | - |
3989 | - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software |
3990 | - Foundation, Inc. |
3991 | - |
3992 | - This program is free software: you can redistribute it and/or modify |
3993 | - it under the terms of the GNU General Public License as published by |
3994 | - the Free Software Foundation, either version 3 of the License, or |
3995 | - (at your option) any later version. |
3996 | - |
3997 | - This program is distributed in the hope that it will be useful, |
3998 | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
3999 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4000 | - GNU General Public License for more details. |
4001 | - |
4002 | - You should have received a copy of the GNU General Public License |
4003 | - along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
4004 | - |
4005 | -/* As a special exception, you may create a larger work that contains |
4006 | - part or all of the Bison parser skeleton and distribute that work |
4007 | - under terms of your choice, so long as that work isn't itself a |
4008 | - parser generator using the skeleton or a modified version thereof |
4009 | - as a parser skeleton. Alternatively, if you modify or redistribute |
4010 | - the parser skeleton itself, you may (at your option) remove this |
4011 | - special exception, which will cause the skeleton and the resulting |
4012 | - Bison output files to be licensed under the GNU General Public |
4013 | - License without this special exception. |
4014 | - |
4015 | - This special exception was added by the Free Software Foundation in |
4016 | - version 2.2 of Bison. */ |
4017 | - |
4018 | -/* C++ LALR(1) parser skeleton written by Akim Demaille. */ |
4019 | - |
4020 | -#ifndef PARSER_HEADER_H |
4021 | -# define PARSER_HEADER_H |
4022 | - |
4023 | -/* "%code requires" blocks. */ |
4024 | - |
4025 | -/* Line 300 of lalr1.cc */ |
4026 | -#line 7 "src/Core/QueryParser/grammar.yy" |
4027 | +// A Bison parser, made by GNU Bison 3.0.2. |
4028 | + |
4029 | +// Skeleton interface for Bison LALR(1) parsers in C++ |
4030 | + |
4031 | +// Copyright (C) 2002-2013 Free Software Foundation, Inc. |
4032 | + |
4033 | +// This program is free software: you can redistribute it and/or modify |
4034 | +// it under the terms of the GNU General Public License as published by |
4035 | +// the Free Software Foundation, either version 3 of the License, or |
4036 | +// (at your option) any later version. |
4037 | + |
4038 | +// This program is distributed in the hope that it will be useful, |
4039 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4040 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4041 | +// GNU General Public License for more details. |
4042 | + |
4043 | +// You should have received a copy of the GNU General Public License |
4044 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
4045 | + |
4046 | +// As a special exception, you may create a larger work that contains |
4047 | +// part or all of the Bison parser skeleton and distribute that work |
4048 | +// under terms of your choice, so long as that work isn't itself a |
4049 | +// parser generator using the skeleton or a modified version thereof |
4050 | +// as a parser skeleton. Alternatively, if you modify or redistribute |
4051 | +// the parser skeleton itself, you may (at your option) remove this |
4052 | +// special exception, which will cause the skeleton and the resulting |
4053 | +// Bison output files to be licensed under the GNU General Public |
4054 | +// License without this special exception. |
4055 | + |
4056 | +// This special exception was added by the Free Software Foundation in |
4057 | +// version 2.2 of Bison. |
4058 | + |
4059 | +/** |
4060 | + ** \file src/Core/QueryParser/Generated/parser.hpp |
4061 | + ** Define the VerifyTAPN::parser class. |
4062 | + */ |
4063 | + |
4064 | +// C++ LALR(1) parser skeleton written by Akim Demaille. |
4065 | + |
4066 | +#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED |
4067 | +# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED |
4068 | +// // "%code requires" blocks. |
4069 | +#line 7 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372 |
4070 | |
4071 | # include <string> |
4072 | #include "../AST.hpp" |
4073 | @@ -48,91 +48,92 @@ |
4074 | class TAPNQueryParser; |
4075 | } |
4076 | |
4077 | - |
4078 | - |
4079 | -/* Line 300 of lalr1.cc */ |
4080 | -#line 55 "src/Core/QueryParser/Generated/parser.hpp" |
4081 | - |
4082 | - |
4083 | -#include <string> |
4084 | -#include <iostream> |
4085 | -#include "stack.hh" |
4086 | - |
4087 | - |
4088 | -/* Line 300 of lalr1.cc */ |
4089 | -#line 5 "src/Core/QueryParser/grammar.yy" |
4090 | -namespace VerifyTAPN { |
4091 | - |
4092 | -/* Line 300 of lalr1.cc */ |
4093 | -#line 68 "src/Core/QueryParser/Generated/parser.hpp" |
4094 | - class position; |
4095 | - class location; |
4096 | - |
4097 | -/* Line 300 of lalr1.cc */ |
4098 | -#line 5 "src/Core/QueryParser/grammar.yy" |
4099 | -} // VerifyTAPN |
4100 | - |
4101 | -/* Line 300 of lalr1.cc */ |
4102 | -#line 77 "src/Core/QueryParser/Generated/parser.hpp" |
4103 | - |
4104 | -#include "location.hh" |
4105 | - |
4106 | -/* Enabling traces. */ |
4107 | +#line 52 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372 |
4108 | + |
4109 | + |
4110 | +# include <vector> |
4111 | +# include <iostream> |
4112 | +# include <stdexcept> |
4113 | +# include <string> |
4114 | +# include "stack.hh" |
4115 | +# include "location.hh" |
4116 | + |
4117 | + |
4118 | +#ifndef YY_ATTRIBUTE |
4119 | +# if (defined __GNUC__ \ |
4120 | + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ |
4121 | + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C |
4122 | +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) |
4123 | +# else |
4124 | +# define YY_ATTRIBUTE(Spec) /* empty */ |
4125 | +# endif |
4126 | +#endif |
4127 | + |
4128 | +#ifndef YY_ATTRIBUTE_PURE |
4129 | +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
4130 | +#endif |
4131 | + |
4132 | +#ifndef YY_ATTRIBUTE_UNUSED |
4133 | +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
4134 | +#endif |
4135 | + |
4136 | +#if !defined _Noreturn \ |
4137 | + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) |
4138 | +# if defined _MSC_VER && 1200 <= _MSC_VER |
4139 | +# define _Noreturn __declspec (noreturn) |
4140 | +# else |
4141 | +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) |
4142 | +# endif |
4143 | +#endif |
4144 | + |
4145 | +/* Suppress unused-variable warnings by "using" E. */ |
4146 | +#if ! defined lint || defined __GNUC__ |
4147 | +# define YYUSE(E) ((void) (E)) |
4148 | +#else |
4149 | +# define YYUSE(E) /* empty */ |
4150 | +#endif |
4151 | + |
4152 | +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
4153 | +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
4154 | +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
4155 | + _Pragma ("GCC diagnostic push") \ |
4156 | + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
4157 | + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
4158 | +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
4159 | + _Pragma ("GCC diagnostic pop") |
4160 | +#else |
4161 | +# define YY_INITIAL_VALUE(Value) Value |
4162 | +#endif |
4163 | +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
4164 | +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
4165 | +# define YY_IGNORE_MAYBE_UNINITIALIZED_END |
4166 | +#endif |
4167 | +#ifndef YY_INITIAL_VALUE |
4168 | +# define YY_INITIAL_VALUE(Value) /* Nothing. */ |
4169 | +#endif |
4170 | + |
4171 | +/* Debug traces. */ |
4172 | #ifndef YYDEBUG |
4173 | # define YYDEBUG 0 |
4174 | #endif |
4175 | |
4176 | -/* Enabling verbose error messages. */ |
4177 | -#ifdef YYERROR_VERBOSE |
4178 | -# undef YYERROR_VERBOSE |
4179 | -# define YYERROR_VERBOSE 1 |
4180 | -#else |
4181 | -# define YYERROR_VERBOSE 1 |
4182 | -#endif |
4183 | - |
4184 | -/* Enabling the token table. */ |
4185 | -#ifndef YYTOKEN_TABLE |
4186 | -# define YYTOKEN_TABLE 0 |
4187 | -#endif |
4188 | - |
4189 | -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
4190 | - If N is 0, then set CURRENT to the empty location which ends |
4191 | - the previous symbol: RHS[0] (always defined). */ |
4192 | - |
4193 | -#ifndef YYLLOC_DEFAULT |
4194 | -# define YYLLOC_DEFAULT(Current, Rhs, N) \ |
4195 | -do { \ |
4196 | - if (N) \ |
4197 | - { \ |
4198 | - (Current).begin = (Rhs)[1].begin; \ |
4199 | - (Current).end = (Rhs)[N].end; \ |
4200 | - } \ |
4201 | - else \ |
4202 | - { \ |
4203 | - (Current).begin = (Current).end = (Rhs)[0].end; \ |
4204 | - } \ |
4205 | -} while (false) |
4206 | -#endif |
4207 | - |
4208 | - |
4209 | -/* Line 300 of lalr1.cc */ |
4210 | -#line 5 "src/Core/QueryParser/grammar.yy" |
4211 | +#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372 |
4212 | namespace VerifyTAPN { |
4213 | - |
4214 | -/* Line 300 of lalr1.cc */ |
4215 | -#line 124 "src/Core/QueryParser/Generated/parser.hpp" |
4216 | +#line 123 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372 |
4217 | + |
4218 | + |
4219 | + |
4220 | + |
4221 | |
4222 | /// A Bison parser. |
4223 | class Parser |
4224 | { |
4225 | public: |
4226 | +#ifndef YYSTYPE |
4227 | /// Symbol semantic values. |
4228 | -#ifndef YYSTYPE |
4229 | union semantic_type |
4230 | { |
4231 | - |
4232 | -/* Line 300 of lalr1.cc */ |
4233 | -#line 30 "src/Core/QueryParser/grammar.yy" |
4234 | + #line 30 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372 |
4235 | |
4236 | int number; |
4237 | std::string* string; |
4238 | @@ -140,50 +141,142 @@ |
4239 | VerifyTAPN::AST::ArithmeticExpression* arexpr; |
4240 | VerifyTAPN::AST::Query* query; |
4241 | |
4242 | - |
4243 | - |
4244 | -/* Line 300 of lalr1.cc */ |
4245 | -#line 147 "src/Core/QueryParser/Generated/parser.hpp" |
4246 | +#line 145 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372 |
4247 | }; |
4248 | #else |
4249 | typedef YYSTYPE semantic_type; |
4250 | #endif |
4251 | /// Symbol locations. |
4252 | typedef location location_type; |
4253 | + |
4254 | + /// Syntax errors thrown from user actions. |
4255 | + struct syntax_error : std::runtime_error |
4256 | + { |
4257 | + syntax_error (const location_type& l, const std::string& m); |
4258 | + location_type location; |
4259 | + }; |
4260 | + |
4261 | /// Tokens. |
4262 | struct token |
4263 | { |
4264 | - /* Tokens. */ |
4265 | - enum yytokentype { |
4266 | - END = 0, |
4267 | - IDENTIFIER = 258, |
4268 | - LESS = 259, |
4269 | - LESSEQUAL = 260, |
4270 | - EQUAL = 261, |
4271 | - GREATEREQUAL = 262, |
4272 | - GREATER = 263, |
4273 | - NUMBER = 264, |
4274 | - EF = 265, |
4275 | - AG = 266, |
4276 | - AF = 267, |
4277 | - EG = 268, |
4278 | - LPARAN = 269, |
4279 | - RPARAN = 270, |
4280 | - OR = 271, |
4281 | - AND = 272, |
4282 | - NOT = 273, |
4283 | - BOOL_TRUE = 274, |
4284 | - BOOL_FALSE = 275, |
4285 | - DEADLOCK = 276, |
4286 | - PLUS = 277, |
4287 | - MINUS = 278, |
4288 | - MULTIPLY = 279 |
4289 | - }; |
4290 | + enum yytokentype |
4291 | + { |
4292 | + END = 0, |
4293 | + IDENTIFIER = 258, |
4294 | + LESS = 259, |
4295 | + LESSEQUAL = 260, |
4296 | + EQUAL = 261, |
4297 | + GREATEREQUAL = 262, |
4298 | + GREATER = 263, |
4299 | + NUMBER = 264, |
4300 | + EF = 265, |
4301 | + AG = 266, |
4302 | + AF = 267, |
4303 | + EG = 268, |
4304 | + CONTROL = 269, |
4305 | + LPARAN = 270, |
4306 | + RPARAN = 271, |
4307 | + COLON = 272, |
4308 | + OR = 273, |
4309 | + AND = 274, |
4310 | + NOT = 275, |
4311 | + BOOL_TRUE = 276, |
4312 | + BOOL_FALSE = 277, |
4313 | + DEADLOCK = 278, |
4314 | + PLUS = 279, |
4315 | + MINUS = 280, |
4316 | + MULTIPLY = 281 |
4317 | + }; |
4318 | + }; |
4319 | |
4320 | - }; |
4321 | - /// Token type. |
4322 | + /// (External) token type, as returned by yylex. |
4323 | typedef token::yytokentype token_type; |
4324 | |
4325 | + /// Internal symbol number. |
4326 | + typedef int symbol_number_type; |
4327 | + |
4328 | + /// Internal symbol number for tokens (subsumed by symbol_number_type). |
4329 | + typedef unsigned char token_number_type; |
4330 | + |
4331 | + /// A complete symbol. |
4332 | + /// |
4333 | + /// Expects its Base type to provide access to the symbol type |
4334 | + /// via type_get(). |
4335 | + /// |
4336 | + /// Provide access to semantic value and location. |
4337 | + template <typename Base> |
4338 | + struct basic_symbol : Base |
4339 | + { |
4340 | + /// Alias to Base. |
4341 | + typedef Base super_type; |
4342 | + |
4343 | + /// Default constructor. |
4344 | + basic_symbol (); |
4345 | + |
4346 | + /// Copy constructor. |
4347 | + basic_symbol (const basic_symbol& other); |
4348 | + |
4349 | + /// Constructor for valueless symbols. |
4350 | + basic_symbol (typename Base::kind_type t, |
4351 | + const location_type& l); |
4352 | + |
4353 | + /// Constructor for symbols with semantic value. |
4354 | + basic_symbol (typename Base::kind_type t, |
4355 | + const semantic_type& v, |
4356 | + const location_type& l); |
4357 | + |
4358 | + ~basic_symbol (); |
4359 | + |
4360 | + /// Destructive move, \a s is emptied into this. |
4361 | + void move (basic_symbol& s); |
4362 | + |
4363 | + /// The semantic value. |
4364 | + semantic_type value; |
4365 | + |
4366 | + /// The location. |
4367 | + location_type location; |
4368 | + |
4369 | + private: |
4370 | + /// Assignment operator. |
4371 | + basic_symbol& operator= (const basic_symbol& other); |
4372 | + }; |
4373 | + |
4374 | + /// Type access provider for token (enum) based symbols. |
4375 | + struct by_type |
4376 | + { |
4377 | + /// Default constructor. |
4378 | + by_type (); |
4379 | + |
4380 | + /// Copy constructor. |
4381 | + by_type (const by_type& other); |
4382 | + |
4383 | + /// The symbol type as needed by the constructor. |
4384 | + typedef token_type kind_type; |
4385 | + |
4386 | + /// Constructor from (external) token numbers. |
4387 | + by_type (kind_type t); |
4388 | + |
4389 | + /// Steal the symbol type from \a that. |
4390 | + void move (by_type& that); |
4391 | + |
4392 | + /// The (internal) type number (corresponding to \a type). |
4393 | + /// -1 when this symbol is empty. |
4394 | + symbol_number_type type_get () const; |
4395 | + |
4396 | + /// The token. |
4397 | + token_type token () const; |
4398 | + |
4399 | + enum { empty = 0 }; |
4400 | + |
4401 | + /// The symbol type. |
4402 | + /// -1 when this symbol is empty. |
4403 | + token_number_type type; |
4404 | + }; |
4405 | + |
4406 | + /// "External" symbols: returned by the scanner. |
4407 | + typedef basic_symbol<by_type> symbol_type; |
4408 | + |
4409 | + |
4410 | /// Build a parser object. |
4411 | Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg); |
4412 | virtual ~Parser (); |
4413 | @@ -194,167 +287,215 @@ |
4414 | |
4415 | #if YYDEBUG |
4416 | /// The current debugging stream. |
4417 | - std::ostream& debug_stream () const; |
4418 | + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; |
4419 | /// Set the current debugging stream. |
4420 | void set_debug_stream (std::ostream &); |
4421 | |
4422 | /// Type for debugging levels. |
4423 | typedef int debug_level_type; |
4424 | /// The current debugging level. |
4425 | - debug_level_type debug_level () const; |
4426 | + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; |
4427 | /// Set the current debugging level. |
4428 | void set_debug_level (debug_level_type l); |
4429 | #endif |
4430 | |
4431 | - private: |
4432 | /// Report a syntax error. |
4433 | /// \param loc where the syntax error is found. |
4434 | /// \param msg a description of the syntax error. |
4435 | virtual void error (const location_type& loc, const std::string& msg); |
4436 | |
4437 | - /// Generate an error message. |
4438 | - /// \param state the state where the error occurred. |
4439 | - /// \param tok the lookahead token. |
4440 | - virtual std::string yysyntax_error_ (int yystate, int tok); |
4441 | - |
4442 | -#if YYDEBUG |
4443 | - /// \brief Report a symbol value on the debug stream. |
4444 | - /// \param yytype The token type. |
4445 | - /// \param yyvaluep Its semantic value. |
4446 | - /// \param yylocationp Its location. |
4447 | - virtual void yy_symbol_value_print_ (int yytype, |
4448 | - const semantic_type* yyvaluep, |
4449 | - const location_type* yylocationp); |
4450 | - /// \brief Report a symbol on the debug stream. |
4451 | - /// \param yytype The token type. |
4452 | - /// \param yyvaluep Its semantic value. |
4453 | - /// \param yylocationp Its location. |
4454 | - virtual void yy_symbol_print_ (int yytype, |
4455 | - const semantic_type* yyvaluep, |
4456 | - const location_type* yylocationp); |
4457 | -#endif |
4458 | - |
4459 | + /// Report a syntax error. |
4460 | + void error (const syntax_error& err); |
4461 | + |
4462 | + private: |
4463 | + /// This class is not copyable. |
4464 | + Parser (const Parser&); |
4465 | + Parser& operator= (const Parser&); |
4466 | |
4467 | /// State numbers. |
4468 | typedef int state_type; |
4469 | - /// State stack type. |
4470 | - typedef stack<state_type> state_stack_type; |
4471 | - /// Semantic value stack type. |
4472 | - typedef stack<semantic_type> semantic_stack_type; |
4473 | - /// location stack type. |
4474 | - typedef stack<location_type> location_stack_type; |
4475 | - |
4476 | - /// The state stack. |
4477 | - state_stack_type yystate_stack_; |
4478 | - /// The semantic value stack. |
4479 | - semantic_stack_type yysemantic_stack_; |
4480 | - /// The location stack. |
4481 | - location_stack_type yylocation_stack_; |
4482 | - |
4483 | - /// Internal symbol numbers. |
4484 | - typedef unsigned char token_number_type; |
4485 | - /* Tables. */ |
4486 | - /// For a state, the index in \a yytable_ of its portion. |
4487 | - static const signed char yypact_[]; |
4488 | + |
4489 | + /// Generate an error message. |
4490 | + /// \param yystate the state where the error occurred. |
4491 | + /// \param yytoken the lookahead token type, or yyempty_. |
4492 | + virtual std::string yysyntax_error_ (state_type yystate, |
4493 | + symbol_number_type yytoken) const; |
4494 | + |
4495 | + /// Compute post-reduction state. |
4496 | + /// \param yystate the current state |
4497 | + /// \param yysym the nonterminal to push on the stack |
4498 | + state_type yy_lr_goto_state_ (state_type yystate, int yysym); |
4499 | + |
4500 | + /// Whether the given \c yypact_ value indicates a defaulted state. |
4501 | + /// \param yyvalue the value to check |
4502 | + static bool yy_pact_value_is_default_ (int yyvalue); |
4503 | + |
4504 | + /// Whether the given \c yytable_ value indicates a syntax error. |
4505 | + /// \param yyvalue the value to check |
4506 | + static bool yy_table_value_is_error_ (int yyvalue); |
4507 | + |
4508 | static const signed char yypact_ninf_; |
4509 | - |
4510 | - /// For a state, default rule to reduce. |
4511 | - /// Unless\a yytable_ specifies something else to do. |
4512 | - /// Zero means the default is an error. |
4513 | - static const unsigned char yydefact_[]; |
4514 | - |
4515 | - static const signed char yypgoto_[]; |
4516 | - static const signed char yydefgoto_[]; |
4517 | - |
4518 | - /// What to do in a state. |
4519 | - /// \a yytable_[yypact_[s]]: what to do in state \a s. |
4520 | - /// - if positive, shift that token. |
4521 | - /// - if negative, reduce the rule which number is the opposite. |
4522 | - /// - if zero, do what YYDEFACT says. |
4523 | - static const unsigned char yytable_[]; |
4524 | static const signed char yytable_ninf_; |
4525 | |
4526 | - static const signed char yycheck_[]; |
4527 | - |
4528 | - /// For a state, its accessing symbol. |
4529 | - static const unsigned char yystos_[]; |
4530 | - |
4531 | - /// For a rule, its LHS. |
4532 | - static const unsigned char yyr1_[]; |
4533 | - /// For a rule, its RHS length. |
4534 | - static const unsigned char yyr2_[]; |
4535 | - |
4536 | -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
4537 | + /// Convert a scanner token number \a t to a symbol number. |
4538 | + static token_number_type yytranslate_ (int t); |
4539 | + |
4540 | + // Tables. |
4541 | + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
4542 | + // STATE-NUM. |
4543 | + static const signed char yypact_[]; |
4544 | + |
4545 | + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
4546 | + // Performed when YYTABLE does not specify something else to do. Zero |
4547 | + // means the default is an error. |
4548 | + static const unsigned char yydefact_[]; |
4549 | + |
4550 | + // YYPGOTO[NTERM-NUM]. |
4551 | + static const signed char yypgoto_[]; |
4552 | + |
4553 | + // YYDEFGOTO[NTERM-NUM]. |
4554 | + static const signed char yydefgoto_[]; |
4555 | + |
4556 | + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
4557 | + // positive, shift that token. If negative, reduce the rule whose |
4558 | + // number is the opposite. If YYTABLE_NINF, syntax error. |
4559 | + static const unsigned char yytable_[]; |
4560 | + |
4561 | + static const signed char yycheck_[]; |
4562 | + |
4563 | + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
4564 | + // symbol of state STATE-NUM. |
4565 | + static const unsigned char yystos_[]; |
4566 | + |
4567 | + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. |
4568 | + static const unsigned char yyr1_[]; |
4569 | + |
4570 | + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. |
4571 | + static const unsigned char yyr2_[]; |
4572 | + |
4573 | + |
4574 | + /// Convert the symbol name \a n to a form suitable for a diagnostic. |
4575 | + static std::string yytnamerr_ (const char *n); |
4576 | + |
4577 | + |
4578 | /// For a symbol, its name in clear. |
4579 | static const char* const yytname_[]; |
4580 | -#endif |
4581 | - |
4582 | -#if YYERROR_VERBOSE |
4583 | - /// Convert the symbol name \a n to a form suitable for a diagnostic. |
4584 | - virtual std::string yytnamerr_ (const char *n); |
4585 | -#endif |
4586 | - |
4587 | #if YYDEBUG |
4588 | - /// A type to store symbol numbers and -1. |
4589 | - typedef signed char rhs_number_type; |
4590 | - /// A `-1'-separated list of the rules' RHS. |
4591 | - static const rhs_number_type yyrhs_[]; |
4592 | - /// For each rule, the index of the first RHS symbol in \a yyrhs_. |
4593 | - static const unsigned char yyprhs_[]; |
4594 | - /// For each rule, its source line number. |
4595 | - static const unsigned char yyrline_[]; |
4596 | - /// For each scanner token number, its symbol number. |
4597 | - static const unsigned short int yytoken_number_[]; |
4598 | + // YYRLINE[YYN] -- Source line where rule number YYN was defined. |
4599 | + static const unsigned char yyrline_[]; |
4600 | /// Report on the debug stream that the rule \a r is going to be reduced. |
4601 | virtual void yy_reduce_print_ (int r); |
4602 | /// Print the state stack on the debug stream. |
4603 | virtual void yystack_print_ (); |
4604 | |
4605 | - /* Debugging. */ |
4606 | + // Debugging. |
4607 | int yydebug_; |
4608 | std::ostream* yycdebug_; |
4609 | + |
4610 | + /// \brief Display a symbol type, value and location. |
4611 | + /// \param yyo The output stream. |
4612 | + /// \param yysym The symbol. |
4613 | + template <typename Base> |
4614 | + void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const; |
4615 | #endif |
4616 | |
4617 | - /// Convert a scanner token number \a t to a symbol number. |
4618 | - token_number_type yytranslate_ (int t); |
4619 | - |
4620 | /// \brief Reclaim the memory associated to a symbol. |
4621 | - /// \param yymsg Why this token is reclaimed. |
4622 | - /// \param yytype The symbol type. |
4623 | - /// \param yyvaluep Its semantic value. |
4624 | - /// \param yylocationp Its location. |
4625 | - inline void yydestruct_ (const char* yymsg, |
4626 | - int yytype, |
4627 | - semantic_type* yyvaluep, |
4628 | - location_type* yylocationp); |
4629 | + /// \param yymsg Why this token is reclaimed. |
4630 | + /// If null, print nothing. |
4631 | + /// \param yysym The symbol. |
4632 | + template <typename Base> |
4633 | + void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const; |
4634 | + |
4635 | + private: |
4636 | + /// Type access provider for state based symbols. |
4637 | + struct by_state |
4638 | + { |
4639 | + /// Default constructor. |
4640 | + by_state (); |
4641 | + |
4642 | + /// The symbol type as needed by the constructor. |
4643 | + typedef state_type kind_type; |
4644 | + |
4645 | + /// Constructor. |
4646 | + by_state (kind_type s); |
4647 | + |
4648 | + /// Copy constructor. |
4649 | + by_state (const by_state& other); |
4650 | + |
4651 | + /// Steal the symbol type from \a that. |
4652 | + void move (by_state& that); |
4653 | + |
4654 | + /// The (internal) type number (corresponding to \a state). |
4655 | + /// "empty" when empty. |
4656 | + symbol_number_type type_get () const; |
4657 | + |
4658 | + enum { empty = 0 }; |
4659 | + |
4660 | + /// The state. |
4661 | + state_type state; |
4662 | + }; |
4663 | + |
4664 | + /// "Internal" symbol: element of the stack. |
4665 | + struct stack_symbol_type : basic_symbol<by_state> |
4666 | + { |
4667 | + /// Superclass. |
4668 | + typedef basic_symbol<by_state> super_type; |
4669 | + /// Construct an empty symbol. |
4670 | + stack_symbol_type (); |
4671 | + /// Steal the contents from \a sym to build this. |
4672 | + stack_symbol_type (state_type s, symbol_type& sym); |
4673 | + /// Assignment, needed by push_back. |
4674 | + stack_symbol_type& operator= (const stack_symbol_type& that); |
4675 | + }; |
4676 | + |
4677 | + /// Stack type. |
4678 | + typedef stack<stack_symbol_type> stack_type; |
4679 | + |
4680 | + /// The stack. |
4681 | + stack_type yystack_; |
4682 | + |
4683 | + /// Push a new state on the stack. |
4684 | + /// \param m a debug message to display |
4685 | + /// if null, no trace is output. |
4686 | + /// \param s the symbol |
4687 | + /// \warning the contents of \a s.value is stolen. |
4688 | + void yypush_ (const char* m, stack_symbol_type& s); |
4689 | + |
4690 | + /// Push a new look ahead token on the state on the stack. |
4691 | + /// \param m a debug message to display |
4692 | + /// if null, no trace is output. |
4693 | + /// \param s the state |
4694 | + /// \param sym the symbol (for its value and location). |
4695 | + /// \warning the contents of \a s.value is stolen. |
4696 | + void yypush_ (const char* m, state_type s, symbol_type& sym); |
4697 | |
4698 | /// Pop \a n symbols the three stacks. |
4699 | - inline void yypop_ (unsigned int n = 1); |
4700 | - |
4701 | - /* Constants. */ |
4702 | - static const int yyeof_; |
4703 | - /* LAST_ -- Last index in TABLE_. */ |
4704 | - static const int yylast_; |
4705 | - static const int yynnts_; |
4706 | - static const int yyempty_; |
4707 | - static const int yyfinal_; |
4708 | - static const int yyterror_; |
4709 | - static const int yyerrcode_; |
4710 | - static const int yyntokens_; |
4711 | - static const unsigned int yyuser_token_number_max_; |
4712 | - static const token_number_type yyundef_token_; |
4713 | - |
4714 | - /* User arguments. */ |
4715 | + void yypop_ (unsigned int n = 1); |
4716 | + |
4717 | + // Constants. |
4718 | + enum |
4719 | + { |
4720 | + yyeof_ = 0, |
4721 | + yylast_ = 73, ///< Last index in yytable_. |
4722 | + yynnts_ = 13, ///< Number of nonterminal symbols. |
4723 | + yyempty_ = -2, |
4724 | + yyfinal_ = 29, ///< Termination state number. |
4725 | + yyterror_ = 1, |
4726 | + yyerrcode_ = 256, |
4727 | + yyntokens_ = 27 ///< Number of tokens. |
4728 | + }; |
4729 | + |
4730 | + |
4731 | + // User arguments. |
4732 | VerifyTAPN::TAPNQueryParser& driver; |
4733 | }; |
4734 | |
4735 | -/* Line 300 of lalr1.cc */ |
4736 | -#line 5 "src/Core/QueryParser/grammar.yy" |
4737 | + |
4738 | +#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372 |
4739 | } // VerifyTAPN |
4740 | - |
4741 | -/* Line 300 of lalr1.cc */ |
4742 | -#line 357 "src/Core/QueryParser/Generated/parser.hpp" |
4743 | - |
4744 | - |
4745 | - |
4746 | -#endif /* ! defined PARSER_HEADER_H */ |
4747 | +#line 497 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372 |
4748 | + |
4749 | + |
4750 | + |
4751 | + |
4752 | +#endif // !YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED |
4753 | |
4754 | === modified file 'src/Core/QueryParser/Generated/position.hh' |
4755 | --- src/Core/QueryParser/Generated/position.hh 2014-08-07 20:48:41 +0000 |
4756 | +++ src/Core/QueryParser/Generated/position.hh 2018-01-07 20:09:44 +0000 |
4757 | @@ -1,139 +1,157 @@ |
4758 | - |
4759 | -/* A Bison parser, made by GNU Bison 2.4.1. */ |
4760 | - |
4761 | -/* Positions for Bison parsers in C++ |
4762 | - |
4763 | - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
4764 | - |
4765 | - This program is free software: you can redistribute it and/or modify |
4766 | - it under the terms of the GNU General Public License as published by |
4767 | - the Free Software Foundation, either version 3 of the License, or |
4768 | - (at your option) any later version. |
4769 | - |
4770 | - This program is distributed in the hope that it will be useful, |
4771 | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
4772 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4773 | - GNU General Public License for more details. |
4774 | - |
4775 | - You should have received a copy of the GNU General Public License |
4776 | - along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
4777 | - |
4778 | -/* As a special exception, you may create a larger work that contains |
4779 | - part or all of the Bison parser skeleton and distribute that work |
4780 | - under terms of your choice, so long as that work isn't itself a |
4781 | - parser generator using the skeleton or a modified version thereof |
4782 | - as a parser skeleton. Alternatively, if you modify or redistribute |
4783 | - the parser skeleton itself, you may (at your option) remove this |
4784 | - special exception, which will cause the skeleton and the resulting |
4785 | - Bison output files to be licensed under the GNU General Public |
4786 | - License without this special exception. |
4787 | - |
4788 | - This special exception was added by the Free Software Foundation in |
4789 | - version 2.2 of Bison. */ |
4790 | +// A Bison parser, made by GNU Bison 3.0.2. |
4791 | + |
4792 | +// Positions for Bison parsers in C++ |
4793 | + |
4794 | +// Copyright (C) 2002-2013 Free Software Foundation, Inc. |
4795 | + |
4796 | +// This program is free software: you can redistribute it and/or modify |
4797 | +// it under the terms of the GNU General Public License as published by |
4798 | +// the Free Software Foundation, either version 3 of the License, or |
4799 | +// (at your option) any later version. |
4800 | + |
4801 | +// This program is distributed in the hope that it will be useful, |
4802 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4803 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4804 | +// GNU General Public License for more details. |
4805 | + |
4806 | +// You should have received a copy of the GNU General Public License |
4807 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
4808 | + |
4809 | +// As a special exception, you may create a larger work that contains |
4810 | +// part or all of the Bison parser skeleton and distribute that work |
4811 | +// under terms of your choice, so long as that work isn't itself a |
4812 | +// parser generator using the skeleton or a modified version thereof |
4813 | +// as a parser skeleton. Alternatively, if you modify or redistribute |
4814 | +// the parser skeleton itself, you may (at your option) remove this |
4815 | +// special exception, which will cause the skeleton and the resulting |
4816 | +// Bison output files to be licensed under the GNU General Public |
4817 | +// License without this special exception. |
4818 | + |
4819 | +// This special exception was added by the Free Software Foundation in |
4820 | +// version 2.2 of Bison. |
4821 | |
4822 | /** |
4823 | - ** \file position.hh |
4824 | + ** \file src/Core/QueryParser/Generated/position.hh |
4825 | ** Define the VerifyTAPN::position class. |
4826 | */ |
4827 | |
4828 | -#ifndef BISON_POSITION_HH |
4829 | -# define BISON_POSITION_HH |
4830 | +#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_POSITION_HH_INCLUDED |
4831 | +# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_POSITION_HH_INCLUDED |
4832 | |
4833 | +# include <algorithm> // std::max |
4834 | # include <iostream> |
4835 | # include <string> |
4836 | -# include <algorithm> |
4837 | - |
4838 | - |
4839 | -/* Line 38 of location.cc */ |
4840 | -#line 5 "src/Core/QueryParser/grammar.yy" |
4841 | + |
4842 | +# ifndef YY_NULLPTR |
4843 | +# if defined __cplusplus && 201103L <= __cplusplus |
4844 | +# define YY_NULLPTR nullptr |
4845 | +# else |
4846 | +# define YY_NULLPTR 0 |
4847 | +# endif |
4848 | +# endif |
4849 | + |
4850 | +#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291 |
4851 | namespace VerifyTAPN { |
4852 | - |
4853 | -/* Line 38 of location.cc */ |
4854 | -#line 53 "src/Core/QueryParser/Generated/position.hh" |
4855 | +#line 56 "src/Core/QueryParser/Generated/position.hh" // location.cc:291 |
4856 | /// Abstract a position. |
4857 | class position |
4858 | { |
4859 | public: |
4860 | - |
4861 | /// Construct a position. |
4862 | - position () |
4863 | - : filename (0), line (1), column (1) |
4864 | + explicit position (std::string* f = YY_NULLPTR, |
4865 | + unsigned int l = 1u, |
4866 | + unsigned int c = 1u) |
4867 | + : filename (f) |
4868 | + , line (l) |
4869 | + , column (c) |
4870 | { |
4871 | } |
4872 | |
4873 | |
4874 | /// Initialization. |
4875 | - inline void initialize (std::string* fn) |
4876 | + void initialize (std::string* fn = YY_NULLPTR, |
4877 | + unsigned int l = 1u, |
4878 | + unsigned int c = 1u) |
4879 | { |
4880 | filename = fn; |
4881 | - line = 1; |
4882 | - column = 1; |
4883 | + line = l; |
4884 | + column = c; |
4885 | } |
4886 | |
4887 | /** \name Line and Column related manipulators |
4888 | ** \{ */ |
4889 | - public: |
4890 | /// (line related) Advance to the COUNT next lines. |
4891 | - inline void lines (int count = 1) |
4892 | + void lines (int count = 1) |
4893 | { |
4894 | - column = 1; |
4895 | - line += count; |
4896 | + if (count) |
4897 | + { |
4898 | + column = 1u; |
4899 | + line = add_ (line, count, 1); |
4900 | + } |
4901 | } |
4902 | |
4903 | /// (column related) Advance to the COUNT next columns. |
4904 | - inline void columns (int count = 1) |
4905 | + void columns (int count = 1) |
4906 | { |
4907 | - column = std::max (1u, column + count); |
4908 | + column = add_ (column, count, 1); |
4909 | } |
4910 | /** \} */ |
4911 | |
4912 | - public: |
4913 | /// File name to which this position refers. |
4914 | std::string* filename; |
4915 | /// Current line number. |
4916 | unsigned int line; |
4917 | /// Current column number. |
4918 | unsigned int column; |
4919 | + |
4920 | + private: |
4921 | + /// Compute max(min, lhs+rhs) (provided min <= lhs). |
4922 | + static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min) |
4923 | + { |
4924 | + return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs |
4925 | + ? rhs + lhs |
4926 | + : min); |
4927 | + } |
4928 | }; |
4929 | |
4930 | /// Add and assign a position. |
4931 | - inline const position& |
4932 | - operator+= (position& res, const int width) |
4933 | + inline position& |
4934 | + operator+= (position& res, int width) |
4935 | { |
4936 | res.columns (width); |
4937 | return res; |
4938 | } |
4939 | |
4940 | /// Add two position objects. |
4941 | - inline const position |
4942 | - operator+ (const position& begin, const int width) |
4943 | + inline position |
4944 | + operator+ (position res, int width) |
4945 | { |
4946 | - position res = begin; |
4947 | return res += width; |
4948 | } |
4949 | |
4950 | /// Add and assign a position. |
4951 | - inline const position& |
4952 | - operator-= (position& res, const int width) |
4953 | + inline position& |
4954 | + operator-= (position& res, int width) |
4955 | { |
4956 | return res += -width; |
4957 | } |
4958 | |
4959 | /// Add two position objects. |
4960 | - inline const position |
4961 | - operator- (const position& begin, const int width) |
4962 | + inline position |
4963 | + operator- (position res, int width) |
4964 | { |
4965 | - return begin + -width; |
4966 | + return res -= width; |
4967 | } |
4968 | |
4969 | /// Compare two position objects. |
4970 | inline bool |
4971 | operator== (const position& pos1, const position& pos2) |
4972 | { |
4973 | - return |
4974 | - (pos1.filename == pos2.filename |
4975 | - || pos1.filename && pos2.filename && *pos1.filename == *pos2.filename) |
4976 | - && pos1.line == pos2.line && pos1.column == pos2.column; |
4977 | + return (pos1.line == pos2.line |
4978 | + && pos1.column == pos2.column |
4979 | + && (pos1.filename == pos2.filename |
4980 | + || (pos1.filename && pos2.filename |
4981 | + && *pos1.filename == *pos2.filename))); |
4982 | } |
4983 | |
4984 | /// Compare two position objects. |
4985 | @@ -147,19 +165,16 @@ |
4986 | ** \param ostr the destination output stream |
4987 | ** \param pos a reference to the position to redirect |
4988 | */ |
4989 | - inline std::ostream& |
4990 | - operator<< (std::ostream& ostr, const position& pos) |
4991 | + template <typename YYChar> |
4992 | + inline std::basic_ostream<YYChar>& |
4993 | + operator<< (std::basic_ostream<YYChar>& ostr, const position& pos) |
4994 | { |
4995 | if (pos.filename) |
4996 | ostr << *pos.filename << ':'; |
4997 | return ostr << pos.line << '.' << pos.column; |
4998 | } |
4999 | |
5000 | - |
The diff has been truncated for viewing.
Tested on about 30 small workflow nets. Compiles on all platforms.