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