Merge lp:~verifydtapn-contributers/verifydtapn/partial-order into lp:verifydtapn

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
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+335804@code.launchpad.net

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-generator, used by all engines.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Tested on about 30 small workflow nets. Compiles on all platforms.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'makefile.linux64'
--- makefile.linux64 2015-08-20 13:27:02 +0000
+++ makefile.linux64 2018-01-07 20:09:44 +0000
@@ -8,9 +8,9 @@
8CUT = cut8CUT = cut
99
10# Compiler and linker flags10# Compiler and linker flags
11CFLAGS = -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core211CFLAGS = -std=c++14 -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2
1212
13LDFLAGS = -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core213LDFLAGS = -std=c++14 -DBOOST_DISABLE_THREADS -DNDEBUG -DDISABLE_ASSERTX -static -O3 -Wall -mtune=core2
1414
15# Input files15# Input files
16SOURCES = $(shell find * -name "*.cpp") 16SOURCES = $(shell find * -name "*.cpp")
1717
=== modified file 'src/Core/ArgsParser.cpp'
--- src/Core/ArgsParser.cpp 2017-09-15 14:38:02 +0000
+++ src/Core/ArgsParser.cpp 2018-01-07 20:09:44 +0000
@@ -20,6 +20,8 @@
20static const std::string WORKFLOW = "workflow";20static const std::string WORKFLOW = "workflow";
21static const std::string STRONG_WORKFLOW_BOUND = "strong-workflow-bound";21static const std::string STRONG_WORKFLOW_BOUND = "strong-workflow-bound";
22static const std::string CALCULATE_CMAX = "calculate-cmax";22static const std::string CALCULATE_CMAX = "calculate-cmax";
23static const std::string REPLACE = "replace";
24static const std::string ORDER = "partial-order";
2325
24std::ostream& operator<<(std::ostream& out, const Switch& flag) {26std::ostream& operator<<(std::ostream& out, const Switch& flag) {
25 flag.print(out);27 flag.print(out);
@@ -181,7 +183,13 @@
181 parsers.push_back(183 parsers.push_back(
182 new Switch ("n", CALCULATE_CMAX,184 new Switch ("n", CALCULATE_CMAX,
183 "Calculate the place bounds"));185 "Calculate the place bounds"));
184186 parsers.push_back(
187 new SwitchWithStringArg("r", REPLACE,
188 "Replace placeholder in model with value, format PLACEHOLDER=VALUE;..", ""));
189 parsers.push_back(
190 new Switch("i", ORDER,
191 "Disable partial order reduction"));
192
185 };193 };
186194
187void ArgsParser::printHelp() const {195void ArgsParser::printHelp() const {
@@ -404,6 +412,45 @@
404 return result;412 return result;
405}413}
406414
415std::map<std::string, int> ArgsParser::parseReplace(const option& option) const
416{
417 std::map<std::string, int> replace;
418 const std::string param = option.second;
419
420 size_t split = 0;
421 do {
422 size_t equal = param.find("=", split);
423 if(equal != std::string::npos)
424 {
425 std::string name = param.substr(split, equal - split);
426 std::string val;
427 split = param.find(":", equal);
428 ++equal;
429 if(split == std::string::npos)
430 val = param.substr(equal, param.size() - equal);
431 else
432 val = param.substr(equal, split - equal);
433
434 try{
435 int res = boost::lexical_cast<unsigned long long>(val);
436 replace[name] = res;
437 } catch (boost::bad_lexical_cast & e) {
438 std::cout << "Invalid value '" << option.second << "' for option '--"
439 << option.first << "'" << std::endl;
440 exit(1);
441 }
442 if(split >= param.size()) break;
443 ++split;
444 }
445 else
446 {
447 break;
448 }
449
450 } while(split != std::string::npos);
451 return replace;
452}
453
407std::vector<std::string> ArgsParser::parseIncPlaces(454std::vector<std::string> ArgsParser::parseIncPlaces(
408 const std::string& string) const {455 const std::string& string) const {
409 std::vector<std::string> vec;456 std::vector<std::string> vec;
@@ -452,13 +499,18 @@
452 bool calculateCmax = boost::lexical_cast<bool>(499 bool calculateCmax = boost::lexical_cast<bool>(
453 map.find(CALCULATE_CMAX)->second);500 map.find(CALCULATE_CMAX)->second);
454501
502 std::map<std::string, int> replace = parseReplace(*map.find(REPLACE));
455 503
456 assert(map.find(GCD) != map.end());504 assert(map.find(GCD) != map.end());
457 bool enableGCDLowerGuards = boost::lexical_cast<bool>(505 bool enableGCDLowerGuards = boost::lexical_cast<bool>(
458 map.find(GCD)->second);506 map.find(GCD)->second);
507
508 bool order = boost::lexical_cast<bool>(
509 map.find(ORDER)->second);
459 510
460 return VerificationOptions(search, verification, memoptimization, kbound, trace,511 return VerificationOptions(search, verification, memoptimization, kbound, trace,
461 xml_trace, max_constant, keep_dead, enableGCDLowerGuards, workflow, workflowBound, calculateCmax);512 xml_trace, max_constant, keep_dead, enableGCDLowerGuards, workflow,
513 workflowBound, calculateCmax, replace, !order);
462514
463}515}
464}516}
465517
=== modified file 'src/Core/ArgsParser.hpp'
--- src/Core/ArgsParser.hpp 2017-09-18 13:45:47 +0000
+++ src/Core/ArgsParser.hpp 2018-01-07 20:09:44 +0000
@@ -89,6 +89,7 @@
89 unsigned int tryParseInt(const option& option) const;89 unsigned int tryParseInt(const option& option) const;
90 unsigned long long tryParseLongLong(const option& option) const;90 unsigned long long tryParseLongLong(const option& option) const;
91 std::vector<std::string> parseIncPlaces(const std::string& string) const;91 std::vector<std::string> parseIncPlaces(const std::string& string) const;
92 std::map<std::string, int> parseReplace(const option& option) const;
92 void initialize();93 void initialize();
93 void printHelp() const;94 void printHelp() const;
94 void printVersion() const;95 void printVersion() const;
9596
=== modified file 'src/Core/QueryParser/AST.cpp'
--- src/Core/QueryParser/AST.cpp 2014-02-16 19:20:25 +0000
+++ src/Core/QueryParser/AST.cpp 2018-01-07 20:09:44 +0000
@@ -8,12 +8,12 @@
8 return new NotExpression(*this);8 return new NotExpression(*this);
9 }9 }
1010
11 void NotExpression::accept(Visitor& visitor, Result& context) const11 void NotExpression::accept(Visitor& visitor, Result& context)
12 {12 {
13 visitor.visit(*this, context);13 visitor.visit(*this, context);
14 }14 }
1515
16 void BoolExpression::accept(Visitor& visitor, Result& context) const16 void BoolExpression::accept(Visitor& visitor, Result& context)
17 {17 {
18 visitor.visit(*this, context);18 visitor.visit(*this, context);
19 }19 }
@@ -23,7 +23,7 @@
23 return new BoolExpression(*this);23 return new BoolExpression(*this);
24 }24 }
2525
26 void DeadlockExpression::accept(Visitor& visitor, Result& context) const26 void DeadlockExpression::accept(Visitor& visitor, Result& context)
27 { 27 {
28 visitor.visit(*this, context);28 visitor.visit(*this, context);
29 }29 }
@@ -33,7 +33,7 @@
33 return new DeadlockExpression(*this);33 return new DeadlockExpression(*this);
34 }34 }
35 35
36 void AtomicProposition::accept(Visitor& visitor, Result& context) const36 void AtomicProposition::accept(Visitor& visitor, Result& context)
37 {37 {
38 visitor.visit(*this, context);38 visitor.visit(*this, context);
39 }39 }
@@ -48,7 +48,7 @@
48 return new AndExpression(*this);48 return new AndExpression(*this);
49 }49 }
50 50
51 void AndExpression::accept(Visitor& visitor, Result& context) const51 void AndExpression::accept(Visitor& visitor, Result& context)
52 {52 {
53 visitor.visit(*this, context);53 visitor.visit(*this, context);
54 }54 }
@@ -58,12 +58,12 @@
58 return new OrExpression(*this);58 return new OrExpression(*this);
59 }59 }
6060
61 void OrExpression::accept(Visitor& visitor, Result& context) const61 void OrExpression::accept(Visitor& visitor, Result& context)
62 {62 {
63 visitor.visit(*this, context);63 visitor.visit(*this, context);
64 }64 }
65 65
66 void PlusExpression::accept(Visitor& visitor, Result& context) const66 void PlusExpression::accept(Visitor& visitor, Result& context)
67 {67 {
68 visitor.visit(*this, context);68 visitor.visit(*this, context);
69 }69 }
@@ -73,7 +73,7 @@
73 return new PlusExpression(*this);73 return new PlusExpression(*this);
74 }74 }
75 75
76 void SubtractExpression::accept(Visitor& visitor, Result& context) const76 void SubtractExpression::accept(Visitor& visitor, Result& context)
77 {77 {
78 visitor.visit(*this, context);78 visitor.visit(*this, context);
79 }79 }
@@ -83,7 +83,7 @@
83 return new SubtractExpression(*this);83 return new SubtractExpression(*this);
84 }84 }
85 85
86 void MinusExpression::accept(Visitor& visitor, Result& context) const86 void MinusExpression::accept(Visitor& visitor, Result& context)
87 {87 {
88 visitor.visit(*this, context);88 visitor.visit(*this, context);
89 }89 }
@@ -93,7 +93,7 @@
93 return new MinusExpression(*this);93 return new MinusExpression(*this);
94 }94 }
9595
96 void MultiplyExpression::accept(Visitor& visitor, Result& context) const96 void MultiplyExpression::accept(Visitor& visitor, Result& context)
97 {97 {
98 visitor.visit(*this, context);98 visitor.visit(*this, context);
99 }99 }
@@ -103,7 +103,7 @@
103 return new MultiplyExpression(*this);103 return new MultiplyExpression(*this);
104 }104 }
105 105
106 void NumberExpression::accept(Visitor& visitor, Result& context) const106 void NumberExpression::accept(Visitor& visitor, Result& context)
107 {107 {
108 visitor.visit(*this, context);108 visitor.visit(*this, context);
109 }109 }
@@ -113,7 +113,7 @@
113 return new NumberExpression(*this);113 return new NumberExpression(*this);
114 } 114 }
115 115
116 void IdentifierExpression::accept(Visitor& visitor, Result& context) const116 void IdentifierExpression::accept(Visitor& visitor, Result& context)
117 {117 {
118 visitor.visit(*this, context);118 visitor.visit(*this, context);
119 }119 }
@@ -128,7 +128,7 @@
128 return new Query(*this);128 return new Query(*this);
129 }129 }
130130
131 void Query::accept(Visitor& visitor, Result& context) const131 void Query::accept(Visitor& visitor, Result& context)
132 {132 {
133 visitor.visit(*this, context);133 visitor.visit(*this, context);
134 }134 }
135135
=== modified file 'src/Core/QueryParser/AST.hpp'
--- src/Core/QueryParser/AST.hpp 2014-02-16 19:20:25 +0000
+++ src/Core/QueryParser/AST.hpp 2018-01-07 20:09:44 +0000
@@ -5,390 +5,467 @@
5#include <iostream>5#include <iostream>
6#include "Visitor.hpp"6#include "Visitor.hpp"
77
8namespace VerifyTAPN{8namespace VerifyTAPN {
9 namespace AST {9 namespace AST {
1010
11 class Visitable11 class Visitable {
12 {12 public:
13 public:13 virtual void accept(Visitor& visitor, Result& context) = 0;
14 virtual void accept(Visitor& visitor, Result& context) const = 0;14 int32_t eval = 0;
15 };15 };
1616
17 class Expression : public Visitable17 class Expression : public Visitable {
18 {18 public:
19 public:19
20 virtual ~Expression() { };20 virtual ~Expression() {
21 virtual Expression* clone() const = 0;21 };
22 };22 virtual Expression* clone() const = 0;
2323 };
24 class NotExpression : public Expression24
25 {25 class NotExpression : public Expression {
26 public:26 public:
27 explicit NotExpression(Expression* expr) : expr(expr) { };27
28 NotExpression(const NotExpression& other) : expr(other.expr->clone()) { };28 explicit NotExpression(Expression* expr) : expr(expr) {
29 NotExpression& operator=(const NotExpression& other)29 };
30 {30
31 if(&other != this){31 NotExpression(const NotExpression& other) : expr(other.expr->clone()) {
32 delete expr;32 };
33 expr = other.expr->clone();33
34 }34 NotExpression& operator=(const NotExpression& other) {
3535 if (&other != this) {
36 return *this;36 delete expr;
37 }37 expr = other.expr->clone();
3838 }
39 virtual ~NotExpression(){39
40 if( expr ) delete expr;40 return *this;
41 };41 }
4242
43 virtual NotExpression* clone() const;43 virtual ~NotExpression() {
44 virtual void accept(Visitor& visitor, Result& context) const;44 if (expr) delete expr;
4545 };
46 const Expression& getChild() const { return *expr; }46
47 private:47 virtual NotExpression* clone() const;
48 Expression* expr;48 virtual void accept(Visitor& visitor, Result& context);
49 };49
50 50 Expression& getChild() const {
51 class DeadlockExpression : public Expression51 return *expr;
52 {52 }
53 public:53 private:
54 explicit DeadlockExpression() {};54 Expression* expr;
55 virtual ~DeadlockExpression() { };55 };
5656
57 virtual DeadlockExpression* clone() const;57 class DeadlockExpression : public Expression {
58 virtual void accept(Visitor& visitor, Result& context) const;58 public:
59 };59
6060 explicit DeadlockExpression() {
61 class BoolExpression : public Expression61 };
62 {62
63 public:63 virtual ~DeadlockExpression() {
64 explicit BoolExpression(bool value) : value(value) {};64 };
65 virtual ~BoolExpression() { };65
6666 virtual DeadlockExpression* clone() const;
67 virtual BoolExpression* clone() const;67 virtual void accept(Visitor& visitor, Result& context);
68 virtual void accept(Visitor& visitor, Result& context) const;68 };
6969
70 bool getValue() const { return value; };70 class BoolExpression : public Expression {
71 private:71 public:
72 bool value;72
73 };73 explicit BoolExpression(bool value) : value(value) {
7474 };
75 class AtomicProposition : public Expression75
76 {76 virtual ~BoolExpression() {
77 public:77 };
78 AtomicProposition(ArithmeticExpression* left, std::string* op,ArithmeticExpression* right) : left(left), op(op->begin(), op->end()), right(right){};78
79 AtomicProposition(const AtomicProposition& other) : left(other.left), op(other.op), right(other.right) { };79 virtual BoolExpression* clone() const;
80 AtomicProposition& operator=(const AtomicProposition& other)80 virtual void accept(Visitor& visitor, Result& context);
81 {81
82 if(&other != this){82 bool getValue() const {
83 left = other.left;83 return value;
84 op = other.op;84 };
85 right = other.right;85 private:
86 }86 bool value;
87 return *this;87 };
88 }88
8989 class AtomicProposition : public Expression {
90 virtual ~AtomicProposition() { };90 public:
9191
92 ArithmeticExpression& getLeft() const {return *left;};92 AtomicProposition(ArithmeticExpression* left, std::string* op, ArithmeticExpression* right) : left(left), op(op->begin(), op->end()), right(right) {
93 ArithmeticExpression& getRight() const {return *right;};93 };
94 std::string getOperator() const {return op;};94
95 95 AtomicProposition(const AtomicProposition& other) : left(other.left), op(other.op), right(other.right) {
96 virtual AtomicProposition* clone() const;96 };
97 virtual void accept(Visitor& visitor, Result& context) const;97
9898 AtomicProposition& operator=(const AtomicProposition& other) {
99 private:99 if (&other != this) {
100 ArithmeticExpression* left;100 left = other.left;
101 std::string op;101 op = other.op;
102 ArithmeticExpression* right;102 right = other.right;
103 };103 }
104104 return *this;
105 class AndExpression : public Expression105 }
106 {106
107 public:107 virtual ~AtomicProposition() {
108 AndExpression(Expression* left, Expression* right) : left(left), right(right) { };108 };
109 AndExpression(const AndExpression& other) : left(other.left->clone()), right(other.right->clone()) {};109
110 AndExpression& operator=(const AndExpression& other)110 ArithmeticExpression& getLeft() const {
111 {111 return *left;
112 if(&other != this){112 };
113 delete left;113
114 delete right;114 ArithmeticExpression& getRight() const {
115115 return *right;
116 left = other.left->clone();116 };
117 right = other.right->clone();117
118 }118 std::string getOperator() const {
119 return *this;119 return op;
120 }120 };
121121
122 virtual ~AndExpression() {122 virtual AtomicProposition* clone() const;
123 if( left ) delete left;123 virtual void accept(Visitor& visitor, Result& context);
124 if( right ) delete right;124
125 }125 private:
126126 ArithmeticExpression* left;
127 virtual AndExpression* clone() const;127 std::string op;
128 void accept(Visitor& visitor, Result& context) const;128 ArithmeticExpression* right;
129129 };
130 const Expression& getLeft() const { return *left; }130
131 const Expression& getRight() const { return *right; }131 class AndExpression : public Expression {
132 private:132 public:
133 Expression* left;133
134 Expression* right;134 AndExpression(Expression* left, Expression* right) : left(left), right(right) {
135 };135 };
136136
137 class OrExpression : public Expression137 AndExpression(const AndExpression& other) : left(other.left->clone()), right(other.right->clone()) {
138 {138 };
139 public:139
140 OrExpression(Expression* left, Expression* right) : left(left), right(right) { };140 AndExpression& operator=(const AndExpression& other) {
141 OrExpression(const OrExpression& other) : left(other.left->clone()), right(other.right->clone()) { };141 if (&other != this) {
142 OrExpression& operator=(const OrExpression& other)142 delete left;
143 {143 delete right;
144 if(&other != this){144
145 delete left;145 left = other.left->clone();
146 delete right;146 right = other.right->clone();
147147 }
148 left = other.left->clone();148 return *this;
149 right = other.right->clone();149 }
150 }150
151 return *this;151 virtual ~AndExpression() {
152 }152 if (left) delete left;
153153 if (right) delete right;
154154 }
155 virtual ~OrExpression(){155
156 if( left ) delete left;156 virtual AndExpression* clone() const;
157 if( right ) delete right;157 void accept(Visitor& visitor, Result& context);
158 };158
159159 Expression& getLeft() const {
160160 return *left;
161161 }
162 virtual OrExpression* clone() const;162
163 virtual void accept(Visitor& visitor, Result& context) const;163 Expression& getRight() const {
164164 return *right;
165 const Expression& getLeft() const { return *left; }165 }
166 const Expression& getRight() const { return *right; }166 private:
167 private:167 Expression* left;
168 Expression* left;168 Expression* right;
169 Expression* right;169 };
170 };170
171 171 class OrExpression : public Expression {
172 class ArithmeticExpression : public Visitable172 public:
173 {173
174 public:174 OrExpression(Expression* left, Expression* right) : left(left), right(right) {
175 virtual ~ArithmeticExpression() { };175 };
176 virtual ArithmeticExpression* clone() const = 0;176
177 };177 OrExpression(const OrExpression& other) : left(other.left->clone()), right(other.right->clone()) {
178178 };
179 class OperationExpression : public ArithmeticExpression {179
180 protected:180 OrExpression& operator=(const OrExpression& other) {
181181 if (&other != this) {
182 OperationExpression(ArithmeticExpression* left, ArithmeticExpression* right) : left(left), right(right) {182 delete left;
183 };183 delete right;
184184
185 OperationExpression(const OperationExpression& other) : left(other.left), right(other.right) {185 left = other.left->clone();
186 };186 right = other.right->clone();
187187 }
188 OperationExpression& operator=(const OperationExpression& other) {188 return *this;
189 if (&other != this) {189 }
190 delete left;190
191 left = other.left;191 virtual ~OrExpression() {
192 delete right;192 if (left) delete left;
193 right = other.right;193 if (right) delete right;
194 }194 };
195 return *this;195
196 }196
197 197
198 virtual ~OperationExpression() {198 virtual OrExpression* clone() const;
199 };199 virtual void accept(Visitor& visitor, Result& context);
200 200
201 public:201 Expression& getLeft() const {
202 ArithmeticExpression& getLeft() const {return *left;};202 return *left;
203 ArithmeticExpression& getRight() const {return *right;};203 }
204 204
205 protected:205 Expression& getRight() const {
206 ArithmeticExpression* left;206 return *right;
207 ArithmeticExpression* right;207 }
208 };208 private:
209209 Expression* left;
210 class PlusExpression : public OperationExpression {210 Expression* right;
211 public:211 };
212212
213 PlusExpression(ArithmeticExpression* left, ArithmeticExpression* right)213 class ArithmeticExpression : public Visitable {
214 : OperationExpression(left, right) {214 public:
215 };215
216216 virtual ~ArithmeticExpression() {
217 PlusExpression(const PlusExpression& other)217 };
218 : OperationExpression(other) {218 virtual ArithmeticExpression* clone() const = 0;
219 };219 };
220220
221 PlusExpression& operator=(const PlusExpression& other) {221 class OperationExpression : public ArithmeticExpression {
222 if (&other != this) {222 protected:
223 left = other.left;223
224 right = other.right;224 OperationExpression(ArithmeticExpression* left, ArithmeticExpression* right) : left(left), right(right) {
225 }225 };
226 return *this;226
227 }227 OperationExpression(const OperationExpression& other) : left(other.left), right(other.right) {
228228 };
229 virtual ~PlusExpression() {229
230 };230 OperationExpression& operator=(const OperationExpression& other) {
231231 if (&other != this) {
232 virtual PlusExpression* clone() const;232 delete left;
233 virtual void accept(Visitor& visitor, Result& context) const;233 left = other.left;
234234 delete right;
235 };235 right = other.right;
236236 }
237 class SubtractExpression : public OperationExpression {237 return *this;
238 public:238 }
239239
240 SubtractExpression(ArithmeticExpression* left, ArithmeticExpression* right)240 virtual ~OperationExpression() {
241 : OperationExpression(left, right) {241 };
242 };242
243243 public:
244 SubtractExpression(const SubtractExpression& other)244
245 : OperationExpression(other) {245 ArithmeticExpression& getLeft() {
246 };246 return *left;
247247 };
248 SubtractExpression& operator=(const SubtractExpression& other) {248
249 if (&other != this) {249 ArithmeticExpression& getRight() {
250 left = other.left;250 return *right;
251 right = other.right;251 };
252 }252
253 return *this;253 protected:
254 }254 ArithmeticExpression* left;
255255 ArithmeticExpression* right;
256 virtual ~SubtractExpression() {256 };
257 };257
258258 class PlusExpression : public OperationExpression {
259 virtual SubtractExpression* clone() const;259 public:
260 virtual void accept(Visitor& visitor, Result& context) const;260
261 };261 PlusExpression(ArithmeticExpression* left, ArithmeticExpression* right)
262262 : OperationExpression(left, right) {
263 class MinusExpression : public ArithmeticExpression {263 };
264 public:264
265 MinusExpression(ArithmeticExpression* value) : value(value) {265 PlusExpression(const PlusExpression& other)
266 };266 : OperationExpression(other) {
267267 };
268 MinusExpression(const MinusExpression& other)268
269 : value(other.value) {269 PlusExpression& operator=(const PlusExpression& other) {
270 };270 if (&other != this) {
271271 left = other.left;
272 MinusExpression& operator=(const MinusExpression& other) {272 right = other.right;
273 if (&other != this) {273 }
274 value = other.value;274 return *this;
275 }275 }
276 return *this;276
277 }277 virtual ~PlusExpression() {
278278 };
279 ArithmeticExpression& getValue() const { return *value;};279
280 280 virtual PlusExpression* clone() const;
281 virtual ~MinusExpression() {281 virtual void accept(Visitor& visitor, Result& context);
282 };282
283 virtual MinusExpression* clone() const;283 };
284 virtual void accept(Visitor& visitor, Result& context) const;284
285 private:285 class SubtractExpression : public OperationExpression {
286 ArithmeticExpression* value;286 public:
287 };287
288288 SubtractExpression(ArithmeticExpression* left, ArithmeticExpression* right)
289 class MultiplyExpression : public OperationExpression {289 : OperationExpression(left, right) {
290 public:290 };
291291
292 MultiplyExpression(ArithmeticExpression* left, ArithmeticExpression* right)292 SubtractExpression(const SubtractExpression& other)
293 : OperationExpression(left, right) {293 : OperationExpression(other) {
294 };294 };
295295
296 MultiplyExpression(const MultiplyExpression& other)296 SubtractExpression& operator=(const SubtractExpression& other) {
297 : OperationExpression(other) {297 if (&other != this) {
298 };298 left = other.left;
299299 right = other.right;
300 MultiplyExpression& operator=(const MultiplyExpression& other) {300 }
301 if (&other != this) {301 return *this;
302 left = other.left;302 }
303 right = other.right;303
304 }304 virtual ~SubtractExpression() {
305 return *this;305 };
306 }306
307307 virtual SubtractExpression* clone() const;
308 virtual ~MultiplyExpression() {308 virtual void accept(Visitor& visitor, Result& context);
309 };309 };
310 virtual MultiplyExpression* clone() const;310
311 virtual void accept(Visitor& visitor, Result& context) const;311 class MinusExpression : public ArithmeticExpression {
312 };312 public:
313313
314 class NumberExpression : public ArithmeticExpression {314 MinusExpression(ArithmeticExpression* value) : value(value) {
315 public:315 };
316316
317 NumberExpression(int i) : value(i) {317 MinusExpression(const MinusExpression& other)
318 }318 : value(other.value) {
319319 };
320 NumberExpression(const NumberExpression& other) : value(other.value) {320
321 };321 MinusExpression& operator=(const MinusExpression& other) {
322322 if (&other != this) {
323 NumberExpression& operator=(const NumberExpression& other) {323 value = other.value;
324 value = other.value;324 }
325 return *this;325 return *this;
326 };326 }
327327
328 int getValue() const {return value;};328 ArithmeticExpression& getValue() const {
329 329 return *value;
330 virtual ~NumberExpression() {330 };
331 };331
332 virtual NumberExpression* clone() const;332 virtual ~MinusExpression() {
333 virtual void accept(Visitor& visitor, Result& context) const;333 };
334 private:334 virtual MinusExpression* clone() const;
335 int value;335 virtual void accept(Visitor& visitor, Result& context);
336 };336 private:
337337 ArithmeticExpression* value;
338 class IdentifierExpression : public ArithmeticExpression {338 };
339 public:339
340340 class MultiplyExpression : public OperationExpression {
341 IdentifierExpression(int placeIndex) : place(placeIndex) {341 public:
342 }342
343343 MultiplyExpression(ArithmeticExpression* left, ArithmeticExpression* right)
344 IdentifierExpression(const IdentifierExpression& other) : place(other.place) {344 : OperationExpression(left, right) {
345 };345 };
346346
347 IdentifierExpression& operator=(const IdentifierExpression& other) {347 MultiplyExpression(const MultiplyExpression& other)
348 place = other.place;348 : OperationExpression(other) {
349 return *this;349 };
350 };350
351351 MultiplyExpression& operator=(const MultiplyExpression& other) {
352 int getPlace() const { return place;};352 if (&other != this) {
353 353 left = other.left;
354 virtual ~IdentifierExpression() {354 right = other.right;
355 };355 }
356 virtual IdentifierExpression* clone() const;356 return *this;
357 virtual void accept(Visitor& visitor, Result& context) const;357 }
358 private:358
359 int place;359 virtual ~MultiplyExpression() {
360 };360 };
361 361 virtual MultiplyExpression* clone() const;
362 362 virtual void accept(Visitor& visitor, Result& context);
363 enum Quantifier { EF, AG, EG, AF};363 };
364364
365 class Query : public Visitable365 class NumberExpression : public ArithmeticExpression {
366 {366 public:
367 public:367
368 Query(Quantifier quantifier, Expression* expr) : quantifier(quantifier), expr(expr) { };368 NumberExpression(int i) : value(i) {
369 Query(const Query& other) : quantifier(other.quantifier), expr(other.expr->clone()) { };369 }
370 Query& operator=(const Query& other)370
371 {371 NumberExpression(const NumberExpression& other) : value(other.value) {
372 if(&other != this){372 };
373 delete expr;373
374 expr = other.expr->clone();374 NumberExpression& operator=(const NumberExpression& other) {
375 }375 value = other.value;
376 return *this;376 return *this;
377 }377 };
378378
379 virtual ~Query() { if( expr ) delete expr; }379 int getValue() const {
380380 return value;
381 virtual Query* clone() const;381 };
382 virtual void accept(Visitor& visitor, Result& context) const;382
383383 virtual ~NumberExpression() {
384 Quantifier getQuantifier() const { return quantifier; }384 };
385 const Expression& getChild() const { return *expr; }385 virtual NumberExpression* clone() const;
386 void setQuantifier(Quantifier q){ quantifier = q; }386 virtual void accept(Visitor& visitor, Result& context);
387 private:387 private:
388 Quantifier quantifier;388 int value;
389 Expression* expr;389 };
390 };390
391 }391 class IdentifierExpression : public ArithmeticExpression {
392 public:
393
394 IdentifierExpression(int placeIndex) : place(placeIndex) {
395 }
396
397 IdentifierExpression(const IdentifierExpression& other) : place(other.place) {
398 };
399
400 IdentifierExpression& operator=(const IdentifierExpression& other) {
401 place = other.place;
402 return *this;
403 };
404
405 int getPlace() const {
406 return place;
407 };
408
409 virtual ~IdentifierExpression() {
410 };
411 virtual IdentifierExpression* clone() const;
412 virtual void accept(Visitor& visitor, Result& context);
413 private:
414 int place;
415 };
416
417 enum Quantifier {
418 EF, AG, EG, AF, CF, CG
419 };
420
421 class Query : public Visitable {
422 public:
423
424 Query(Quantifier quantifier, Expression* expr) : quantifier(quantifier), expr(expr) {
425 };
426
427 Query(const Query& other) : quantifier(other.quantifier), expr(other.expr->clone()) {
428 };
429
430 Query& operator=(const Query& other) {
431 if (&other != this) {
432 delete expr;
433 expr = other.expr->clone();
434 }
435 return *this;
436 }
437
438 virtual ~Query() {
439 if (expr) delete expr;
440 }
441
442 virtual Query* clone() const;
443 virtual void accept(Visitor& visitor, Result& context);
444
445 Quantifier getQuantifier() const {
446 return quantifier;
447 }
448
449 const Expression& getConstChild() const {
450 return *expr;
451 }
452
453 Expression* getChild() {
454 return expr;
455 }
456
457 void setChild(Expression* expr) {
458 this->expr = expr;
459 }
460
461 void setQuantifier(Quantifier q) {
462 quantifier = q;
463 }
464 private:
465 Quantifier quantifier;
466 Expression* expr;
467 };
468 }
392}469}
393470
394#endif /* AST_HPP_ */471#endif /* AST_HPP_ */
395472
=== modified file 'src/Core/QueryParser/Generated/lexer.cpp'
--- src/Core/QueryParser/Generated/lexer.cpp 2014-08-07 20:48:41 +0000
+++ src/Core/QueryParser/Generated/lexer.cpp 2018-01-07 20:09:44 +0000
@@ -9,7 +9,7 @@
9#define FLEX_SCANNER9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 210#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 511#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 3512#define YY_FLEX_SUBMINOR_VERSION 37
13#if YY_FLEX_SUBMINOR_VERSION > 013#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA14#define FLEX_BETA
15#endif15#endif
@@ -47,7 +47,6 @@
47typedef uint16_t flex_uint16_t;47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;49typedef uint32_t flex_uint32_t;
50typedef uint64_t flex_uint64_t;
51#else50#else
52typedef signed char flex_int8_t;51typedef signed char flex_int8_t;
53typedef short int flex_int16_t;52typedef short int flex_int16_t;
@@ -55,7 +54,6 @@
55typedef unsigned char flex_uint8_t; 54typedef unsigned char flex_uint8_t;
56typedef unsigned short int flex_uint16_t;55typedef unsigned short int flex_uint16_t;
57typedef unsigned int flex_uint32_t;56typedef unsigned int flex_uint32_t;
58#endif /* ! C99 */
5957
60/* Limits of integral types. */58/* Limits of integral types. */
61#ifndef INT8_MIN59#ifndef INT8_MIN
@@ -86,6 +84,8 @@
86#define UINT32_MAX (4294967295U)84#define UINT32_MAX (4294967295U)
87#endif85#endif
8886
87#endif /* ! C99 */
88
89#endif /* ! FLEXINT_H */89#endif /* ! FLEXINT_H */
9090
91#ifdef __cplusplus91#ifdef __cplusplus
@@ -333,7 +333,7 @@
333333
334/* Begin user sect3 */334/* Begin user sect3 */
335335
336#define yywrap(n) 1336#define yywrap() 1
337#define YY_SKIP_YYWRAP337#define YY_SKIP_YYWRAP
338338
339typedef unsigned char YY_CHAR;339typedef unsigned char YY_CHAR;
@@ -359,13 +359,13 @@
359 */359 */
360#define YY_DO_BEFORE_ACTION \360#define YY_DO_BEFORE_ACTION \
361 (yytext_ptr) = yy_bp; \361 (yytext_ptr) = yy_bp; \
362 yyleng = (yy_size_t) (yy_cp - yy_bp); \362 yyleng = (size_t) (yy_cp - yy_bp); \
363 (yy_hold_char) = *yy_cp; \363 (yy_hold_char) = *yy_cp; \
364 *yy_cp = '\0'; \364 *yy_cp = '\0'; \
365 (yy_c_buf_p) = yy_cp;365 (yy_c_buf_p) = yy_cp;
366366
367#define YY_NUM_RULES 26367#define YY_NUM_RULES 28
368#define YY_END_OF_BUFFER 27368#define YY_END_OF_BUFFER 29
369/* This struct is not used in this scanner,369/* This struct is not used in this scanner,
370 but its presence is necessary. */370 but its presence is necessary. */
371struct yy_trans_info371struct yy_trans_info
@@ -373,14 +373,15 @@
373 flex_int32_t yy_verify;373 flex_int32_t yy_verify;
374 flex_int32_t yy_nxt;374 flex_int32_t yy_nxt;
375 };375 };
376static yyconst flex_int16_t yy_accept[61] =376static yyconst flex_int16_t yy_accept[69] =
377 { 0,377 { 0,
378 0, 0, 27, 26, 1, 2, 13, 26, 20, 21,378 0, 0, 29, 28, 1, 2, 14, 28, 21, 22,
379 24, 22, 23, 3, 14, 16, 19, 25, 25, 25,379 25, 23, 24, 3, 26, 15, 17, 20, 27, 27,
380 25, 25, 25, 25, 26, 25, 25, 1, 2, 9,380 27, 27, 27, 27, 27, 27, 28, 27, 27, 1,
381 3, 15, 17, 18, 25, 25, 25, 25, 25, 8,381 2, 10, 3, 16, 18, 19, 27, 6, 5, 27,
382 25, 8, 6, 5, 4, 7, 9, 25, 25, 13,382 27, 27, 27, 9, 27, 9, 4, 7, 27, 10,
383 25, 25, 25, 10, 25, 11, 25, 25, 12, 0383 27, 27, 14, 27, 27, 27, 27, 11, 27, 27,
384 12, 27, 27, 27, 27, 8, 13, 0
384 } ;385 } ;
385386
386static yyconst flex_int32_t yy_ec[256] =387static yyconst flex_int32_t yy_ec[256] =
@@ -390,15 +391,15 @@
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 2, 4, 1, 1, 1, 1, 5, 1, 6,392 1, 2, 4, 1, 1, 1, 1, 5, 1, 6,
392 7, 8, 9, 1, 10, 1, 1, 11, 11, 11,393 7, 8, 9, 1, 10, 1, 1, 11, 11, 11,
393 11, 11, 11, 11, 11, 11, 11, 1, 1, 12,394 11, 11, 11, 11, 11, 11, 11, 12, 1, 13,
394 13, 14, 1, 1, 15, 16, 16, 16, 17, 18,395 14, 15, 1, 1, 16, 17, 17, 17, 18, 19,
395 19, 16, 16, 16, 16, 16, 16, 16, 16, 16,396 20, 17, 17, 17, 17, 17, 17, 17, 17, 17,
396 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,397 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
397 1, 1, 1, 1, 16, 1, 20, 16, 21, 22,398 1, 1, 1, 1, 17, 1, 21, 17, 22, 23,
398399
399 23, 24, 16, 16, 16, 16, 25, 26, 16, 27,400 24, 25, 17, 17, 17, 17, 26, 27, 17, 28,
400 28, 16, 16, 29, 30, 31, 32, 16, 16, 16,401 29, 17, 17, 30, 31, 32, 33, 17, 17, 17,
401 16, 16, 1, 33, 1, 1, 1, 1, 1, 1,402 17, 17, 1, 34, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -415,66 +416,68 @@
415 1, 1, 1, 1, 1416 1, 1, 1, 1, 1
416 } ;417 } ;
417418
418static yyconst flex_int32_t yy_meta[34] =419static yyconst flex_int32_t yy_meta[35] =
419 { 0,420 { 0,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,422 2, 1, 1, 1, 1, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 1424 2, 2, 2, 1
424 } ;425 } ;
425426
426static yyconst flex_int16_t yy_base[62] =427static yyconst flex_int16_t yy_base[70] =
427 { 0,428 { 0,
428 0, 19, 71, 72, 68, 66, 72, 63, 72, 72,429 0, 17, 78, 79, 75, 73, 79, 70, 79, 79,
429 72, 72, 72, 56, 53, 52, 51, 0, 36, 39,430 79, 79, 79, 63, 79, 59, 58, 57, 17, 0,
430 41, 32, 30, 29, 24, 19, 21, 54, 52, 72,431 42, 45, 47, 38, 36, 35, 30, 21, 34, 60,
431 43, 72, 72, 72, 0, 31, 32, 25, 19, 0,432 58, 79, 49, 79, 79, 79, 0, 0, 0, 36,
432 17, 72, 0, 0, 0, 0, 0, 26, 17, 0,433 37, 30, 24, 0, 22, 79, 0, 0, 26, 0,
433 23, 19, 21, 0, 15, 0, 21, 16, 0, 72,434 30, 21, 0, 27, 18, 22, 24, 0, 17, 17,
434 33435 0, 16, 22, 16, 16, 0, 0, 79, 36
435 } ;436 } ;
436437
437static yyconst flex_int16_t yy_def[62] =438static yyconst flex_int16_t yy_def[70] =
438 { 0,439 { 0,
439 60, 1, 60, 60, 60, 60, 60, 60, 60, 60,440 68, 1, 68, 68, 68, 68, 68, 68, 68, 68,
440 60, 60, 60, 60, 60, 60, 60, 61, 61, 61,441 68, 68, 68, 68, 68, 68, 68, 68, 69, 69,
441 61, 61, 61, 61, 60, 61, 61, 60, 60, 60,442 69, 69, 69, 69, 69, 69, 68, 69, 69, 68,
442 60, 60, 60, 60, 61, 61, 61, 61, 61, 61,443 68, 68, 68, 68, 68, 68, 69, 69, 69, 69,
443 61, 60, 61, 61, 61, 61, 61, 61, 61, 61,444 69, 69, 69, 69, 69, 68, 69, 69, 69, 69,
444 61, 61, 61, 61, 61, 61, 61, 61, 61, 0,445 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
445 60446 69, 69, 69, 69, 69, 69, 69, 0, 68
446 } ;447 } ;
447448
448static yyconst flex_int16_t yy_nxt[106] =449static yyconst flex_int16_t yy_nxt[114] =
449 { 0,450 { 0,
450 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,451 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
451 14, 15, 16, 17, 18, 18, 18, 18, 18, 19,452 14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
452 18, 20, 18, 21, 18, 18, 22, 23, 18, 18,453 21, 20, 22, 20, 23, 20, 20, 24, 25, 20,
453 24, 18, 25, 26, 35, 27, 43, 44, 45, 46,454 20, 26, 20, 27, 28, 38, 39, 37, 29, 47,
454 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,455 48, 67, 66, 65, 64, 63, 62, 61, 60, 59,
455 49, 48, 47, 31, 29, 28, 42, 41, 40, 39,456 58, 57, 56, 55, 54, 53, 52, 51, 50, 33,
456 38, 37, 36, 34, 33, 32, 31, 30, 29, 28,457 31, 30, 49, 46, 45, 44, 43, 42, 41, 40,
457 60, 3, 60, 60, 60, 60, 60, 60, 60, 60,458 36, 35, 34, 33, 32, 31, 30, 68, 3, 68,
458 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,459 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
459 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,460 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
460461
461 60, 60, 60, 60, 60462 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
463 68, 68, 68
462 } ;464 } ;
463465
464static yyconst flex_int16_t yy_chk[106] =466static yyconst flex_int16_t yy_chk[114] =
465 { 0,467 { 0,
466 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 2, 61, 2, 26, 26, 27, 27,471 1, 1, 1, 1, 2, 19, 19, 69, 2, 28,
470 58, 57, 55, 53, 52, 51, 49, 48, 41, 39,472 28, 65, 64, 63, 62, 60, 59, 57, 56, 55,
471 38, 37, 36, 31, 29, 28, 25, 24, 23, 22,473 54, 52, 51, 49, 45, 43, 42, 41, 40, 33,
472 21, 20, 19, 17, 16, 15, 14, 8, 6, 5,474 31, 30, 29, 27, 26, 25, 24, 23, 22, 21,
473 3, 60, 60, 60, 60, 60, 60, 60, 60, 60,475 18, 17, 16, 14, 8, 6, 5, 3, 68, 68,
474 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,476 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
475 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,477 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
476478
477 60, 60, 60, 60, 60479 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
480 68, 68, 68
478 } ;481 } ;
479482
480static yy_state_type yy_last_accepting_state;483static yy_state_type yy_last_accepting_state;
@@ -510,7 +513,7 @@
510#define yyterminate() return token::END513#define yyterminate() return token::END
511#line 26 "src/Core/QueryParser/flex.ll"514#line 26 "src/Core/QueryParser/flex.ll"
512# define YY_USER_ACTION yylloc->columns (yyleng);515# define YY_USER_ACTION yylloc->columns (yyleng);
513#line 514 "src/Core/QueryParser/Generated/lexer.cpp"516#line 517 "src/Core/QueryParser/Generated/lexer.cpp"
514517
515#define INITIAL 0518#define INITIAL 0
516519
@@ -597,7 +600,7 @@
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,
598 * we now use fwrite().601 * we now use fwrite().
599 */602 */
600#define ECHO fwrite( yytext, yyleng, 1, yyout )603#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
601#endif604#endif
602605
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,
@@ -608,7 +611,7 @@
608 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \611 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
609 { \612 { \
610 int c = '*'; \613 int c = '*'; \
611 yy_size_t n; \614 size_t n; \
612 for ( n = 0; n < max_size && \615 for ( n = 0; n < max_size && \
613 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \616 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
614 buf[n] = (char) c; \617 buf[n] = (char) c; \
@@ -698,7 +701,7 @@
698701
699 yylloc->step ();702 yylloc->step ();
700703
701#line 702 "src/Core/QueryParser/Generated/lexer.cpp"704#line 705 "src/Core/QueryParser/Generated/lexer.cpp"
702705
703 if ( !(yy_init) )706 if ( !(yy_init) )
704 {707 {
@@ -752,13 +755,13 @@
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 )
753 {756 {
754 yy_current_state = (int) yy_def[yy_current_state];757 yy_current_state = (int) yy_def[yy_current_state];
755 if ( yy_current_state >= 61 )758 if ( yy_current_state >= 69 )
756 yy_c = yy_meta[(unsigned int) yy_c];759 yy_c = yy_meta[(unsigned int) yy_c];
757 }760 }
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];
759 ++yy_cp;762 ++yy_cp;
760 }763 }
761 while ( yy_current_state != 60 );764 while ( yy_current_state != 68 );
762 yy_cp = (yy_last_accepting_cpos);765 yy_cp = (yy_last_accepting_cpos);
763 yy_current_state = (yy_last_accepting_state);766 yy_current_state = (yy_last_accepting_state);
764767
@@ -820,47 +823,47 @@
820case 8:823case 8:
821YY_RULE_SETUP824YY_RULE_SETUP
822#line 44 "src/Core/QueryParser/flex.ll"825#line 44 "src/Core/QueryParser/flex.ll"
823{ return token::OR; }826{ return token::CONTROL; }
824 YY_BREAK827 YY_BREAK
825case 9:828case 9:
826YY_RULE_SETUP829YY_RULE_SETUP
827#line 45 "src/Core/QueryParser/flex.ll"830#line 45 "src/Core/QueryParser/flex.ll"
828{ return token::AND; }831{ return token::OR; }
829 YY_BREAK832 YY_BREAK
830case 10:833case 10:
831YY_RULE_SETUP834YY_RULE_SETUP
832#line 46 "src/Core/QueryParser/flex.ll"835#line 46 "src/Core/QueryParser/flex.ll"
833{ return token::BOOL_TRUE; }836{ return token::AND; }
834 YY_BREAK837 YY_BREAK
835case 11:838case 11:
836YY_RULE_SETUP839YY_RULE_SETUP
837#line 47 "src/Core/QueryParser/flex.ll"840#line 47 "src/Core/QueryParser/flex.ll"
838{ return token::BOOL_FALSE; }841{ return token::BOOL_TRUE; }
839 YY_BREAK842 YY_BREAK
840case 12:843case 12:
841YY_RULE_SETUP844YY_RULE_SETUP
842#line 48 "src/Core/QueryParser/flex.ll"845#line 48 "src/Core/QueryParser/flex.ll"
843{ return token::DEADLOCK; }846{ return token::BOOL_FALSE; }
844 YY_BREAK847 YY_BREAK
845case 13:848case 13:
846YY_RULE_SETUP849YY_RULE_SETUP
847#line 49 "src/Core/QueryParser/flex.ll"850#line 49 "src/Core/QueryParser/flex.ll"
848{ return token::NOT; }851{ return token::DEADLOCK; }
849 YY_BREAK852 YY_BREAK
850case 14:853case 14:
851YY_RULE_SETUP854YY_RULE_SETUP
852#line 50 "src/Core/QueryParser/flex.ll"855#line 50 "src/Core/QueryParser/flex.ll"
853{ yylval->string = new std::string(yytext); return token::LESS; }856{ return token::NOT; }
854 YY_BREAK857 YY_BREAK
855case 15:858case 15:
856YY_RULE_SETUP859YY_RULE_SETUP
857#line 51 "src/Core/QueryParser/flex.ll"860#line 51 "src/Core/QueryParser/flex.ll"
858{ yylval->string = new std::string(yytext); return token::LESSEQUAL; }861{ yylval->string = new std::string(yytext); return token::LESS; }
859 YY_BREAK862 YY_BREAK
860case 16:863case 16:
861YY_RULE_SETUP864YY_RULE_SETUP
862#line 52 "src/Core/QueryParser/flex.ll"865#line 52 "src/Core/QueryParser/flex.ll"
863{ yylval->string = new std::string(yytext); return token::EQUAL; }866{ yylval->string = new std::string(yytext); return token::LESSEQUAL; }
864 YY_BREAK867 YY_BREAK
865case 17:868case 17:
866YY_RULE_SETUP869YY_RULE_SETUP
@@ -870,49 +873,59 @@
870case 18:873case 18:
871YY_RULE_SETUP874YY_RULE_SETUP
872#line 54 "src/Core/QueryParser/flex.ll"875#line 54 "src/Core/QueryParser/flex.ll"
873{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; }876{ yylval->string = new std::string(yytext); return token::EQUAL; }
874 YY_BREAK877 YY_BREAK
875case 19:878case 19:
876YY_RULE_SETUP879YY_RULE_SETUP
877#line 55 "src/Core/QueryParser/flex.ll"880#line 55 "src/Core/QueryParser/flex.ll"
878{ yylval->string = new std::string(yytext); return token::GREATER; }881{ yylval->string = new std::string(yytext); return token::GREATEREQUAL; }
879 YY_BREAK882 YY_BREAK
880case 20:883case 20:
881YY_RULE_SETUP884YY_RULE_SETUP
882#line 56 "src/Core/QueryParser/flex.ll"885#line 56 "src/Core/QueryParser/flex.ll"
883{return token::LPARAN;}886{ yylval->string = new std::string(yytext); return token::GREATER; }
884 YY_BREAK887 YY_BREAK
885case 21:888case 21:
886YY_RULE_SETUP889YY_RULE_SETUP
887#line 57 "src/Core/QueryParser/flex.ll"890#line 57 "src/Core/QueryParser/flex.ll"
888{return token::RPARAN;}891{return token::LPARAN;}
889 YY_BREAK892 YY_BREAK
890case 22:893case 22:
891YY_RULE_SETUP894YY_RULE_SETUP
892#line 58 "src/Core/QueryParser/flex.ll"895#line 58 "src/Core/QueryParser/flex.ll"
893{return token::PLUS;}896{return token::RPARAN;}
894 YY_BREAK897 YY_BREAK
895case 23:898case 23:
896YY_RULE_SETUP899YY_RULE_SETUP
897#line 59 "src/Core/QueryParser/flex.ll"900#line 59 "src/Core/QueryParser/flex.ll"
898{return token::MINUS;}901{return token::PLUS;}
899 YY_BREAK902 YY_BREAK
900case 24:903case 24:
901YY_RULE_SETUP904YY_RULE_SETUP
902#line 60 "src/Core/QueryParser/flex.ll"905#line 60 "src/Core/QueryParser/flex.ll"
906{return token::MINUS;}
907 YY_BREAK
908case 25:
909YY_RULE_SETUP
910#line 61 "src/Core/QueryParser/flex.ll"
903{return token::MULTIPLY;}911{return token::MULTIPLY;}
904 YY_BREAK912 YY_BREAK
905case 25:913case 26:
906YY_RULE_SETUP914YY_RULE_SETUP
907#line 62 "src/Core/QueryParser/flex.ll"915#line 62 "src/Core/QueryParser/flex.ll"
916{return token::COLON;}
917 YY_BREAK
918case 27:
919YY_RULE_SETUP
920#line 64 "src/Core/QueryParser/flex.ll"
908{ yylval->string = new std::string(yytext); return token::IDENTIFIER; }921{ yylval->string = new std::string(yytext); return token::IDENTIFIER; }
909 YY_BREAK922 YY_BREAK
910case 26:923case 28:
911YY_RULE_SETUP924YY_RULE_SETUP
912#line 64 "src/Core/QueryParser/flex.ll"925#line 66 "src/Core/QueryParser/flex.ll"
913ECHO;926ECHO;
914 YY_BREAK927 YY_BREAK
915#line 916 "src/Core/QueryParser/Generated/lexer.cpp"928#line 929 "src/Core/QueryParser/Generated/lexer.cpp"
916case YY_STATE_EOF(INITIAL):929case YY_STATE_EOF(INITIAL):
917 yyterminate();930 yyterminate();
918931
@@ -1106,7 +1119,7 @@
1106 { /* Not enough room in the buffer - grow it. */1119 { /* Not enough room in the buffer - grow it. */
11071120
1108 /* just a shorter name for the current buffer */1121 /* just a shorter name for the current buffer */
1109 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;1122 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
11101123
1111 int yy_c_buf_p_offset =1124 int yy_c_buf_p_offset =
1112 (int) ((yy_c_buf_p) - b->yy_ch_buf);1125 (int) ((yy_c_buf_p) - b->yy_ch_buf);
@@ -1206,7 +1219,7 @@
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 )
1207 {1220 {
1208 yy_current_state = (int) yy_def[yy_current_state];1221 yy_current_state = (int) yy_def[yy_current_state];
1209 if ( yy_current_state >= 61 )1222 if ( yy_current_state >= 69 )
1210 yy_c = yy_meta[(unsigned int) yy_c];1223 yy_c = yy_meta[(unsigned int) yy_c];
1211 }1224 }
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];
@@ -1234,13 +1247,13 @@
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 )
1235 {1248 {
1236 yy_current_state = (int) yy_def[yy_current_state];1249 yy_current_state = (int) yy_def[yy_current_state];
1237 if ( yy_current_state >= 61 )1250 if ( yy_current_state >= 69 )
1238 yy_c = yy_meta[(unsigned int) yy_c];1251 yy_c = yy_meta[(unsigned int) yy_c];
1239 }1252 }
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];
1241 yy_is_jam = (yy_current_state == 60);1254 yy_is_jam = (yy_current_state == 68);
12421255
1243 return yy_is_jam ? 0 : yy_current_state;1256 return yy_is_jam ? 0 : yy_current_state;
1244}1257}
12451258
1246#ifndef YY_NO_INPUT1259#ifndef YY_NO_INPUT
@@ -1291,7 +1304,7 @@
1291 case EOB_ACT_END_OF_FILE:1304 case EOB_ACT_END_OF_FILE:
1292 {1305 {
1293 if ( yywrap( ) )1306 if ( yywrap( ) )
1294 return 0;1307 return EOF;
12951308
1296 if ( ! (yy_did_buffer_switch_on_eof) )1309 if ( ! (yy_did_buffer_switch_on_eof) )
1297 YY_NEW_FILE;1310 YY_NEW_FILE;
@@ -1429,10 +1442,6 @@
1429 yyfree((void *) b );1442 yyfree((void *) b );
1430}1443}
14311444
1432#ifndef __cplusplus
1433extern int isatty (int );
1434#endif /* __cplusplus */
1435
1436/* Initializes or reinitializes a buffer.1445/* Initializes or reinitializes a buffer.
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,
1438 * such as during a yyrestart() or at EOF.1447 * such as during a yyrestart() or at EOF.
@@ -1637,8 +1646,8 @@
16371646
1638/** Setup the input buffer state to scan the given bytes. The next call to yylex() will1647/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1639 * scan from a @e copy of @a bytes.1648 * scan from a @e copy of @a bytes.
1640 * @param bytes the byte buffer to scan1649 * @param yybytes the byte buffer to scan
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.
1642 * 1651 *
1643 * @return the newly allocated buffer state object.1652 * @return the newly allocated buffer state object.
1644 */1653 */
@@ -1646,7 +1655,8 @@
1646{1655{
1647 YY_BUFFER_STATE b;1656 YY_BUFFER_STATE b;
1648 char *buf;1657 char *buf;
1649 yy_size_t n, i;1658 yy_size_t n;
1659 yy_size_t i;
1650 1660
1651 /* Get memory for full buffer, including space for trailing EOB's. */1661 /* Get memory for full buffer, including space for trailing EOB's. */
1652 n = _yybytes_len + 2;1662 n = _yybytes_len + 2;
@@ -1876,7 +1886,7 @@
18761886
1877#define YYTABLES_NAME "yytables"1887#define YYTABLES_NAME "yytables"
18781888
1879#line 64 "src/Core/QueryParser/flex.ll"1889#line 66 "src/Core/QueryParser/flex.ll"
18801890
18811891
1882namespace VerifyTAPN1892namespace VerifyTAPN
18831893
=== modified file 'src/Core/QueryParser/Generated/location.hh'
--- src/Core/QueryParser/Generated/location.hh 2014-08-07 20:48:41 +0000
+++ src/Core/QueryParser/Generated/location.hh 2018-01-07 20:09:44 +0000
@@ -1,72 +1,83 @@
11// A Bison parser, made by GNU Bison 3.0.2.
2/* A Bison parser, made by GNU Bison 2.4.1. */2
33// Locations for Bison parsers in C++
4/* Locations for Bison parsers in C++4
5 5// Copyright (C) 2002-2013 Free Software Foundation, Inc.
6 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.6
7 7// This program is free software: you can redistribute it and/or modify
8 This program is free software: you can redistribute it and/or modify8// it under the terms of the GNU General Public License as published by
9 it under the terms of the GNU General Public License as published by9// the Free Software Foundation, either version 3 of the License, or
10 the Free Software Foundation, either version 3 of the License, or10// (at your option) any later version.
11 (at your option) any later version.11
12 12// This program is distributed in the hope that it will be useful,
13 This program is distributed in the hope that it will be useful,13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 but WITHOUT ANY WARRANTY; without even the implied warranty of14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15// GNU General Public License for more details.
16 GNU General Public License for more details.16
17 17// You should have received a copy of the GNU General Public License
18 You should have received a copy of the GNU General Public License18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */19
2020// As a special exception, you may create a larger work that contains
21/* As a special exception, you may create a larger work that contains21// part or all of the Bison parser skeleton and distribute that work
22 part or all of the Bison parser skeleton and distribute that work22// under terms of your choice, so long as that work isn't itself a
23 under terms of your choice, so long as that work isn't itself a23// parser generator using the skeleton or a modified version thereof
24 parser generator using the skeleton or a modified version thereof24// as a parser skeleton. Alternatively, if you modify or redistribute
25 as a parser skeleton. Alternatively, if you modify or redistribute25// the parser skeleton itself, you may (at your option) remove this
26 the parser skeleton itself, you may (at your option) remove this26// special exception, which will cause the skeleton and the resulting
27 special exception, which will cause the skeleton and the resulting27// Bison output files to be licensed under the GNU General Public
28 Bison output files to be licensed under the GNU General Public28// License without this special exception.
29 License without this special exception.29
30 30// This special exception was added by the Free Software Foundation in
31 This special exception was added by the Free Software Foundation in31// version 2.2 of Bison.
32 version 2.2 of Bison. */
3332
34/**33/**
35 ** \file location.hh34 ** \file src/Core/QueryParser/Generated/location.hh
36 ** Define the VerifyTAPN::location class.35 ** Define the VerifyTAPN::location class.
37 */36 */
3837
39#ifndef BISON_LOCATION_HH38#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED
40# define BISON_LOCATION_HH39# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED
4140
42# include <iostream>
43# include <string>
44# include "position.hh"41# include "position.hh"
4542
4643#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291
47/* Line 162 of location.cc */
48#line 5 "src/Core/QueryParser/grammar.yy"
49namespace VerifyTAPN {44namespace VerifyTAPN {
5045#line 46 "src/Core/QueryParser/Generated/location.hh" // location.cc:291
51/* Line 162 of location.cc */
52#line 53 "src/Core/QueryParser/Generated/location.hh"
53
54 /// Abstract a location.46 /// Abstract a location.
55 class location47 class location
56 {48 {
57 public:49 public:
5850
59 /// Construct a location.51 /// Construct a location from \a b to \a e.
60 location ()52 location (const position& b, const position& e)
61 : begin (), end ()53 : begin (b)
54 , end (e)
55 {
56 }
57
58 /// Construct a 0-width location in \a p.
59 explicit location (const position& p = position ())
60 : begin (p)
61 , end (p)
62 {
63 }
64
65 /// Construct a 0-width location in \a f, \a l, \a c.
66 explicit location (std::string* f,
67 unsigned int l = 1u,
68 unsigned int c = 1u)
69 : begin (f, l, c)
70 , end (f, l, c)
62 {71 {
63 }72 }
6473
6574
66 /// Initialization.75 /// Initialization.
67 inline void initialize (std::string* fn)76 void initialize (std::string* f = YY_NULLPTR,
77 unsigned int l = 1u,
78 unsigned int c = 1u)
68 {79 {
69 begin.initialize (fn);80 begin.initialize (f, l, c);
70 end = begin;81 end = begin;
71 }82 }
7283
@@ -74,19 +85,19 @@
74 ** \{ */85 ** \{ */
75 public:86 public:
76 /// Reset initial location to final location.87 /// Reset initial location to final location.
77 inline void step ()88 void step ()
78 {89 {
79 begin = end;90 begin = end;
80 }91 }
8192
82 /// Extend the current location to the COUNT next columns.93 /// Extend the current location to the COUNT next columns.
83 inline void columns (unsigned int count = 1)94 void columns (int count = 1)
84 {95 {
85 end += count;96 end += count;
86 }97 }
8798
88 /// Extend the current location to the COUNT next lines.99 /// Extend the current location to the COUNT next lines.
89 inline void lines (unsigned int count = 1)100 void lines (int count = 1)
90 {101 {
91 end.lines (count);102 end.lines (count);
92 }103 }
@@ -101,26 +112,35 @@
101 };112 };
102113
103 /// Join two location objects to create a location.114 /// Join two location objects to create a location.
104 inline const location operator+ (const location& begin, const location& end)115 inline location operator+ (location res, const location& end)
105 {116 {
106 location res = begin;
107 res.end = end.end;117 res.end = end.end;
108 return res;118 return res;
109 }119 }
110120
111 /// Add two location objects.121 /// Change end position in place.
112 inline const location operator+ (const location& begin, unsigned int width)122 inline location& operator+= (location& res, int width)
113 {123 {
114 location res = begin;124 res.columns (width);
115 res.columns (width);125 return res;
116 return res;126 }
117 }127
118128 /// Change end position.
119 /// Add and assign a location.129 inline location operator+ (location res, int width)
120 inline location& operator+= (location& res, unsigned int width)130 {
121 {131 return res += width;
122 res.columns (width);132 }
123 return res;133
134 /// Change end position in place.
135 inline location& operator-= (location& res, int width)
136 {
137 return res += -width;
138 }
139
140 /// Change end position.
141 inline location operator- (const location& begin, int width)
142 {
143 return begin + -width;
124 }144 }
125145
126 /// Compare two location objects.146 /// Compare two location objects.
@@ -143,27 +163,25 @@
143 **163 **
144 ** Avoid duplicate information.164 ** Avoid duplicate information.
145 */165 */
146 inline std::ostream& operator<< (std::ostream& ostr, const location& loc)166 template <typename YYChar>
167 inline std::basic_ostream<YYChar>&
168 operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
147 {169 {
148 position last = loc.end - 1;170 unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
149 ostr << loc.begin;171 ostr << loc.begin// << "(" << loc.end << ") "
150 if (last.filename172;
151 && (!loc.begin.filename173 if (loc.end.filename
152 || *loc.begin.filename != *last.filename))174 && (!loc.begin.filename
153 ostr << '-' << last;175 || *loc.begin.filename != *loc.end.filename))
154 else if (loc.begin.line != last.line)176 ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
155 ostr << '-' << last.line << '.' << last.column;177 else if (loc.begin.line < loc.end.line)
156 else if (loc.begin.column != last.column)178 ostr << '-' << loc.end.line << '.' << end_col;
157 ostr << '-' << last.column;179 else if (loc.begin.column < end_col)
180 ostr << '-' << end_col;
158 return ostr;181 return ostr;
159 }182 }
160183
161184#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291
162/* Line 271 of location.cc */
163#line 5 "src/Core/QueryParser/grammar.yy"
164} // VerifyTAPN185} // VerifyTAPN
165186#line 187 "src/Core/QueryParser/Generated/location.hh" // location.cc:291
166/* Line 271 of location.cc */187#endif // !YY_YY_SRC_CORE_QUERYPARSER_GENERATED_LOCATION_HH_INCLUDED
167#line 168 "src/Core/QueryParser/Generated/location.hh"
168
169#endif // not BISON_LOCATION_HH
170188
=== modified file 'src/Core/QueryParser/Generated/parser.cpp'
--- src/Core/QueryParser/Generated/parser.cpp 2014-08-07 20:48:41 +0000
+++ src/Core/QueryParser/Generated/parser.cpp 2018-01-07 20:09:44 +0000
@@ -1,68 +1,65 @@
11// A Bison parser, made by GNU Bison 3.0.2.
2/* A Bison parser, made by GNU Bison 2.4.1. */2
33// Skeleton implementation for Bison LALR(1) parsers in C++
4/* Skeleton implementation for Bison LALR(1) parsers in C++4
5 5// Copyright (C) 2002-2013 Free Software Foundation, Inc.
6 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software6
7 Foundation, Inc.7// This program is free software: you can redistribute it and/or modify
8 8// it under the terms of the GNU General Public License as published by
9 This program is free software: you can redistribute it and/or modify9// the Free Software Foundation, either version 3 of the License, or
10 it under the terms of the GNU General Public License as published by10// (at your option) any later version.
11 the Free Software Foundation, either version 3 of the License, or11
12 (at your option) any later version.12// This program is distributed in the hope that it will be useful,
13 13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 This program is distributed in the hope that it will be useful,14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 but WITHOUT ANY WARRANTY; without even the implied warranty of15// GNU General Public License for more details.
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16
17 GNU General Public License for more details.17// You should have received a copy of the GNU General Public License
18 18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19 You should have received a copy of the GNU General Public License19
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
2121// part or all of the Bison parser skeleton and distribute that work
22/* As a special exception, you may create a larger work that contains22// under terms of your choice, so long as that work isn't itself a
23 part or all of the Bison parser skeleton and distribute that work23// parser generator using the skeleton or a modified version thereof
24 under terms of your choice, so long as that work isn't itself a24// as a parser skeleton. Alternatively, if you modify or redistribute
25 parser generator using the skeleton or a modified version thereof25// the parser skeleton itself, you may (at your option) remove this
26 as a parser skeleton. Alternatively, if you modify or redistribute26// special exception, which will cause the skeleton and the resulting
27 the parser skeleton itself, you may (at your option) remove this27// Bison output files to be licensed under the GNU General Public
28 special exception, which will cause the skeleton and the resulting28// License without this special exception.
29 Bison output files to be licensed under the GNU General Public29
30 License without this special exception.30// This special exception was added by the Free Software Foundation in
31 31// version 2.2 of Bison.
32 This special exception was added by the Free Software Foundation in32
33 version 2.2 of Bison. */33
3434// First part of user declarations.
3535
36/* First part of user declarations. */36#line 37 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:399
3737
3838# ifndef YY_NULLPTR
39/* Line 311 of lalr1.cc */39# if defined __cplusplus && 201103L <= __cplusplus
40#line 41 "src/Core/QueryParser/Generated/parser.cpp"40# define YY_NULLPTR nullptr
4141# else
42# define YY_NULLPTR 0
43# endif
44# endif
4245
43#include "parser.hpp"46#include "parser.hpp"
4447
45/* User implementation prologue. */48// User implementation prologue.
4649
4750#line 51 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:407
48/* Line 317 of lalr1.cc */51// Unqualified %code blocks.
49#line 50 "src/Core/QueryParser/Generated/parser.cpp"52#line 38 "src/Core/QueryParser/grammar.yy" // lalr1.cc:408
50/* Unqualified %code blocks. */
51
52/* Line 318 of lalr1.cc */
53#line 38 "src/Core/QueryParser/grammar.yy"
5453
55 #include "../TAPNQueryParser.hpp"54 #include "../TAPNQueryParser.hpp"
5655
5756#line 57 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:408
5857
59/* Line 318 of lalr1.cc */
60#line 61 "src/Core/QueryParser/Generated/parser.cpp"
6158
62#ifndef YY_59#ifndef YY_
63# if YYENABLE_NLS60# if defined YYENABLE_NLS && YYENABLE_NLS
64# if ENABLE_NLS61# if ENABLE_NLS
65# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */62# include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
66# define YY_(msgid) dgettext ("bison-runtime", msgid)63# define YY_(msgid) dgettext ("bison-runtime", msgid)
67# endif64# endif
68# endif65# endif
@@ -71,62 +68,78 @@
71# endif68# endif
72#endif69#endif
7370
74/* Suppress unused-variable warnings by "using" E. */71#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
75#define YYUSE(e) ((void) (e))72/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
7673 If N is 0, then set CURRENT to the empty location which ends
77/* Enable debugging if requested. */74 the previous symbol: RHS[0] (always defined). */
75
76# ifndef YYLLOC_DEFAULT
77# define YYLLOC_DEFAULT(Current, Rhs, N) \
78 do \
79 if (N) \
80 { \
81 (Current).begin = YYRHSLOC (Rhs, 1).begin; \
82 (Current).end = YYRHSLOC (Rhs, N).end; \
83 } \
84 else \
85 { \
86 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
87 } \
88 while (/*CONSTCOND*/ false)
89# endif
90
91
92// Suppress unused-variable warnings by "using" E.
93#define YYUSE(E) ((void) (E))
94
95// Enable debugging if requested.
78#if YYDEBUG96#if YYDEBUG
7997
80/* A pseudo ostream that takes yydebug_ into account. */98// A pseudo ostream that takes yydebug_ into account.
81# define YYCDEBUG if (yydebug_) (*yycdebug_)99# define YYCDEBUG if (yydebug_) (*yycdebug_)
82100
83# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \101# define YY_SYMBOL_PRINT(Title, Symbol) \
84do { \102 do { \
85 if (yydebug_) \103 if (yydebug_) \
86 { \104 { \
87 *yycdebug_ << Title << ' '; \105 *yycdebug_ << Title << ' '; \
88 yy_symbol_print_ ((Type), (Value), (Location)); \106 yy_print_ (*yycdebug_, Symbol); \
89 *yycdebug_ << std::endl; \107 *yycdebug_ << std::endl; \
90 } \108 } \
91} while (false)109 } while (false)
92110
93# define YY_REDUCE_PRINT(Rule) \111# define YY_REDUCE_PRINT(Rule) \
94do { \112 do { \
95 if (yydebug_) \113 if (yydebug_) \
96 yy_reduce_print_ (Rule); \114 yy_reduce_print_ (Rule); \
97} while (false)115 } while (false)
98116
99# define YY_STACK_PRINT() \117# define YY_STACK_PRINT() \
100do { \118 do { \
101 if (yydebug_) \119 if (yydebug_) \
102 yystack_print_ (); \120 yystack_print_ (); \
103} while (false)121 } while (false)
104122
105#else /* !YYDEBUG */123#else // !YYDEBUG
106124
107# define YYCDEBUG if (false) std::cerr125# define YYCDEBUG if (false) std::cerr
108# define YY_SYMBOL_PRINT(Title, Type, Value, Location)126# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
109# define YY_REDUCE_PRINT(Rule)127# define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
110# define YY_STACK_PRINT()128# define YY_STACK_PRINT() static_cast<void>(0)
111129
112#endif /* !YYDEBUG */130#endif // !YYDEBUG
113131
114#define yyerrok (yyerrstatus_ = 0)132#define yyerrok (yyerrstatus_ = 0)
115#define yyclearin (yychar = yyempty_)133#define yyclearin (yyempty = true)
116134
117#define YYACCEPT goto yyacceptlab135#define YYACCEPT goto yyacceptlab
118#define YYABORT goto yyabortlab136#define YYABORT goto yyabortlab
119#define YYERROR goto yyerrorlab137#define YYERROR goto yyerrorlab
120#define YYRECOVERING() (!!yyerrstatus_)138#define YYRECOVERING() (!!yyerrstatus_)
121139
122140#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:474
123/* Line 380 of lalr1.cc */
124#line 5 "src/Core/QueryParser/grammar.yy"
125namespace VerifyTAPN {141namespace VerifyTAPN {
126142#line 143 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:474
127/* Line 380 of lalr1.cc */
128#line 129 "src/Core/QueryParser/Generated/parser.cpp"
129#if YYERROR_VERBOSE
130143
131 /* Return YYSTR after stripping away unnecessary quotes and144 /* Return YYSTR after stripping away unnecessary quotes and
132 backslashes, so that it's suitable for yyerror. The heuristic is145 backslashes, so that it's suitable for yyerror. The heuristic is
@@ -151,7 +164,7 @@
151 case '\\':164 case '\\':
152 if (*++yyp != '\\')165 if (*++yyp != '\\')
153 goto do_not_strip_quotes;166 goto do_not_strip_quotes;
154 /* Fall through. */167 // Fall through.
155 default:168 default:
156 yyr += *yyp;169 yyr += *yyp;
157 break;170 break;
@@ -165,7 +178,6 @@
165 return yystr;178 return yystr;
166 }179 }
167180
168#endif
169181
170 /// Build a parser object.182 /// Build a parser object.
171 Parser::Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg)183 Parser::Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg)
@@ -175,230 +187,344 @@
175 yycdebug_ (&std::cerr),187 yycdebug_ (&std::cerr),
176#endif188#endif
177 driver (driver_yyarg)189 driver (driver_yyarg)
178 {190 {}
179 }
180191
181 Parser::~Parser ()192 Parser::~Parser ()
182 {193 {}
194
195
196 /*---------------.
197 | Symbol types. |
198 `---------------*/
199
200 inline
201 Parser::syntax_error::syntax_error (const location_type& l, const std::string& m)
202 : std::runtime_error (m)
203 , location (l)
204 {}
205
206 // basic_symbol.
207 template <typename Base>
208 inline
209 Parser::basic_symbol<Base>::basic_symbol ()
210 : value ()
211 {}
212
213 template <typename Base>
214 inline
215 Parser::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
216 : Base (other)
217 , value ()
218 , location (other.location)
219 {
220 value = other.value;
221 }
222
223
224 template <typename Base>
225 inline
226 Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
227 : Base (t)
228 , value (v)
229 , location (l)
230 {}
231
232
233 /// Constructor for valueless symbols.
234 template <typename Base>
235 inline
236 Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
237 : Base (t)
238 , value ()
239 , location (l)
240 {}
241
242 template <typename Base>
243 inline
244 Parser::basic_symbol<Base>::~basic_symbol ()
245 {
246 }
247
248 template <typename Base>
249 inline
250 void
251 Parser::basic_symbol<Base>::move (basic_symbol& s)
252 {
253 super_type::move(s);
254 value = s.value;
255 location = s.location;
256 }
257
258 // by_type.
259 inline
260 Parser::by_type::by_type ()
261 : type (empty)
262 {}
263
264 inline
265 Parser::by_type::by_type (const by_type& other)
266 : type (other.type)
267 {}
268
269 inline
270 Parser::by_type::by_type (token_type t)
271 : type (yytranslate_ (t))
272 {}
273
274 inline
275 void
276 Parser::by_type::move (by_type& that)
277 {
278 type = that.type;
279 that.type = empty;
280 }
281
282 inline
283 int
284 Parser::by_type::type_get () const
285 {
286 return type;
287 }
288
289
290 // by_state.
291 inline
292 Parser::by_state::by_state ()
293 : state (empty)
294 {}
295
296 inline
297 Parser::by_state::by_state (const by_state& other)
298 : state (other.state)
299 {}
300
301 inline
302 void
303 Parser::by_state::move (by_state& that)
304 {
305 state = that.state;
306 that.state = empty;
307 }
308
309 inline
310 Parser::by_state::by_state (state_type s)
311 : state (s)
312 {}
313
314 inline
315 Parser::symbol_number_type
316 Parser::by_state::type_get () const
317 {
318 return state == empty ? 0 : yystos_[state];
319 }
320
321 inline
322 Parser::stack_symbol_type::stack_symbol_type ()
323 {}
324
325
326 inline
327 Parser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
328 : super_type (s, that.location)
329 {
330 value = that.value;
331 // that is emptied.
332 that.type = empty;
333 }
334
335 inline
336 Parser::stack_symbol_type&
337 Parser::stack_symbol_type::operator= (const stack_symbol_type& that)
338 {
339 state = that.state;
340 value = that.value;
341 location = that.location;
342 return *this;
343 }
344
345
346 template <typename Base>
347 inline
348 void
349 Parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
350 {
351 if (yymsg)
352 YY_SYMBOL_PRINT (yymsg, yysym);
353
354 // User destructor.
355 switch (yysym.type_get ())
356 {
357 case 3: // IDENTIFIER
358
359#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
360 { delete (yysym.value.string); }
361#line 362 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
362 break;
363
364 case 4: // LESS
365
366#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
367 { delete (yysym.value.string); }
368#line 369 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
369 break;
370
371 case 5: // LESSEQUAL
372
373#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
374 { delete (yysym.value.string); }
375#line 376 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
376 break;
377
378 case 6: // EQUAL
379
380#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
381 { delete (yysym.value.string); }
382#line 383 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
383 break;
384
385 case 7: // GREATEREQUAL
386
387#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
388 { delete (yysym.value.string); }
389#line 390 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
390 break;
391
392 case 8: // GREATER
393
394#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
395 { delete (yysym.value.string); }
396#line 397 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
397 break;
398
399 case 28: // query
400
401#line 58 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
402 { delete (yysym.value.query); }
403#line 404 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
404 break;
405
406 case 29: // expression
407
408#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
409 { delete (yysym.value.expr); }
410#line 411 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
411 break;
412
413 case 30: // arithmeticExpression
414
415#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
416 { delete (yysym.value.arexpr); }
417#line 418 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
418 break;
419
420 case 31: // multiplyExpression
421
422#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
423 { delete (yysym.value.arexpr); }
424#line 425 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
425 break;
426
427 case 32: // arithmeticParantheses
428
429#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
430 { delete (yysym.value.arexpr); }
431#line 432 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
432 break;
433
434 case 33: // parExpression
435
436#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
437 { delete (yysym.value.expr); }
438#line 439 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
439 break;
440
441 case 34: // notExpression
442
443#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
444 { delete (yysym.value.expr); }
445#line 446 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
446 break;
447
448 case 35: // orExpression
449
450#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
451 { delete (yysym.value.expr); }
452#line 453 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
453 break;
454
455 case 36: // andExpression
456
457#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
458 { delete (yysym.value.expr); }
459#line 460 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
460 break;
461
462 case 37: // boolExpression
463
464#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
465 { delete (yysym.value.expr); }
466#line 467 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
467 break;
468
469 case 38: // atomicProposition
470
471#line 57 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
472 { delete (yysym.value.expr); }
473#line 474 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
474 break;
475
476 case 39: // compareOp
477
478#line 56 "src/Core/QueryParser/grammar.yy" // lalr1.cc:599
479 { delete (yysym.value.string); }
480#line 481 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:599
481 break;
482
483
484 default:
485 break;
486 }
183 }487 }
184488
185#if YYDEBUG489#if YYDEBUG
186 /*--------------------------------.490 template <typename Base>
187 | Print this symbol on YYOUTPUT. |
188 `--------------------------------*/
189
190 inline void
191 Parser::yy_symbol_value_print_ (int yytype,
192 const semantic_type* yyvaluep, const location_type* yylocationp)
193 {
194 YYUSE (yylocationp);
195 YYUSE (yyvaluep);
196 switch (yytype)
197 {
198 default:
199 break;
200 }
201 }
202
203
204 void491 void
205 Parser::yy_symbol_print_ (int yytype,492 Parser::yy_print_ (std::ostream& yyo,
206 const semantic_type* yyvaluep, const location_type* yylocationp)493 const basic_symbol<Base>& yysym) const
207 {494 {
208 *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")495 std::ostream& yyoutput = yyo;
209 << ' ' << yytname_[yytype] << " ("496 YYUSE (yyoutput);
210 << *yylocationp << ": ";497 symbol_number_type yytype = yysym.type_get ();
211 yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);498 yyo << (yytype < yyntokens_ ? "token" : "nterm")
212 *yycdebug_ << ')';499 << ' ' << yytname_[yytype] << " ("
500 << yysym.location << ": ";
501 YYUSE (yytype);
502 yyo << ')';
213 }503 }
214#endif504#endif
215505
216 void506 inline
217 Parser::yydestruct_ (const char* yymsg,507 void
218 int yytype, semantic_type* yyvaluep, location_type* yylocationp)508 Parser::yypush_ (const char* m, state_type s, symbol_type& sym)
219 {509 {
220 YYUSE (yylocationp);510 stack_symbol_type t (s, sym);
221 YYUSE (yymsg);511 yypush_ (m, t);
222 YYUSE (yyvaluep);512 }
223513
224 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);514 inline
225515 void
226 switch (yytype)516 Parser::yypush_ (const char* m, stack_symbol_type& s)
227 {517 {
228 case 3: /* "IDENTIFIER" */518 if (m)
229519 YY_SYMBOL_PRINT (m, s);
230/* Line 480 of lalr1.cc */520 yystack_.push (s);
231#line 56 "src/Core/QueryParser/grammar.yy"521 }
232 { delete (yyvaluep->string); };522
233523 inline
234/* Line 480 of lalr1.cc */
235#line 236 "src/Core/QueryParser/Generated/parser.cpp"
236 break;
237 case 4: /* "LESS" */
238
239/* Line 480 of lalr1.cc */
240#line 56 "src/Core/QueryParser/grammar.yy"
241 { delete (yyvaluep->string); };
242
243/* Line 480 of lalr1.cc */
244#line 245 "src/Core/QueryParser/Generated/parser.cpp"
245 break;
246 case 5: /* "LESSEQUAL" */
247
248/* Line 480 of lalr1.cc */
249#line 56 "src/Core/QueryParser/grammar.yy"
250 { delete (yyvaluep->string); };
251
252/* Line 480 of lalr1.cc */
253#line 254 "src/Core/QueryParser/Generated/parser.cpp"
254 break;
255 case 6: /* "EQUAL" */
256
257/* Line 480 of lalr1.cc */
258#line 56 "src/Core/QueryParser/grammar.yy"
259 { delete (yyvaluep->string); };
260
261/* Line 480 of lalr1.cc */
262#line 263 "src/Core/QueryParser/Generated/parser.cpp"
263 break;
264 case 7: /* "GREATEREQUAL" */
265
266/* Line 480 of lalr1.cc */
267#line 56 "src/Core/QueryParser/grammar.yy"
268 { delete (yyvaluep->string); };
269
270/* Line 480 of lalr1.cc */
271#line 272 "src/Core/QueryParser/Generated/parser.cpp"
272 break;
273 case 8: /* "GREATER" */
274
275/* Line 480 of lalr1.cc */
276#line 56 "src/Core/QueryParser/grammar.yy"
277 { delete (yyvaluep->string); };
278
279/* Line 480 of lalr1.cc */
280#line 281 "src/Core/QueryParser/Generated/parser.cpp"
281 break;
282 case 26: /* "query" */
283
284/* Line 480 of lalr1.cc */
285#line 58 "src/Core/QueryParser/grammar.yy"
286 { delete (yyvaluep->query); };
287
288/* Line 480 of lalr1.cc */
289#line 290 "src/Core/QueryParser/Generated/parser.cpp"
290 break;
291 case 27: /* "expression" */
292
293/* Line 480 of lalr1.cc */
294#line 57 "src/Core/QueryParser/grammar.yy"
295 { delete (yyvaluep->expr); };
296
297/* Line 480 of lalr1.cc */
298#line 299 "src/Core/QueryParser/Generated/parser.cpp"
299 break;
300 case 28: /* "arithmeticExpression" */
301
302/* Line 480 of lalr1.cc */
303#line 57 "src/Core/QueryParser/grammar.yy"
304 { delete (yyvaluep->arexpr); };
305
306/* Line 480 of lalr1.cc */
307#line 308 "src/Core/QueryParser/Generated/parser.cpp"
308 break;
309 case 29: /* "multiplyExpression" */
310
311/* Line 480 of lalr1.cc */
312#line 57 "src/Core/QueryParser/grammar.yy"
313 { delete (yyvaluep->arexpr); };
314
315/* Line 480 of lalr1.cc */
316#line 317 "src/Core/QueryParser/Generated/parser.cpp"
317 break;
318 case 30: /* "arithmeticParantheses" */
319
320/* Line 480 of lalr1.cc */
321#line 57 "src/Core/QueryParser/grammar.yy"
322 { delete (yyvaluep->arexpr); };
323
324/* Line 480 of lalr1.cc */
325#line 326 "src/Core/QueryParser/Generated/parser.cpp"
326 break;
327 case 31: /* "parExpression" */
328
329/* Line 480 of lalr1.cc */
330#line 57 "src/Core/QueryParser/grammar.yy"
331 { delete (yyvaluep->expr); };
332
333/* Line 480 of lalr1.cc */
334#line 335 "src/Core/QueryParser/Generated/parser.cpp"
335 break;
336 case 32: /* "notExpression" */
337
338/* Line 480 of lalr1.cc */
339#line 57 "src/Core/QueryParser/grammar.yy"
340 { delete (yyvaluep->expr); };
341
342/* Line 480 of lalr1.cc */
343#line 344 "src/Core/QueryParser/Generated/parser.cpp"
344 break;
345 case 33: /* "orExpression" */
346
347/* Line 480 of lalr1.cc */
348#line 57 "src/Core/QueryParser/grammar.yy"
349 { delete (yyvaluep->expr); };
350
351/* Line 480 of lalr1.cc */
352#line 353 "src/Core/QueryParser/Generated/parser.cpp"
353 break;
354 case 34: /* "andExpression" */
355
356/* Line 480 of lalr1.cc */
357#line 57 "src/Core/QueryParser/grammar.yy"
358 { delete (yyvaluep->expr); };
359
360/* Line 480 of lalr1.cc */
361#line 362 "src/Core/QueryParser/Generated/parser.cpp"
362 break;
363 case 35: /* "boolExpression" */
364
365/* Line 480 of lalr1.cc */
366#line 57 "src/Core/QueryParser/grammar.yy"
367 { delete (yyvaluep->expr); };
368
369/* Line 480 of lalr1.cc */
370#line 371 "src/Core/QueryParser/Generated/parser.cpp"
371 break;
372 case 36: /* "atomicProposition" */
373
374/* Line 480 of lalr1.cc */
375#line 57 "src/Core/QueryParser/grammar.yy"
376 { delete (yyvaluep->expr); };
377
378/* Line 480 of lalr1.cc */
379#line 380 "src/Core/QueryParser/Generated/parser.cpp"
380 break;
381 case 37: /* "compareOp" */
382
383/* Line 480 of lalr1.cc */
384#line 56 "src/Core/QueryParser/grammar.yy"
385 { delete (yyvaluep->string); };
386
387/* Line 480 of lalr1.cc */
388#line 389 "src/Core/QueryParser/Generated/parser.cpp"
389 break;
390
391 default:
392 break;
393 }
394 }
395
396 void524 void
397 Parser::yypop_ (unsigned int n)525 Parser::yypop_ (unsigned int n)
398 {526 {
399 yystate_stack_.pop (n);527 yystack_.pop (n);
400 yysemantic_stack_.pop (n);
401 yylocation_stack_.pop (n);
402 }528 }
403529
404#if YYDEBUG530#if YYDEBUG
@@ -426,140 +552,144 @@
426 {552 {
427 yydebug_ = l;553 yydebug_ = l;
428 }554 }
429#endif555#endif // YYDEBUG
556
557 inline Parser::state_type
558 Parser::yy_lr_goto_state_ (state_type yystate, int yysym)
559 {
560 int yyr = yypgoto_[yysym - yyntokens_] + yystate;
561 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
562 return yytable_[yyr];
563 else
564 return yydefgoto_[yysym - yyntokens_];
565 }
566
567 inline bool
568 Parser::yy_pact_value_is_default_ (int yyvalue)
569 {
570 return yyvalue == yypact_ninf_;
571 }
572
573 inline bool
574 Parser::yy_table_value_is_error_ (int yyvalue)
575 {
576 return yyvalue == yytable_ninf_;
577 }
430578
431 int579 int
432 Parser::parse ()580 Parser::parse ()
433 {581 {
434 /// Lookahead and lookahead in internal form.582 /// Whether yyla contains a lookahead.
435 int yychar = yyempty_;583 bool yyempty = true;
436 int yytoken = 0;
437584
438 /* State. */585 // State.
439 int yyn;586 int yyn;
587 /// Length of the RHS of the rule being reduced.
440 int yylen = 0;588 int yylen = 0;
441 int yystate = 0;
442589
443 /* Error handling. */590 // Error handling.
444 int yynerrs_ = 0;591 int yynerrs_ = 0;
445 int yyerrstatus_ = 0;592 int yyerrstatus_ = 0;
446593
447 /// Semantic value of the lookahead.594 /// The lookahead symbol.
448 semantic_type yylval;595 symbol_type yyla;
449 /// Location of the lookahead.596
450 location_type yylloc;
451 /// The locations where the error started and ended.597 /// The locations where the error started and ended.
452 location_type yyerror_range[2];598 stack_symbol_type yyerror_range[3];
453599
454 /// $$.600 /// The return value of parse ().
455 semantic_type yyval;
456 /// @$.
457 location_type yyloc;
458
459 int yyresult;601 int yyresult;
460602
603 // FIXME: This shoud be completely indented. It is not yet to
604 // avoid gratuitous conflicts when merging into the master branch.
605 try
606 {
461 YYCDEBUG << "Starting parse" << std::endl;607 YYCDEBUG << "Starting parse" << std::endl;
462608
463609
464 /* User initialization code. */610 // User initialization code.
465 611 #line 21 "src/Core/QueryParser/grammar.yy" // lalr1.cc:725
466/* Line 559 of lalr1.cc */
467#line 21 "src/Core/QueryParser/grammar.yy"
468{612{
469 // Initialize the initial location.613 // Initialize the initial location.
470 yylloc.begin.filename = yylloc.end.filename = &driver.file;614 yyla.location.begin.filename = yyla.location.end.filename = &driver.file;
471}615}
472616
473/* Line 559 of lalr1.cc */617#line 618 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:725
474#line 475 "src/Core/QueryParser/Generated/parser.cpp"
475618
476 /* Initialize the stacks. The initial state will be pushed in619 /* Initialize the stack. The initial state will be set in
477 yynewstate, since the latter expects the semantical and the620 yynewstate, since the latter expects the semantical and the
478 location values to have been already stored, initialize these621 location values to have been already stored, initialize these
479 stacks with a primary value. */622 stacks with a primary value. */
480 yystate_stack_ = state_stack_type (0);623 yystack_.clear ();
481 yysemantic_stack_ = semantic_stack_type (0);624 yypush_ (YY_NULLPTR, 0, yyla);
482 yylocation_stack_ = location_stack_type (0);
483 yysemantic_stack_.push (yylval);
484 yylocation_stack_.push (yylloc);
485625
486 /* New state. */626 // A new symbol was pushed on the stack.
487 yynewstate:627 yynewstate:
488 yystate_stack_.push (yystate);628 YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
489 YYCDEBUG << "Entering state " << yystate << std::endl;
490629
491 /* Accept? */630 // Accept?
492 if (yystate == yyfinal_)631 if (yystack_[0].state == yyfinal_)
493 goto yyacceptlab;632 goto yyacceptlab;
494633
495 goto yybackup;634 goto yybackup;
496635
497 /* Backup. */636 // Backup.
498 yybackup:637 yybackup:
499638
500 /* Try to take a decision without lookahead. */639 // Try to take a decision without lookahead.
501 yyn = yypact_[yystate];640 yyn = yypact_[yystack_[0].state];
502 if (yyn == yypact_ninf_)641 if (yy_pact_value_is_default_ (yyn))
503 goto yydefault;642 goto yydefault;
504643
505 /* Read a lookahead token. */644 // Read a lookahead token.
506 if (yychar == yyempty_)645 if (yyempty)
507 {646 {
508 YYCDEBUG << "Reading a token: ";647 YYCDEBUG << "Reading a token: ";
509 yychar = yylex (&yylval, &yylloc, driver);648 try
510 }649 {
511650 yyla.type = yytranslate_ (yylex (&yyla.value, &yyla.location, driver));
512651 }
513 /* Convert token to internal form. */652 catch (const syntax_error& yyexc)
514 if (yychar <= yyeof_)653 {
515 {654 error (yyexc);
516 yychar = yytoken = yyeof_;655 goto yyerrlab1;
517 YYCDEBUG << "Now at end of input." << std::endl;656 }
518 }657 yyempty = false;
519 else658 }
520 {659 YY_SYMBOL_PRINT ("Next token is", yyla);
521 yytoken = yytranslate_ (yychar);660
522 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);661 /* If the proper action on seeing token YYLA.TYPE is to reduce or
523 }662 to detect an error, take that action. */
524663 yyn += yyla.type_get ();
525 /* If the proper action on seeing token YYTOKEN is to reduce or to664 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
526 detect an error, take that action. */665 goto yydefault;
527 yyn += yytoken;666
528 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)667 // Reduce or error.
529 goto yydefault;
530
531 /* Reduce or error. */
532 yyn = yytable_[yyn];668 yyn = yytable_[yyn];
533 if (yyn <= 0)669 if (yyn <= 0)
534 {670 {
535 if (yyn == 0 || yyn == yytable_ninf_)671 if (yy_table_value_is_error_ (yyn))
536 goto yyerrlab;672 goto yyerrlab;
537 yyn = -yyn;673 yyn = -yyn;
538 goto yyreduce;674 goto yyreduce;
539 }675 }
540676
541 /* Shift the lookahead token. */677 // Discard the token being shifted.
542 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);678 yyempty = true;
543679
544 /* Discard the token being shifted. */680 // Count tokens shifted since error; after three, turn off error status.
545 yychar = yyempty_;
546
547 yysemantic_stack_.push (yylval);
548 yylocation_stack_.push (yylloc);
549
550 /* Count tokens shifted since error; after three, turn off error
551 status. */
552 if (yyerrstatus_)681 if (yyerrstatus_)
553 --yyerrstatus_;682 --yyerrstatus_;
554683
555 yystate = yyn;684 // Shift the lookahead token.
685 yypush_ ("Shifting", yyn, yyla);
556 goto yynewstate;686 goto yynewstate;
557687
558 /*-----------------------------------------------------------.688 /*-----------------------------------------------------------.
559 | yydefault -- do the default action for the current state. |689 | yydefault -- do the default action for the current state. |
560 `-----------------------------------------------------------*/690 `-----------------------------------------------------------*/
561 yydefault:691 yydefault:
562 yyn = yydefact_[yystate];692 yyn = yydefact_[yystack_[0].state];
563 if (yyn == 0)693 if (yyn == 0)
564 goto yyerrlab;694 goto yyerrlab;
565 goto yyreduce;695 goto yyreduce;
@@ -569,276 +699,262 @@
569 `-----------------------------*/699 `-----------------------------*/
570 yyreduce:700 yyreduce:
571 yylen = yyr2_[yyn];701 yylen = yyr2_[yyn];
572 /* If YYLEN is nonzero, implement the default value of the action:
573 `$$ = $1'. Otherwise, use the top of the stack.
574
575 Otherwise, the following line sets YYVAL to garbage.
576 This behavior is undocumented and Bison
577 users should not rely upon it. */
578 if (yylen)
579 yyval = yysemantic_stack_[yylen - 1];
580 else
581 yyval = yysemantic_stack_[0];
582
583 {702 {
584 slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);703 stack_symbol_type yylhs;
585 YYLLOC_DEFAULT (yyloc, slice, yylen);704 yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
586 }705 /* If YYLEN is nonzero, implement the default value of the
587 YY_REDUCE_PRINT (yyn);706 action: '$$ = $1'. Otherwise, use the top of the stack.
588 switch (yyn)707
708 Otherwise, the following line sets YYLHS.VALUE to garbage.
709 This behavior is undocumented and Bison users should not rely
710 upon it. */
711 if (yylen)
712 yylhs.value = yystack_[yylen - 1].value;
713 else
714 yylhs.value = yystack_[0].value;
715
716 // Compute the default @$.
589 {717 {
590 case 2:718 slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
719 YYLLOC_DEFAULT (yylhs.location, slice, yylen);
720 }
591721
592/* Line 678 of lalr1.cc */722 // Perform the reduction.
593#line 62 "src/Core/QueryParser/grammar.yy"723 YY_REDUCE_PRINT (yyn);
594 { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); }724 try
725 {
726 switch (yyn)
727 {
728 case 2:
729#line 62 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
730 { (yylhs.value.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EF, (yystack_[0].value.expr)); driver.setAST((yylhs.value.query)); }
731#line 732 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
595 break;732 break;
596733
597 case 3:734 case 3:
598735#line 63 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
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)); }
600#line 63 "src/Core/QueryParser/grammar.yy"737#line 738 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
601 { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AG, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); }
602 break;738 break;
603739
604 case 4:740 case 4:
605741#line 64 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
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)); }
607#line 64 "src/Core/QueryParser/grammar.yy"743#line 744 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
608 { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::EG, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); }
609 break;744 break;
610745
611 case 5:746 case 5:
612747#line 65 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
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)); }
614#line 65 "src/Core/QueryParser/grammar.yy"749#line 750 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
615 { (yyval.query) = new VerifyTAPN::AST::Query(VerifyTAPN::AST::AF, (yysemantic_stack_[(2) - (2)].expr)); driver.setAST((yyval.query)); }
616 break;750 break;
617751
618 case 6:752 case 6:
619753#line 66 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
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));}
621#line 68 "src/Core/QueryParser/grammar.yy"755#line 756 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
622 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
623 break;756 break;
624757
625 case 7:758 case 7:
626759#line 67 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
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));}
628#line 69 "src/Core/QueryParser/grammar.yy"761#line 762 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
629 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
630 break;762 break;
631763
632 case 8:764 case 8:
633765#line 70 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
634/* Line 678 of lalr1.cc */766 { (yylhs.value.expr) = (yystack_[0].value.expr); }
635#line 70 "src/Core/QueryParser/grammar.yy"767#line 768 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
636 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
637 break;768 break;
638769
639 case 9:770 case 9:
640771#line 71 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
641/* Line 678 of lalr1.cc */772 { (yylhs.value.expr) = (yystack_[0].value.expr); }
642#line 71 "src/Core/QueryParser/grammar.yy"773#line 774 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
643 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
644 break;774 break;
645775
646 case 10:776 case 10:
647777#line 72 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
648/* Line 678 of lalr1.cc */778 { (yylhs.value.expr) = (yystack_[0].value.expr); }
649#line 72 "src/Core/QueryParser/grammar.yy"779#line 780 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
650 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
651 break;780 break;
652781
653 case 11:782 case 11:
654783#line 73 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
655/* Line 678 of lalr1.cc */784 { (yylhs.value.expr) = (yystack_[0].value.expr); }
656#line 73 "src/Core/QueryParser/grammar.yy"785#line 786 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
657 { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); }
658 break;786 break;
659787
660 case 12:788 case 12:
661789#line 74 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
662/* Line 678 of lalr1.cc */790 { (yylhs.value.expr) = (yystack_[0].value.expr); }
663#line 79 "src/Core/QueryParser/grammar.yy"791#line 792 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
664 { (yyval.arexpr) = new VerifyTAPN::AST::PlusExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); }
665 break;792 break;
666793
667 case 13:794 case 13:
668795#line 75 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
669/* Line 678 of lalr1.cc */796 { (yylhs.value.expr) = (yystack_[0].value.expr); }
670#line 80 "src/Core/QueryParser/grammar.yy"797#line 798 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
671 { (yyval.arexpr) = new VerifyTAPN::AST::SubtractExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); }
672 break;798 break;
673799
674 case 14:800 case 14:
675801#line 81 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
676/* Line 678 of lalr1.cc */802 { (yylhs.value.arexpr) = new VerifyTAPN::AST::PlusExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); }
677#line 81 "src/Core/QueryParser/grammar.yy"803#line 804 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
678 { (yyval.arexpr) = new VerifyTAPN::AST::MinusExpression((yysemantic_stack_[(2) - (2)].arexpr)); }
679 break;804 break;
680805
681 case 15:806 case 15:
682807#line 82 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
683/* Line 678 of lalr1.cc */808 { (yylhs.value.arexpr) = new VerifyTAPN::AST::SubtractExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); }
684#line 82 "src/Core/QueryParser/grammar.yy"809#line 810 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
685 { (yyval.arexpr) = (yysemantic_stack_[(1) - (1)].arexpr); }
686 break;810 break;
687811
688 case 16:812 case 16:
689813#line 83 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
690/* Line 678 of lalr1.cc */814 { (yylhs.value.arexpr) = new VerifyTAPN::AST::MinusExpression((yystack_[0].value.arexpr)); }
691#line 85 "src/Core/QueryParser/grammar.yy"815#line 816 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
692 { (yyval.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (3)].arexpr)); }
693 break;816 break;
694817
695 case 17:818 case 17:
696819#line 84 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
697/* Line 678 of lalr1.cc */820 { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); }
698#line 86 "src/Core/QueryParser/grammar.yy"821#line 822 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
699 { (yyval.arexpr) = (yysemantic_stack_[(1) - (1)].arexpr); }
700 break;822 break;
701823
702 case 18:824 case 18:
703825#line 87 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
704/* Line 678 of lalr1.cc */826 { (yylhs.value.arexpr) = new VerifyTAPN::AST::MultiplyExpression((yystack_[2].value.arexpr), (yystack_[0].value.arexpr)); }
705#line 89 "src/Core/QueryParser/grammar.yy"827#line 828 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
706 { (yyval.arexpr) = (yysemantic_stack_[(3) - (2)].arexpr); }
707 break;828 break;
708829
709 case 19:830 case 19:
710831#line 88 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
711/* Line 678 of lalr1.cc */832 { (yylhs.value.arexpr) = (yystack_[0].value.arexpr); }
712#line 90 "src/Core/QueryParser/grammar.yy"833#line 834 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
713 { (yyval.arexpr) = new VerifyTAPN::AST::NumberExpression((yysemantic_stack_[(1) - (1)].number));}
714 break;834 break;
715835
716 case 20:836 case 20:
717837#line 91 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
718/* Line 678 of lalr1.cc */838 { (yylhs.value.arexpr) = (yystack_[1].value.arexpr); }
719#line 91 "src/Core/QueryParser/grammar.yy"839#line 840 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
840 break;
841
842 case 21:
843#line 92 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
844 { (yylhs.value.arexpr) = new VerifyTAPN::AST::NumberExpression((yystack_[0].value.number));}
845#line 846 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
846 break;
847
848 case 22:
849#line 93 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
720 { 850 {
721 int placeIndex = driver.getTAPN().getPlaceIndex(*(yysemantic_stack_[(1) - (1)].string));851 int placeIndex = driver.getTAPN().getPlaceIndex(*(yystack_[0].value.string));
722 delete (yysemantic_stack_[(1) - (1)].string);852 delete (yystack_[0].value.string);
723 if(placeIndex == -1) error((yylocation_stack_[(1) - (1)]), "unknown place"); 853 if(placeIndex == -1) error(yystack_[0].location, "unknown place");
724 (yyval.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex); 854 (yylhs.value.arexpr) = new VerifyTAPN::AST::IdentifierExpression(placeIndex);
725 }855 }
726 break;856#line 857 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
727
728 case 21:
729
730/* Line 678 of lalr1.cc */
731#line 99 "src/Core/QueryParser/grammar.yy"
732 { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); }
733 break;
734
735 case 22:
736
737/* Line 678 of lalr1.cc */
738#line 100 "src/Core/QueryParser/grammar.yy"
739 { (yyval.expr) = new VerifyTAPN::AST::NotExpression((yysemantic_stack_[(2) - (2)].expr)); }
740 break;857 break;
741858
742 case 23:859 case 23:
743860#line 101 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
744/* Line 678 of lalr1.cc */861 { (yylhs.value.expr) = (yystack_[1].value.expr); }
745#line 101 "src/Core/QueryParser/grammar.yy"862#line 863 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
746 { (yyval.expr) = new VerifyTAPN::AST::OrExpression((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); }
747 break;863 break;
748864
749 case 24:865 case 24:
750866#line 102 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
751/* Line 678 of lalr1.cc */867 { (yylhs.value.expr) = new VerifyTAPN::AST::NotExpression((yystack_[0].value.expr)); }
752#line 102 "src/Core/QueryParser/grammar.yy"868#line 869 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
753 { (yyval.expr) = new VerifyTAPN::AST::AndExpression((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); }
754 break;869 break;
755870
756 case 25:871 case 25:
757872#line 103 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
758/* Line 678 of lalr1.cc */873 { (yylhs.value.expr) = new VerifyTAPN::AST::OrExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); }
759#line 103 "src/Core/QueryParser/grammar.yy"874#line 875 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
760 { (yyval.expr) = new VerifyTAPN::AST::BoolExpression(true); }
761 break;875 break;
762876
763 case 26:877 case 26:
764878#line 104 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
765/* Line 678 of lalr1.cc */879 { (yylhs.value.expr) = new VerifyTAPN::AST::AndExpression((yystack_[2].value.expr), (yystack_[0].value.expr)); }
766#line 104 "src/Core/QueryParser/grammar.yy"880#line 881 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
767 { (yyval.expr) = new VerifyTAPN::AST::BoolExpression(false); }
768 break;881 break;
769882
770 case 27:883 case 27:
771884#line 105 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
772/* Line 678 of lalr1.cc */885 { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(true); }
773#line 106 "src/Core/QueryParser/grammar.yy"886#line 887 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
774 { (yyval.expr) = new VerifyTAPN::AST::AtomicProposition((yysemantic_stack_[(3) - (1)].arexpr), (yysemantic_stack_[(3) - (2)].string), (yysemantic_stack_[(3) - (3)].arexpr)); }
775 break;887 break;
776888
777 case 28:889 case 28:
778890#line 106 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
779/* Line 678 of lalr1.cc */891 { (yylhs.value.expr) = new VerifyTAPN::AST::BoolExpression(false); }
780#line 107 "src/Core/QueryParser/grammar.yy"892#line 893 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
781 { (yyval.expr) = new VerifyTAPN::AST::DeadlockExpression(); }893 break;
782 break;894
783895 case 29:
784896#line 108 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
785897 { (yylhs.value.expr) = new VerifyTAPN::AST::AtomicProposition((yystack_[2].value.arexpr), (yystack_[1].value.string), (yystack_[0].value.arexpr)); }
786/* Line 678 of lalr1.cc */898#line 899 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
787#line 788 "src/Core/QueryParser/Generated/parser.cpp"899 break;
788 default:900
789 break;901 case 30:
790 }902#line 109 "src/Core/QueryParser/grammar.yy" // lalr1.cc:847
791 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);903 { (yylhs.value.expr) = new VerifyTAPN::AST::DeadlockExpression(); }
792904#line 905 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
793 yypop_ (yylen);905 break;
794 yylen = 0;906
795 YY_STACK_PRINT ();907
796908#line 909 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:847
797 yysemantic_stack_.push (yyval);909 default:
798 yylocation_stack_.push (yyloc);910 break;
799911 }
800 /* Shift the result of the reduction. */912 }
801 yyn = yyr1_[yyn];913 catch (const syntax_error& yyexc)
802 yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];914 {
803 if (0 <= yystate && yystate <= yylast_915 error (yyexc);
804 && yycheck_[yystate] == yystate_stack_[0])916 YYERROR;
805 yystate = yytable_[yystate];917 }
806 else918 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
807 yystate = yydefgoto_[yyn - yyntokens_];919 yypop_ (yylen);
920 yylen = 0;
921 YY_STACK_PRINT ();
922
923 // Shift the result of the reduction.
924 yypush_ (YY_NULLPTR, yylhs);
925 }
808 goto yynewstate;926 goto yynewstate;
809927
810 /*------------------------------------.928 /*--------------------------------------.
811 | yyerrlab -- here on detecting error |929 | yyerrlab -- here on detecting error. |
812 `------------------------------------*/930 `--------------------------------------*/
813 yyerrlab:931 yyerrlab:
814 /* If not already recovering from an error, report this error. */932 // If not already recovering from an error, report this error.
815 if (!yyerrstatus_)933 if (!yyerrstatus_)
816 {934 {
817 ++yynerrs_;935 ++yynerrs_;
818 error (yylloc, yysyntax_error_ (yystate, yytoken));936 error (yyla.location, yysyntax_error_ (yystack_[0].state,
937 yyempty ? yyempty_ : yyla.type_get ()));
819 }938 }
820939
821 yyerror_range[0] = yylloc;940
941 yyerror_range[1].location = yyla.location;
822 if (yyerrstatus_ == 3)942 if (yyerrstatus_ == 3)
823 {943 {
824 /* If just tried and failed to reuse lookahead token after an944 /* If just tried and failed to reuse lookahead token after an
825 error, discard it. */945 error, discard it. */
826946
827 if (yychar <= yyeof_)947 // Return failure if at end of input.
828 {948 if (yyla.type_get () == yyeof_)
829 /* Return failure if at end of input. */949 YYABORT;
830 if (yychar == yyeof_)950 else if (!yyempty)
831 YYABORT;951 {
832 }952 yy_destroy_ ("Error: discarding", yyla);
833 else953 yyempty = true;
834 {954 }
835 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
836 yychar = yyempty_;
837 }
838 }955 }
839956
840 /* Else will try to reuse lookahead token after shifting the error957 // Else will try to reuse lookahead token after shifting the error token.
841 token. */
842 goto yyerrlab1;958 goto yyerrlab1;
843959
844960
@@ -852,311 +968,318 @@
852 code. */968 code. */
853 if (false)969 if (false)
854 goto yyerrorlab;970 goto yyerrorlab;
855971 yyerror_range[1].location = yystack_[yylen - 1].location;
856 yyerror_range[0] = yylocation_stack_[yylen - 1];972 /* Do not reclaim the symbols of the rule whose action triggered
857 /* Do not reclaim the symbols of the rule which action triggered
858 this YYERROR. */973 this YYERROR. */
859 yypop_ (yylen);974 yypop_ (yylen);
860 yylen = 0;975 yylen = 0;
861 yystate = yystate_stack_[0];
862 goto yyerrlab1;976 goto yyerrlab1;
863977
864 /*-------------------------------------------------------------.978 /*-------------------------------------------------------------.
865 | yyerrlab1 -- common code for both syntax error and YYERROR. |979 | yyerrlab1 -- common code for both syntax error and YYERROR. |
866 `-------------------------------------------------------------*/980 `-------------------------------------------------------------*/
867 yyerrlab1:981 yyerrlab1:
868 yyerrstatus_ = 3; /* Each real token shifted decrements this. */982 yyerrstatus_ = 3; // Each real token shifted decrements this.
869983 {
870 for (;;)984 stack_symbol_type error_token;
871 {985 for (;;)
872 yyn = yypact_[yystate];986 {
873 if (yyn != yypact_ninf_)987 yyn = yypact_[yystack_[0].state];
874 {988 if (!yy_pact_value_is_default_ (yyn))
875 yyn += yyterror_;989 {
876 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)990 yyn += yyterror_;
877 {991 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
878 yyn = yytable_[yyn];992 {
879 if (0 < yyn)993 yyn = yytable_[yyn];
880 break;994 if (0 < yyn)
881 }995 break;
882 }996 }
883997 }
884 /* Pop the current state because it cannot handle the error token. */998
885 if (yystate_stack_.height () == 1)999 // Pop the current state because it cannot handle the error token.
886 YYABORT;1000 if (yystack_.size () == 1)
8871001 YYABORT;
888 yyerror_range[0] = yylocation_stack_[0];1002
889 yydestruct_ ("Error: popping",1003 yyerror_range[1].location = yystack_[0].location;
890 yystos_[yystate],1004 yy_destroy_ ("Error: popping", yystack_[0]);
891 &yysemantic_stack_[0], &yylocation_stack_[0]);1005 yypop_ ();
892 yypop_ ();1006 YY_STACK_PRINT ();
893 yystate = yystate_stack_[0];1007 }
894 YY_STACK_PRINT ();1008
895 }1009 yyerror_range[2].location = yyla.location;
8961010 YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
897 yyerror_range[1] = yylloc;1011
898 // Using YYLLOC is tempting, but would change the location of1012 // Shift the error token.
899 // the lookahead. YYLOC is available though.1013 error_token.state = yyn;
900 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);1014 yypush_ ("Shifting", error_token);
901 yysemantic_stack_.push (yylval);1015 }
902 yylocation_stack_.push (yyloc);
903
904 /* Shift the error token. */
905 YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
906 &yysemantic_stack_[0], &yylocation_stack_[0]);
907
908 yystate = yyn;
909 goto yynewstate;1016 goto yynewstate;
9101017
911 /* Accept. */1018 // Accept.
912 yyacceptlab:1019 yyacceptlab:
913 yyresult = 0;1020 yyresult = 0;
914 goto yyreturn;1021 goto yyreturn;
9151022
916 /* Abort. */1023 // Abort.
917 yyabortlab:1024 yyabortlab:
918 yyresult = 1;1025 yyresult = 1;
919 goto yyreturn;1026 goto yyreturn;
9201027
921 yyreturn:1028 yyreturn:
922 if (yychar != yyempty_)1029 if (!yyempty)
923 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);1030 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
9241031
925 /* Do not reclaim the symbols of the rule which action triggered1032 /* Do not reclaim the symbols of the rule whose action triggered
926 this YYABORT or YYACCEPT. */1033 this YYABORT or YYACCEPT. */
927 yypop_ (yylen);1034 yypop_ (yylen);
928 while (yystate_stack_.height () != 1)1035 while (1 < yystack_.size ())
929 {1036 {
930 yydestruct_ ("Cleanup: popping",1037 yy_destroy_ ("Cleanup: popping", yystack_[0]);
931 yystos_[yystate_stack_[0]],1038 yypop_ ();
932 &yysemantic_stack_[0],
933 &yylocation_stack_[0]);
934 yypop_ ();
935 }1039 }
9361040
937 return yyresult;1041 return yyresult;
938 }1042 }
1043 catch (...)
1044 {
1045 YYCDEBUG << "Exception caught: cleaning lookahead and stack"
1046 << std::endl;
1047 // Do not try to display the values of the reclaimed symbols,
1048 // as their printer might throw an exception.
1049 if (!yyempty)
1050 yy_destroy_ (YY_NULLPTR, yyla);
1051
1052 while (1 < yystack_.size ())
1053 {
1054 yy_destroy_ (YY_NULLPTR, yystack_[0]);
1055 yypop_ ();
1056 }
1057 throw;
1058 }
1059 }
1060
1061 void
1062 Parser::error (const syntax_error& yyexc)
1063 {
1064 error (yyexc.location, yyexc.what());
1065 }
9391066
940 // Generate an error message.1067 // Generate an error message.
941 std::string1068 std::string
942 Parser::yysyntax_error_ (int yystate, int tok)1069 Parser::yysyntax_error_ (state_type yystate, symbol_number_type yytoken) const
943 {1070 {
944 std::string res;1071 std::string yyres;
945 YYUSE (yystate);1072 // Number of reported tokens (one for the "unexpected", one per
946#if YYERROR_VERBOSE1073 // "expected").
947 int yyn = yypact_[yystate];1074 size_t yycount = 0;
948 if (yypact_ninf_ < yyn && yyn <= yylast_)1075 // Its maximum.
949 {1076 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
950 /* Start YYX at -YYN if negative to avoid negative indexes in1077 // Arguments of yyformat.
951 YYCHECK. */1078 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
952 int yyxbegin = yyn < 0 ? -yyn : 0;1079
9531080 /* There are many possibilities here to consider:
954 /* Stay within bounds of both yycheck and yytname. */1081 - If this state is a consistent state with a default action, then
955 int yychecklim = yylast_ - yyn + 1;1082 the only way this function was invoked is if the default action
956 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;1083 is an error action. In that case, don't check for expected
957 int count = 0;1084 tokens because there are none.
958 for (int x = yyxbegin; x < yyxend; ++x)1085 - The only way there can be no lookahead present (in yytoken) is
959 if (yycheck_[x + yyn] == x && x != yyterror_)1086 if this state is a consistent state with a default action.
960 ++count;1087 Thus, detecting the absence of a lookahead is sufficient to
9611088 determine that there is no unexpected or expected token to
962 // FIXME: This method of building the message is not compatible1089 report. In that case, just report a simple "syntax error".
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
964 // That is, first build a string that looks like this:1091 a consistent state with a default action. There might have
965 // "syntax error, unexpected %s or %s or %s"1092 been a previous inconsistent state, consistent state with a
966 // Then, invoke YY_ on this string.1093 non-default action, or user semantic action that manipulated
967 // Finally, use the string as a format to output1094 yyla. (However, yyla is currently not documented for users.)
968 // yytname_[tok], etc.1095 - Of course, the expected token list depends on states to have
969 // Until this gets fixed, this message appears in English only.1096 correct lookahead information, and it depends on the parser not
970 res = "syntax error, unexpected ";1097 to perform extra reductions after fetching a lookahead from the
971 res += yytnamerr_ (yytname_[tok]);1098 scanner and before detecting a syntax error. Thus, state
972 if (count < 5)1099 merging (from LALR or IELR) and default reductions corrupt the
973 {1100 expected token list. However, the list is correct for
974 count = 0;1101 canonical LR with one exception: it will still contain any
975 for (int x = yyxbegin; x < yyxend; ++x)1102 token that will not be accepted due to an error action in a
976 if (yycheck_[x + yyn] == x && x != yyterror_)1103 later state.
977 {1104 */
978 res += (!count++) ? ", expecting " : " or ";1105 if (yytoken != yyempty_)
979 res += yytnamerr_ (yytname_[x]);1106 {
980 }1107 yyarg[yycount++] = yytname_[yytoken];
981 }1108 int yyn = yypact_[yystate];
982 }1109 if (!yy_pact_value_is_default_ (yyn))
983 else1110 {
984#endif1111 /* Start YYX at -YYN if negative to avoid negative indexes in
985 res = YY_("syntax error");1112 YYCHECK. In other words, skip the first -YYN actions for
986 return res;1113 this state because they are default actions. */
1114 int yyxbegin = yyn < 0 ? -yyn : 0;
1115 // Stay within bounds of both yycheck and yytname.
1116 int yychecklim = yylast_ - yyn + 1;
1117 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1118 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1119 if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
1120 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1121 {
1122 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1123 {
1124 yycount = 1;
1125 break;
1126 }
1127 else
1128 yyarg[yycount++] = yytname_[yyx];
1129 }
1130 }
1131 }
1132
1133 char const* yyformat = YY_NULLPTR;
1134 switch (yycount)
1135 {
1136#define YYCASE_(N, S) \
1137 case N: \
1138 yyformat = S; \
1139 break
1140 YYCASE_(0, YY_("syntax error"));
1141 YYCASE_(1, YY_("syntax error, unexpected %s"));
1142 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1143 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1144 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1145 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1146#undef YYCASE_
1147 }
1148
1149 // Argument number.
1150 size_t yyi = 0;
1151 for (char const* yyp = yyformat; *yyp; ++yyp)
1152 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
1153 {
1154 yyres += yytnamerr_ (yyarg[yyi++]);
1155 ++yyp;
1156 }
1157 else
1158 yyres += *yyp;
1159 return yyres;
987 }1160 }
9881161
9891162
990 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing1163 const signed char Parser::yypact_ninf_ = -11;
991 STATE-NUM. */1164
992 const signed char Parser::yypact_ninf_ = -29;1165 const signed char Parser::yytable_ninf_ = -1;
1166
993 const signed char1167 const signed char
994 Parser::yypact_[] =1168 Parser::yypact_[] =
995 {1169 {
996 46, -1, -1, -1, -1, 7, -29, -29, -1, 9,1170 49, 2, 2, 2, 2, 22, 16, -11, -11, 2,
997 -29, -29, -29, 25, -2, 43, 14, -29, -29, -29,1171 11, -11, -11, -11, 4, -9, 48, 19, -11, -11,
998 -29, -29, -29, -29, -2, -2, -2, -29, -6, 38,1172 -11, -11, -11, -11, -11, -9, -9, -9, 9, -11,
999 -1, -29, 18, 14, -1, -1, -29, -29, -29, -29,1173 25, 26, 2, -11, 3, 19, 2, 2, -11, -11,
1000 -29, 25, 25, 18, 25, -29, -29, 40, -5, -29,1174 -11, -11, -11, 4, 4, 3, 4, 2, 2, -11,
1001 14, 14, 3, -291175 -11, 33, 29, -11, 19, 19, -10, -11, -9, -9
1002 };1176 };
10031177
1004 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
1005 doesn't specify something else to do. Zero means the default is an
1006 error. */
1007 const unsigned char1178 const unsigned char
1008 Parser::yydefact_[] =1179 Parser::yydefact_[] =
1009 {1180 {
1010 0, 0, 0, 0, 0, 0, 20, 19, 0, 0,1181 0, 0, 0, 0, 0, 0, 0, 22, 21, 0,
1011 25, 26, 28, 0, 2, 0, 15, 17, 6, 7,1182 0, 27, 28, 30, 0, 2, 0, 17, 19, 8,
1012 8, 9, 11, 10, 3, 5, 4, 1, 0, 0,1183 9, 10, 11, 13, 12, 3, 5, 4, 0, 1,
1013 0, 22, 0, 14, 0, 0, 29, 30, 31, 32,1184 0, 0, 0, 24, 0, 16, 0, 0, 31, 32,
1014 33, 0, 0, 0, 0, 21, 18, 0, 23, 24,1185 33, 34, 35, 0, 0, 0, 0, 0, 0, 23,
1015 12, 13, 27, 161186 20, 0, 25, 26, 14, 15, 29, 18, 7, 6
1016 };1187 };
10171188
1018 /* YYPGOTO[NTERM-NUM]. */
1019 const signed char1189 const signed char
1020 Parser::yypgoto_[] =1190 Parser::yypgoto_[] =
1021 {1191 {
1022 -29, -29, 2, -8, -12, -28, 22, -29, -29, -29,1192 -11, -11, -1, -5, -6, 18, 55, -11, -11, -11,
1023 -29, -29, -291193 -11, -11, -11
1024 };1194 };
10251195
1026 /* YYDEFGOTO[NTERM-NUM]. */
1027 const signed char1196 const signed char
1028 Parser::yydefgoto_[] =1197 Parser::yydefgoto_[] =
1029 {1198 {
1030 -1, 5, 28, 15, 16, 17, 18, 19, 20, 21,1199 -1, 6, 30, 16, 17, 18, 19, 20, 21, 22,
1031 22, 23, 431200 23, 24, 45
1032 };1201 };
10331202
1034 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1035 positive, shift that token. If negative, reduce the rule which
1036 number is the opposite. If zero, do what YYDEFACT says. */
1037 const signed char Parser::yytable_ninf_ = -1;
1038 const unsigned char1203 const unsigned char
1039 Parser::yytable_[] =1204 Parser::yytable_[] =
1040 {1205 {
1041 29, 33, 6, 14, 24, 25, 26, 27, 7, 45,1206 15, 25, 26, 27, 31, 7, 7, 7, 35, 36,
1042 34, 35, 35, 8, 34, 35, 53, 9, 10, 11,1207 37, 8, 8, 8, 43, 44, 29, 9, 34, 34,
1043 12, 6, 13, 30, 47, 41, 42, 7, 6, 50,1208 47, 48, 10, 11, 12, 13, 32, 14, 14, 51,
1044 51, 31, 32, 0, 7, 52, 48, 49, 44, 32,1209 38, 39, 40, 41, 42, 52, 53, 54, 55, 28,
1045 0, 13, 36, 37, 38, 39, 40, 36, 37, 38,1210 56, 49, 50, 36, 37, 46, 58, 59, 37, 50,
1046 39, 40, 0, 46, 0, 46, 1, 2, 3, 4,1211 43, 44, 38, 39, 40, 41, 42, 43, 44, 1,
1047 41, 42, 41, 42, 0, 41, 421212 2, 3, 4, 5, 57, 33, 0, 0, 0, 0,
1213 0, 0, 43, 44
1048 };1214 };
10491215
1050 /* YYCHECK. */
1051 const signed char1216 const signed char
1052 Parser::yycheck_[] =1217 Parser::yycheck_[] =
1053 {1218 {
1054 8, 13, 3, 1, 2, 3, 4, 0, 9, 15,1219 1, 2, 3, 4, 9, 3, 3, 3, 14, 18,
1055 16, 17, 17, 14, 16, 17, 44, 18, 19, 20,1220 19, 9, 9, 9, 24, 25, 0, 15, 15, 15,
1056 21, 3, 23, 14, 32, 22, 23, 9, 3, 41,1221 11, 12, 20, 21, 22, 23, 15, 25, 25, 34,
1057 42, 9, 14, -1, 9, 43, 34, 35, 24, 14,1222 4, 5, 6, 7, 8, 36, 37, 43, 44, 17,
1058 -1, 23, 4, 5, 6, 7, 8, 4, 5, 6,1223 45, 16, 16, 18, 19, 26, 47, 48, 19, 16,
1059 7, 8, -1, 15, -1, 15, 10, 11, 12, 13,1224 24, 25, 4, 5, 6, 7, 8, 24, 25, 10,
1060 22, 23, 22, 23, -1, 22, 231225 11, 12, 13, 14, 46, 10, -1, -1, -1, -1,
1226 -1, -1, 24, 25
1061 };1227 };
10621228
1063 /* STOS_[STATE-NUM] -- The (internal number of the) accessing
1064 symbol of state STATE-NUM. */
1065 const unsigned char1229 const unsigned char
1066 Parser::yystos_[] =1230 Parser::yystos_[] =
1067 {1231 {
1068 0, 10, 11, 12, 13, 26, 3, 9, 14, 18,1232 0, 10, 11, 12, 13, 14, 28, 3, 9, 15,
1069 19, 20, 21, 23, 27, 28, 29, 30, 31, 32,1233 20, 21, 22, 23, 25, 29, 30, 31, 32, 33,
1070 33, 34, 35, 36, 27, 27, 27, 0, 27, 28,1234 34, 35, 36, 37, 38, 29, 29, 29, 17, 0,
1071 14, 31, 14, 29, 16, 17, 4, 5, 6, 7,1235 29, 30, 15, 33, 15, 31, 18, 19, 4, 5,
1072 8, 22, 23, 37, 24, 15, 15, 28, 27, 27,1236 6, 7, 8, 24, 25, 39, 26, 11, 12, 16,
1073 29, 29, 28, 301237 16, 30, 29, 29, 31, 31, 30, 32, 29, 29
1074 };1238 };
10751239
1076#if YYDEBUG
1077 /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
1078 to YYLEX-NUM. */
1079 const unsigned short int
1080 Parser::yytoken_number_[] =
1081 {
1082 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1083 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1084 275, 276, 277, 278, 279
1085 };
1086#endif
1087
1088 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1089 const unsigned char1240 const unsigned char
1090 Parser::yyr1_[] =1241 Parser::yyr1_[] =
1091 {1242 {
1092 0, 25, 26, 26, 26, 26, 27, 27, 27, 27,1243 0, 27, 28, 28, 28, 28, 28, 28, 29, 29,
1093 27, 27, 28, 28, 28, 28, 29, 29, 30, 30,1244 29, 29, 29, 29, 30, 30, 30, 30, 31, 31,
1094 30, 31, 32, 33, 34, 35, 35, 36, 36, 37,1245 32, 32, 32, 33, 34, 35, 36, 37, 37, 38,
1095 37, 37, 37, 371246 38, 39, 39, 39, 39, 39
1096 };1247 };
10971248
1098 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1099 const unsigned char1249 const unsigned char
1100 Parser::yyr2_[] =1250 Parser::yyr2_[] =
1101 {1251 {
1102 0, 2, 2, 2, 2, 2, 1, 1, 1, 1,1252 0, 2, 2, 2, 2, 2, 4, 4, 1, 1,
1103 1, 1, 3, 3, 2, 1, 3, 1, 3, 1,1253 1, 1, 1, 1, 3, 3, 2, 1, 3, 1,
1104 1, 3, 2, 3, 3, 1, 1, 3, 1, 1,1254 3, 1, 1, 3, 2, 3, 3, 1, 1, 3,
1105 1, 1, 1, 11255 1, 1, 1, 1, 1, 1
1106 };1256 };
11071257
1108#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE1258
1109 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.1259
1110 First, the terminals, then, starting at \a yyntokens_, nonterminals. */1260 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1261 // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1111 const char*1262 const char*
1112 const Parser::yytname_[] =1263 const Parser::yytname_[] =
1113 {1264 {
1114 "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL",1265 "END", "error", "$undefined", "IDENTIFIER", "LESS", "LESSEQUAL",
1115 "EQUAL", "GREATEREQUAL", "GREATER", "NUMBER", "EF", "AG", "AF", "EG",1266 "EQUAL", "GREATEREQUAL", "GREATER", "NUMBER", "EF", "AG", "AF", "EG",
1116 "LPARAN", "RPARAN", "OR", "AND", "NOT", "BOOL_TRUE", "BOOL_FALSE",1267 "CONTROL", "LPARAN", "RPARAN", "COLON", "OR", "AND", "NOT", "BOOL_TRUE",
1117 "DEADLOCK", "PLUS", "MINUS", "MULTIPLY", "$accept", "query",1268 "BOOL_FALSE", "DEADLOCK", "PLUS", "MINUS", "MULTIPLY", "$accept",
1118 "expression", "arithmeticExpression", "multiplyExpression",1269 "query", "expression", "arithmeticExpression", "multiplyExpression",
1119 "arithmeticParantheses", "parExpression", "notExpression",1270 "arithmeticParantheses", "parExpression", "notExpression",
1120 "orExpression", "andExpression", "boolExpression", "atomicProposition",1271 "orExpression", "andExpression", "boolExpression", "atomicProposition",
1121 "compareOp", 01272 "compareOp", YY_NULLPTR
1122 };1273 };
1123#endif
11241274
1125#if YYDEBUG1275#if YYDEBUG
1126 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1127 const Parser::rhs_number_type
1128 Parser::yyrhs_[] =
1129 {
1130 26, 0, -1, 10, 27, -1, 11, 27, -1, 13,
1131 27, -1, 12, 27, -1, 31, -1, 32, -1, 33,
1132 -1, 34, -1, 36, -1, 35, -1, 28, 22, 29,
1133 -1, 28, 23, 29, -1, 23, 29, -1, 29, -1,
1134 29, 24, 30, -1, 30, -1, 14, 28, 15, -1,
1135 9, -1, 3, -1, 14, 27, 15, -1, 18, 31,
1136 -1, 27, 16, 27, -1, 27, 17, 27, -1, 19,
1137 -1, 20, -1, 28, 37, 28, -1, 21, -1, 4,
1138 -1, 5, -1, 6, -1, 7, -1, 8, -1
1139 };
1140
1141 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1142 YYRHS. */
1143 const unsigned char
1144 Parser::yyprhs_[] =
1145 {
1146 0, 0, 3, 6, 9, 12, 15, 17, 19, 21,
1147 23, 25, 27, 31, 35, 38, 40, 44, 46, 50,
1148 52, 54, 58, 61, 65, 69, 71, 73, 77, 79,
1149 81, 83, 85, 87
1150 };
1151
1152 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1153 const unsigned char1276 const unsigned char
1154 Parser::yyrline_[] =1277 Parser::yyrline_[] =
1155 {1278 {
1156 0, 62, 62, 63, 64, 65, 68, 69, 70, 71,1279 0, 62, 62, 63, 64, 65, 66, 67, 70, 71,
1157 72, 73, 79, 80, 81, 82, 85, 86, 89, 90,1280 72, 73, 74, 75, 81, 82, 83, 84, 87, 88,
1158 91, 99, 100, 101, 102, 103, 104, 106, 107, 109,1281 91, 92, 93, 101, 102, 103, 104, 105, 106, 108,
1159 109, 109, 109, 1091282 109, 111, 111, 111, 111, 111
1160 };1283 };
11611284
1162 // Print the state stack on the debug stream.1285 // Print the state stack on the debug stream.
@@ -1164,9 +1287,11 @@
1164 Parser::yystack_print_ ()1287 Parser::yystack_print_ ()
1165 {1288 {
1166 *yycdebug_ << "Stack now";1289 *yycdebug_ << "Stack now";
1167 for (state_stack_type::const_iterator i = yystate_stack_.begin ();1290 for (stack_type::const_iterator
1168 i != yystate_stack_.end (); ++i)1291 i = yystack_.begin (),
1169 *yycdebug_ << ' ' << *i;1292 i_end = yystack_.end ();
1293 i != i_end; ++i)
1294 *yycdebug_ << ' ' << i->state;
1170 *yycdebug_ << std::endl;1295 *yycdebug_ << std::endl;
1171 }1296 }
11721297
@@ -1176,19 +1301,18 @@
1176 {1301 {
1177 unsigned int yylno = yyrline_[yyrule];1302 unsigned int yylno = yyrline_[yyrule];
1178 int yynrhs = yyr2_[yyrule];1303 int yynrhs = yyr2_[yyrule];
1179 /* Print the symbols being reduced, and their result. */1304 // Print the symbols being reduced, and their result.
1180 *yycdebug_ << "Reducing stack by rule " << yyrule - 11305 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1181 << " (line " << yylno << "):" << std::endl;1306 << " (line " << yylno << "):" << std::endl;
1182 /* The symbols being reduced. */1307 // The symbols being reduced.
1183 for (int yyi = 0; yyi < yynrhs; yyi++)1308 for (int yyi = 0; yyi < yynrhs; yyi++)
1184 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",1309 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1185 yyrhs_[yyprhs_[yyrule] + yyi],1310 yystack_[(yynrhs) - (yyi + 1)]);
1186 &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
1187 &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
1188 }1311 }
1189#endif // YYDEBUG1312#endif // YYDEBUG
11901313
1191 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */1314 // Symbol number corresponding to token number t.
1315 inline
1192 Parser::token_number_type1316 Parser::token_number_type
1193 Parser::yytranslate_ (int t)1317 Parser::yytranslate_ (int t)
1194 {1318 {
@@ -1196,7 +1320,7 @@
1196 const token_number_type1320 const token_number_type
1197 translate_table[] =1321 translate_table[] =
1198 {1322 {
1199 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,1323 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1324 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1201 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1325 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1326 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -1223,37 +1347,24 @@
1223 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1347 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1224 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,1348 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1225 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,1349 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1226 15, 16, 17, 18, 19, 20, 21, 22, 23, 241350 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1351 25, 26
1227 };1352 };
1228 if ((unsigned int) t <= yyuser_token_number_max_)1353 const unsigned int user_token_number_max_ = 281;
1354 const token_number_type undef_token_ = 2;
1355
1356 if (static_cast<int>(t) <= yyeof_)
1357 return yyeof_;
1358 else if (static_cast<unsigned int> (t) <= user_token_number_max_)
1229 return translate_table[t];1359 return translate_table[t];
1230 else1360 else
1231 return yyundef_token_;1361 return undef_token_;
1232 }1362 }
12331363
1234 const int Parser::yyeof_ = 0;1364#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:1155
1235 const int Parser::yylast_ = 66;
1236 const int Parser::yynnts_ = 13;
1237 const int Parser::yyempty_ = -2;
1238 const int Parser::yyfinal_ = 27;
1239 const int Parser::yyterror_ = 1;
1240 const int Parser::yyerrcode_ = 256;
1241 const int Parser::yyntokens_ = 25;
1242
1243 const unsigned int Parser::yyuser_token_number_max_ = 279;
1244 const Parser::token_number_type Parser::yyundef_token_ = 2;
1245
1246
1247/* Line 1054 of lalr1.cc */
1248#line 5 "src/Core/QueryParser/grammar.yy"
1249} // VerifyTAPN1365} // VerifyTAPN
12501366#line 1367 "src/Core/QueryParser/Generated/parser.cpp" // lalr1.cc:1155
1251/* Line 1054 of lalr1.cc */1367#line 113 "src/Core/QueryParser/grammar.yy" // lalr1.cc:1156
1252#line 1253 "src/Core/QueryParser/Generated/parser.cpp"
1253
1254
1255/* Line 1056 of lalr1.cc */
1256#line 111 "src/Core/QueryParser/grammar.yy"
12571368
12581369
1259void 1370void
@@ -1263,4 +1374,3 @@
1263 driver.error (l, m);1374 driver.error (l, m);
1264 exit(1);1375 exit(1);
1265}1376}
1266
12671377
=== modified file 'src/Core/QueryParser/Generated/parser.hpp'
--- src/Core/QueryParser/Generated/parser.hpp 2014-08-07 20:48:41 +0000
+++ src/Core/QueryParser/Generated/parser.hpp 2018-01-07 20:09:44 +0000
@@ -1,46 +1,46 @@
11// A Bison parser, made by GNU Bison 3.0.2.
2/* A Bison parser, made by GNU Bison 2.4.1. */2
33// Skeleton interface for Bison LALR(1) parsers in C++
4/* Skeleton interface for Bison LALR(1) parsers in C++4
5 5// Copyright (C) 2002-2013 Free Software Foundation, Inc.
6 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software6
7 Foundation, Inc.7// This program is free software: you can redistribute it and/or modify
8 8// it under the terms of the GNU General Public License as published by
9 This program is free software: you can redistribute it and/or modify9// the Free Software Foundation, either version 3 of the License, or
10 it under the terms of the GNU General Public License as published by10// (at your option) any later version.
11 the Free Software Foundation, either version 3 of the License, or11
12 (at your option) any later version.12// This program is distributed in the hope that it will be useful,
13 13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 This program is distributed in the hope that it will be useful,14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 but WITHOUT ANY WARRANTY; without even the implied warranty of15// GNU General Public License for more details.
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16
17 GNU General Public License for more details.17// You should have received a copy of the GNU General Public License
18 18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19 You should have received a copy of the GNU General Public License19
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
2121// part or all of the Bison parser skeleton and distribute that work
22/* As a special exception, you may create a larger work that contains22// under terms of your choice, so long as that work isn't itself a
23 part or all of the Bison parser skeleton and distribute that work23// parser generator using the skeleton or a modified version thereof
24 under terms of your choice, so long as that work isn't itself a24// as a parser skeleton. Alternatively, if you modify or redistribute
25 parser generator using the skeleton or a modified version thereof25// the parser skeleton itself, you may (at your option) remove this
26 as a parser skeleton. Alternatively, if you modify or redistribute26// special exception, which will cause the skeleton and the resulting
27 the parser skeleton itself, you may (at your option) remove this27// Bison output files to be licensed under the GNU General Public
28 special exception, which will cause the skeleton and the resulting28// License without this special exception.
29 Bison output files to be licensed under the GNU General Public29
30 License without this special exception.30// This special exception was added by the Free Software Foundation in
31 31// version 2.2 of Bison.
32 This special exception was added by the Free Software Foundation in32
33 version 2.2 of Bison. */33/**
3434 ** \file src/Core/QueryParser/Generated/parser.hpp
35/* C++ LALR(1) parser skeleton written by Akim Demaille. */35 ** Define the VerifyTAPN::parser class.
3636 */
37#ifndef PARSER_HEADER_H37
38# define PARSER_HEADER_H38// C++ LALR(1) parser skeleton written by Akim Demaille.
3939
40/* "%code requires" blocks. */40#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED
4141# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED
42/* Line 300 of lalr1.cc */42// // "%code requires" blocks.
43#line 7 "src/Core/QueryParser/grammar.yy"43#line 7 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372
4444
45# include <string>45# include <string>
46#include "../AST.hpp"46#include "../AST.hpp"
@@ -48,91 +48,92 @@
48 class TAPNQueryParser;48 class TAPNQueryParser;
49}49}
5050
5151#line 52 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372
5252
53/* Line 300 of lalr1.cc */53
54#line 55 "src/Core/QueryParser/Generated/parser.hpp"54# include <vector>
5555# include <iostream>
5656# include <stdexcept>
57#include <string>57# include <string>
58#include <iostream>58# include "stack.hh"
59#include "stack.hh"59# include "location.hh"
6060
6161
62/* Line 300 of lalr1.cc */62#ifndef YY_ATTRIBUTE
63#line 5 "src/Core/QueryParser/grammar.yy"63# if (defined __GNUC__ \
64namespace VerifyTAPN {64 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
6565 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
66/* Line 300 of lalr1.cc */66# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
67#line 68 "src/Core/QueryParser/Generated/parser.hpp"67# else
68 class position;68# define YY_ATTRIBUTE(Spec) /* empty */
69 class location;69# endif
7070#endif
71/* Line 300 of lalr1.cc */71
72#line 5 "src/Core/QueryParser/grammar.yy"72#ifndef YY_ATTRIBUTE_PURE
73} // VerifyTAPN73# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
7474#endif
75/* Line 300 of lalr1.cc */75
76#line 77 "src/Core/QueryParser/Generated/parser.hpp"76#ifndef YY_ATTRIBUTE_UNUSED
7777# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
78#include "location.hh"78#endif
7979
80/* Enabling traces. */80#if !defined _Noreturn \
81 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
82# if defined _MSC_VER && 1200 <= _MSC_VER
83# define _Noreturn __declspec (noreturn)
84# else
85# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
86# endif
87#endif
88
89/* Suppress unused-variable warnings by "using" E. */
90#if ! defined lint || defined __GNUC__
91# define YYUSE(E) ((void) (E))
92#else
93# define YYUSE(E) /* empty */
94#endif
95
96#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
97/* Suppress an incorrect diagnostic about yylval being uninitialized. */
98# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
99 _Pragma ("GCC diagnostic push") \
100 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
101 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
102# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
103 _Pragma ("GCC diagnostic pop")
104#else
105# define YY_INITIAL_VALUE(Value) Value
106#endif
107#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
108# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
109# define YY_IGNORE_MAYBE_UNINITIALIZED_END
110#endif
111#ifndef YY_INITIAL_VALUE
112# define YY_INITIAL_VALUE(Value) /* Nothing. */
113#endif
114
115/* Debug traces. */
81#ifndef YYDEBUG116#ifndef YYDEBUG
82# define YYDEBUG 0117# define YYDEBUG 0
83#endif118#endif
84119
85/* Enabling verbose error messages. */120#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372
86#ifdef YYERROR_VERBOSE
87# undef YYERROR_VERBOSE
88# define YYERROR_VERBOSE 1
89#else
90# define YYERROR_VERBOSE 1
91#endif
92
93/* Enabling the token table. */
94#ifndef YYTOKEN_TABLE
95# define YYTOKEN_TABLE 0
96#endif
97
98/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
99 If N is 0, then set CURRENT to the empty location which ends
100 the previous symbol: RHS[0] (always defined). */
101
102#ifndef YYLLOC_DEFAULT
103# define YYLLOC_DEFAULT(Current, Rhs, N) \
104do { \
105 if (N) \
106 { \
107 (Current).begin = (Rhs)[1].begin; \
108 (Current).end = (Rhs)[N].end; \
109 } \
110 else \
111 { \
112 (Current).begin = (Current).end = (Rhs)[0].end; \
113 } \
114} while (false)
115#endif
116
117
118/* Line 300 of lalr1.cc */
119#line 5 "src/Core/QueryParser/grammar.yy"
120namespace VerifyTAPN {121namespace VerifyTAPN {
121122#line 123 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372
122/* Line 300 of lalr1.cc */123
123#line 124 "src/Core/QueryParser/Generated/parser.hpp"124
125
126
124127
125 /// A Bison parser.128 /// A Bison parser.
126 class Parser129 class Parser
127 {130 {
128 public:131 public:
132#ifndef YYSTYPE
129 /// Symbol semantic values.133 /// Symbol semantic values.
130#ifndef YYSTYPE
131 union semantic_type134 union semantic_type
132 {135 {
133136 #line 30 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372
134/* Line 300 of lalr1.cc */
135#line 30 "src/Core/QueryParser/grammar.yy"
136137
137 int number;138 int number;
138 std::string* string;139 std::string* string;
@@ -140,50 +141,142 @@
140 VerifyTAPN::AST::ArithmeticExpression* arexpr;141 VerifyTAPN::AST::ArithmeticExpression* arexpr;
141 VerifyTAPN::AST::Query* query;142 VerifyTAPN::AST::Query* query;
142143
143144#line 145 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372
144
145/* Line 300 of lalr1.cc */
146#line 147 "src/Core/QueryParser/Generated/parser.hpp"
147 };145 };
148#else146#else
149 typedef YYSTYPE semantic_type;147 typedef YYSTYPE semantic_type;
150#endif148#endif
151 /// Symbol locations.149 /// Symbol locations.
152 typedef location location_type;150 typedef location location_type;
151
152 /// Syntax errors thrown from user actions.
153 struct syntax_error : std::runtime_error
154 {
155 syntax_error (const location_type& l, const std::string& m);
156 location_type location;
157 };
158
153 /// Tokens.159 /// Tokens.
154 struct token160 struct token
155 {161 {
156 /* Tokens. */162 enum yytokentype
157 enum yytokentype {163 {
158 END = 0,164 END = 0,
159 IDENTIFIER = 258,165 IDENTIFIER = 258,
160 LESS = 259,166 LESS = 259,
161 LESSEQUAL = 260,167 LESSEQUAL = 260,
162 EQUAL = 261,168 EQUAL = 261,
163 GREATEREQUAL = 262,169 GREATEREQUAL = 262,
164 GREATER = 263,170 GREATER = 263,
165 NUMBER = 264,171 NUMBER = 264,
166 EF = 265,172 EF = 265,
167 AG = 266,173 AG = 266,
168 AF = 267,174 AF = 267,
169 EG = 268,175 EG = 268,
170 LPARAN = 269,176 CONTROL = 269,
171 RPARAN = 270,177 LPARAN = 270,
172 OR = 271,178 RPARAN = 271,
173 AND = 272,179 COLON = 272,
174 NOT = 273,180 OR = 273,
175 BOOL_TRUE = 274,181 AND = 274,
176 BOOL_FALSE = 275,182 NOT = 275,
177 DEADLOCK = 276,183 BOOL_TRUE = 276,
178 PLUS = 277,184 BOOL_FALSE = 277,
179 MINUS = 278,185 DEADLOCK = 278,
180 MULTIPLY = 279186 PLUS = 279,
181 };187 MINUS = 280,
188 MULTIPLY = 281
189 };
190 };
182191
183 };192 /// (External) token type, as returned by yylex.
184 /// Token type.
185 typedef token::yytokentype token_type;193 typedef token::yytokentype token_type;
186194
195 /// Internal symbol number.
196 typedef int symbol_number_type;
197
198 /// Internal symbol number for tokens (subsumed by symbol_number_type).
199 typedef unsigned char token_number_type;
200
201 /// A complete symbol.
202 ///
203 /// Expects its Base type to provide access to the symbol type
204 /// via type_get().
205 ///
206 /// Provide access to semantic value and location.
207 template <typename Base>
208 struct basic_symbol : Base
209 {
210 /// Alias to Base.
211 typedef Base super_type;
212
213 /// Default constructor.
214 basic_symbol ();
215
216 /// Copy constructor.
217 basic_symbol (const basic_symbol& other);
218
219 /// Constructor for valueless symbols.
220 basic_symbol (typename Base::kind_type t,
221 const location_type& l);
222
223 /// Constructor for symbols with semantic value.
224 basic_symbol (typename Base::kind_type t,
225 const semantic_type& v,
226 const location_type& l);
227
228 ~basic_symbol ();
229
230 /// Destructive move, \a s is emptied into this.
231 void move (basic_symbol& s);
232
233 /// The semantic value.
234 semantic_type value;
235
236 /// The location.
237 location_type location;
238
239 private:
240 /// Assignment operator.
241 basic_symbol& operator= (const basic_symbol& other);
242 };
243
244 /// Type access provider for token (enum) based symbols.
245 struct by_type
246 {
247 /// Default constructor.
248 by_type ();
249
250 /// Copy constructor.
251 by_type (const by_type& other);
252
253 /// The symbol type as needed by the constructor.
254 typedef token_type kind_type;
255
256 /// Constructor from (external) token numbers.
257 by_type (kind_type t);
258
259 /// Steal the symbol type from \a that.
260 void move (by_type& that);
261
262 /// The (internal) type number (corresponding to \a type).
263 /// -1 when this symbol is empty.
264 symbol_number_type type_get () const;
265
266 /// The token.
267 token_type token () const;
268
269 enum { empty = 0 };
270
271 /// The symbol type.
272 /// -1 when this symbol is empty.
273 token_number_type type;
274 };
275
276 /// "External" symbols: returned by the scanner.
277 typedef basic_symbol<by_type> symbol_type;
278
279
187 /// Build a parser object.280 /// Build a parser object.
188 Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg);281 Parser (VerifyTAPN::TAPNQueryParser& driver_yyarg);
189 virtual ~Parser ();282 virtual ~Parser ();
@@ -194,167 +287,215 @@
194287
195#if YYDEBUG288#if YYDEBUG
196 /// The current debugging stream.289 /// The current debugging stream.
197 std::ostream& debug_stream () const;290 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
198 /// Set the current debugging stream.291 /// Set the current debugging stream.
199 void set_debug_stream (std::ostream &);292 void set_debug_stream (std::ostream &);
200293
201 /// Type for debugging levels.294 /// Type for debugging levels.
202 typedef int debug_level_type;295 typedef int debug_level_type;
203 /// The current debugging level.296 /// The current debugging level.
204 debug_level_type debug_level () const;297 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
205 /// Set the current debugging level.298 /// Set the current debugging level.
206 void set_debug_level (debug_level_type l);299 void set_debug_level (debug_level_type l);
207#endif300#endif
208301
209 private:
210 /// Report a syntax error.302 /// Report a syntax error.
211 /// \param loc where the syntax error is found.303 /// \param loc where the syntax error is found.
212 /// \param msg a description of the syntax error.304 /// \param msg a description of the syntax error.
213 virtual void error (const location_type& loc, const std::string& msg);305 virtual void error (const location_type& loc, const std::string& msg);
214306
215 /// Generate an error message.307 /// Report a syntax error.
216 /// \param state the state where the error occurred.308 void error (const syntax_error& err);
217 /// \param tok the lookahead token.309
218 virtual std::string yysyntax_error_ (int yystate, int tok);310 private:
219311 /// This class is not copyable.
220#if YYDEBUG312 Parser (const Parser&);
221 /// \brief Report a symbol value on the debug stream.313 Parser& operator= (const Parser&);
222 /// \param yytype The token type.
223 /// \param yyvaluep Its semantic value.
224 /// \param yylocationp Its location.
225 virtual void yy_symbol_value_print_ (int yytype,
226 const semantic_type* yyvaluep,
227 const location_type* yylocationp);
228 /// \brief Report a symbol on the debug stream.
229 /// \param yytype The token type.
230 /// \param yyvaluep Its semantic value.
231 /// \param yylocationp Its location.
232 virtual void yy_symbol_print_ (int yytype,
233 const semantic_type* yyvaluep,
234 const location_type* yylocationp);
235#endif
236
237314
238 /// State numbers.315 /// State numbers.
239 typedef int state_type;316 typedef int state_type;
240 /// State stack type.317
241 typedef stack<state_type> state_stack_type;318 /// Generate an error message.
242 /// Semantic value stack type.319 /// \param yystate the state where the error occurred.
243 typedef stack<semantic_type> semantic_stack_type;320 /// \param yytoken the lookahead token type, or yyempty_.
244 /// location stack type.321 virtual std::string yysyntax_error_ (state_type yystate,
245 typedef stack<location_type> location_stack_type;322 symbol_number_type yytoken) const;
246323
247 /// The state stack.324 /// Compute post-reduction state.
248 state_stack_type yystate_stack_;325 /// \param yystate the current state
249 /// The semantic value stack.326 /// \param yysym the nonterminal to push on the stack
250 semantic_stack_type yysemantic_stack_;327 state_type yy_lr_goto_state_ (state_type yystate, int yysym);
251 /// The location stack.328
252 location_stack_type yylocation_stack_;329 /// Whether the given \c yypact_ value indicates a defaulted state.
253330 /// \param yyvalue the value to check
254 /// Internal symbol numbers.331 static bool yy_pact_value_is_default_ (int yyvalue);
255 typedef unsigned char token_number_type;332
256 /* Tables. */333 /// Whether the given \c yytable_ value indicates a syntax error.
257 /// For a state, the index in \a yytable_ of its portion.334 /// \param yyvalue the value to check
258 static const signed char yypact_[];335 static bool yy_table_value_is_error_ (int yyvalue);
336
259 static const signed char yypact_ninf_;337 static const signed char yypact_ninf_;
260
261 /// For a state, default rule to reduce.
262 /// Unless\a yytable_ specifies something else to do.
263 /// Zero means the default is an error.
264 static const unsigned char yydefact_[];
265
266 static const signed char yypgoto_[];
267 static const signed char yydefgoto_[];
268
269 /// What to do in a state.
270 /// \a yytable_[yypact_[s]]: what to do in state \a s.
271 /// - if positive, shift that token.
272 /// - if negative, reduce the rule which number is the opposite.
273 /// - if zero, do what YYDEFACT says.
274 static const unsigned char yytable_[];
275 static const signed char yytable_ninf_;338 static const signed char yytable_ninf_;
276339
277 static const signed char yycheck_[];340 /// Convert a scanner token number \a t to a symbol number.
278341 static token_number_type yytranslate_ (int t);
279 /// For a state, its accessing symbol.342
280 static const unsigned char yystos_[];343 // Tables.
281344 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
282 /// For a rule, its LHS.345 // STATE-NUM.
283 static const unsigned char yyr1_[];346 static const signed char yypact_[];
284 /// For a rule, its RHS length.347
285 static const unsigned char yyr2_[];348 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
286349 // Performed when YYTABLE does not specify something else to do. Zero
287#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE350 // means the default is an error.
351 static const unsigned char yydefact_[];
352
353 // YYPGOTO[NTERM-NUM].
354 static const signed char yypgoto_[];
355
356 // YYDEFGOTO[NTERM-NUM].
357 static const signed char yydefgoto_[];
358
359 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
360 // positive, shift that token. If negative, reduce the rule whose
361 // number is the opposite. If YYTABLE_NINF, syntax error.
362 static const unsigned char yytable_[];
363
364 static const signed char yycheck_[];
365
366 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
367 // symbol of state STATE-NUM.
368 static const unsigned char yystos_[];
369
370 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
371 static const unsigned char yyr1_[];
372
373 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
374 static const unsigned char yyr2_[];
375
376
377 /// Convert the symbol name \a n to a form suitable for a diagnostic.
378 static std::string yytnamerr_ (const char *n);
379
380
288 /// For a symbol, its name in clear.381 /// For a symbol, its name in clear.
289 static const char* const yytname_[];382 static const char* const yytname_[];
290#endif
291
292#if YYERROR_VERBOSE
293 /// Convert the symbol name \a n to a form suitable for a diagnostic.
294 virtual std::string yytnamerr_ (const char *n);
295#endif
296
297#if YYDEBUG383#if YYDEBUG
298 /// A type to store symbol numbers and -1.384 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
299 typedef signed char rhs_number_type;385 static const unsigned char yyrline_[];
300 /// A `-1'-separated list of the rules' RHS.
301 static const rhs_number_type yyrhs_[];
302 /// For each rule, the index of the first RHS symbol in \a yyrhs_.
303 static const unsigned char yyprhs_[];
304 /// For each rule, its source line number.
305 static const unsigned char yyrline_[];
306 /// For each scanner token number, its symbol number.
307 static const unsigned short int yytoken_number_[];
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.
309 virtual void yy_reduce_print_ (int r);387 virtual void yy_reduce_print_ (int r);
310 /// Print the state stack on the debug stream.388 /// Print the state stack on the debug stream.
311 virtual void yystack_print_ ();389 virtual void yystack_print_ ();
312390
313 /* Debugging. */391 // Debugging.
314 int yydebug_;392 int yydebug_;
315 std::ostream* yycdebug_;393 std::ostream* yycdebug_;
394
395 /// \brief Display a symbol type, value and location.
396 /// \param yyo The output stream.
397 /// \param yysym The symbol.
398 template <typename Base>
399 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
316#endif400#endif
317401
318 /// Convert a scanner token number \a t to a symbol number.
319 token_number_type yytranslate_ (int t);
320
321 /// \brief Reclaim the memory associated to a symbol.402 /// \brief Reclaim the memory associated to a symbol.
322 /// \param yymsg Why this token is reclaimed.403 /// \param yymsg Why this token is reclaimed.
323 /// \param yytype The symbol type.404 /// If null, print nothing.
324 /// \param yyvaluep Its semantic value.405 /// \param yysym The symbol.
325 /// \param yylocationp Its location.406 template <typename Base>
326 inline void yydestruct_ (const char* yymsg,407 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
327 int yytype,408
328 semantic_type* yyvaluep,409 private:
329 location_type* yylocationp);410 /// Type access provider for state based symbols.
411 struct by_state
412 {
413 /// Default constructor.
414 by_state ();
415
416 /// The symbol type as needed by the constructor.
417 typedef state_type kind_type;
418
419 /// Constructor.
420 by_state (kind_type s);
421
422 /// Copy constructor.
423 by_state (const by_state& other);
424
425 /// Steal the symbol type from \a that.
426 void move (by_state& that);
427
428 /// The (internal) type number (corresponding to \a state).
429 /// "empty" when empty.
430 symbol_number_type type_get () const;
431
432 enum { empty = 0 };
433
434 /// The state.
435 state_type state;
436 };
437
438 /// "Internal" symbol: element of the stack.
439 struct stack_symbol_type : basic_symbol<by_state>
440 {
441 /// Superclass.
442 typedef basic_symbol<by_state> super_type;
443 /// Construct an empty symbol.
444 stack_symbol_type ();
445 /// Steal the contents from \a sym to build this.
446 stack_symbol_type (state_type s, symbol_type& sym);
447 /// Assignment, needed by push_back.
448 stack_symbol_type& operator= (const stack_symbol_type& that);
449 };
450
451 /// Stack type.
452 typedef stack<stack_symbol_type> stack_type;
453
454 /// The stack.
455 stack_type yystack_;
456
457 /// Push a new state on the stack.
458 /// \param m a debug message to display
459 /// if null, no trace is output.
460 /// \param s the symbol
461 /// \warning the contents of \a s.value is stolen.
462 void yypush_ (const char* m, stack_symbol_type& s);
463
464 /// Push a new look ahead token on the state on the stack.
465 /// \param m a debug message to display
466 /// if null, no trace is output.
467 /// \param s the state
468 /// \param sym the symbol (for its value and location).
469 /// \warning the contents of \a s.value is stolen.
470 void yypush_ (const char* m, state_type s, symbol_type& sym);
330471
331 /// Pop \a n symbols the three stacks.472 /// Pop \a n symbols the three stacks.
332 inline void yypop_ (unsigned int n = 1);473 void yypop_ (unsigned int n = 1);
333474
334 /* Constants. */475 // Constants.
335 static const int yyeof_;476 enum
336 /* LAST_ -- Last index in TABLE_. */477 {
337 static const int yylast_;478 yyeof_ = 0,
338 static const int yynnts_;479 yylast_ = 73, ///< Last index in yytable_.
339 static const int yyempty_;480 yynnts_ = 13, ///< Number of nonterminal symbols.
340 static const int yyfinal_;481 yyempty_ = -2,
341 static const int yyterror_;482 yyfinal_ = 29, ///< Termination state number.
342 static const int yyerrcode_;483 yyterror_ = 1,
343 static const int yyntokens_;484 yyerrcode_ = 256,
344 static const unsigned int yyuser_token_number_max_;485 yyntokens_ = 27 ///< Number of tokens.
345 static const token_number_type yyundef_token_;486 };
346487
347 /* User arguments. */488
489 // User arguments.
348 VerifyTAPN::TAPNQueryParser& driver;490 VerifyTAPN::TAPNQueryParser& driver;
349 };491 };
350492
351/* Line 300 of lalr1.cc */493
352#line 5 "src/Core/QueryParser/grammar.yy"494#line 5 "src/Core/QueryParser/grammar.yy" // lalr1.cc:372
353} // VerifyTAPN495} // VerifyTAPN
354496#line 497 "src/Core/QueryParser/Generated/parser.hpp" // lalr1.cc:372
355/* Line 300 of lalr1.cc */497
356#line 357 "src/Core/QueryParser/Generated/parser.hpp"498
357499
358500
359501#endif // !YY_YY_SRC_CORE_QUERYPARSER_GENERATED_PARSER_HPP_INCLUDED
360#endif /* ! defined PARSER_HEADER_H */
361502
=== modified file 'src/Core/QueryParser/Generated/position.hh'
--- src/Core/QueryParser/Generated/position.hh 2014-08-07 20:48:41 +0000
+++ src/Core/QueryParser/Generated/position.hh 2018-01-07 20:09:44 +0000
@@ -1,139 +1,157 @@
11// A Bison parser, made by GNU Bison 3.0.2.
2/* A Bison parser, made by GNU Bison 2.4.1. */2
33// Positions for Bison parsers in C++
4/* Positions for Bison parsers in C++4
5 5// Copyright (C) 2002-2013 Free Software Foundation, Inc.
6 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.6
7 7// This program is free software: you can redistribute it and/or modify
8 This program is free software: you can redistribute it and/or modify8// it under the terms of the GNU General Public License as published by
9 it under the terms of the GNU General Public License as published by9// the Free Software Foundation, either version 3 of the License, or
10 the Free Software Foundation, either version 3 of the License, or10// (at your option) any later version.
11 (at your option) any later version.11
12 12// This program is distributed in the hope that it will be useful,
13 This program is distributed in the hope that it will be useful,13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14 but WITHOUT ANY WARRANTY; without even the implied warranty of14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15// GNU General Public License for more details.
16 GNU General Public License for more details.16
17 17// You should have received a copy of the GNU General Public License
18 You should have received a copy of the GNU General Public License18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */19
2020// As a special exception, you may create a larger work that contains
21/* As a special exception, you may create a larger work that contains21// part or all of the Bison parser skeleton and distribute that work
22 part or all of the Bison parser skeleton and distribute that work22// under terms of your choice, so long as that work isn't itself a
23 under terms of your choice, so long as that work isn't itself a23// parser generator using the skeleton or a modified version thereof
24 parser generator using the skeleton or a modified version thereof24// as a parser skeleton. Alternatively, if you modify or redistribute
25 as a parser skeleton. Alternatively, if you modify or redistribute25// the parser skeleton itself, you may (at your option) remove this
26 the parser skeleton itself, you may (at your option) remove this26// special exception, which will cause the skeleton and the resulting
27 special exception, which will cause the skeleton and the resulting27// Bison output files to be licensed under the GNU General Public
28 Bison output files to be licensed under the GNU General Public28// License without this special exception.
29 License without this special exception.29
30 30// This special exception was added by the Free Software Foundation in
31 This special exception was added by the Free Software Foundation in31// version 2.2 of Bison.
32 version 2.2 of Bison. */
3332
34/**33/**
35 ** \file position.hh34 ** \file src/Core/QueryParser/Generated/position.hh
36 ** Define the VerifyTAPN::position class.35 ** Define the VerifyTAPN::position class.
37 */36 */
3837
39#ifndef BISON_POSITION_HH38#ifndef YY_YY_SRC_CORE_QUERYPARSER_GENERATED_POSITION_HH_INCLUDED
40# define BISON_POSITION_HH39# define YY_YY_SRC_CORE_QUERYPARSER_GENERATED_POSITION_HH_INCLUDED
4140
41# include <algorithm> // std::max
42# include <iostream>42# include <iostream>
43# include <string>43# include <string>
44# include <algorithm>44
4545# ifndef YY_NULLPTR
4646# if defined __cplusplus && 201103L <= __cplusplus
47/* Line 38 of location.cc */47# define YY_NULLPTR nullptr
48#line 5 "src/Core/QueryParser/grammar.yy"48# else
49# define YY_NULLPTR 0
50# endif
51# endif
52
53#line 5 "src/Core/QueryParser/grammar.yy" // location.cc:291
49namespace VerifyTAPN {54namespace VerifyTAPN {
5055#line 56 "src/Core/QueryParser/Generated/position.hh" // location.cc:291
51/* Line 38 of location.cc */
52#line 53 "src/Core/QueryParser/Generated/position.hh"
53 /// Abstract a position.56 /// Abstract a position.
54 class position57 class position
55 {58 {
56 public:59 public:
57
58 /// Construct a position.60 /// Construct a position.
59 position ()61 explicit position (std::string* f = YY_NULLPTR,
60 : filename (0), line (1), column (1)62 unsigned int l = 1u,
63 unsigned int c = 1u)
64 : filename (f)
65 , line (l)
66 , column (c)
61 {67 {
62 }68 }
6369
6470
65 /// Initialization.71 /// Initialization.
66 inline void initialize (std::string* fn)72 void initialize (std::string* fn = YY_NULLPTR,
73 unsigned int l = 1u,
74 unsigned int c = 1u)
67 {75 {
68 filename = fn;76 filename = fn;
69 line = 1;77 line = l;
70 column = 1;78 column = c;
71 }79 }
7280
73 /** \name Line and Column related manipulators81 /** \name Line and Column related manipulators
74 ** \{ */82 ** \{ */
75 public:
76 /// (line related) Advance to the COUNT next lines.83 /// (line related) Advance to the COUNT next lines.
77 inline void lines (int count = 1)84 void lines (int count = 1)
78 {85 {
79 column = 1;86 if (count)
80 line += count;87 {
88 column = 1u;
89 line = add_ (line, count, 1);
90 }
81 }91 }
8292
83 /// (column related) Advance to the COUNT next columns.93 /// (column related) Advance to the COUNT next columns.
84 inline void columns (int count = 1)94 void columns (int count = 1)
85 {95 {
86 column = std::max (1u, column + count);96 column = add_ (column, count, 1);
87 }97 }
88 /** \} */98 /** \} */
8999
90 public:
91 /// File name to which this position refers.100 /// File name to which this position refers.
92 std::string* filename;101 std::string* filename;
93 /// Current line number.102 /// Current line number.
94 unsigned int line;103 unsigned int line;
95 /// Current column number.104 /// Current column number.
96 unsigned int column;105 unsigned int column;
106
107 private:
108 /// Compute max(min, lhs+rhs) (provided min <= lhs).
109 static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
110 {
111 return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
112 ? rhs + lhs
113 : min);
114 }
97 };115 };
98116
99 /// Add and assign a position.117 /// Add and assign a position.
100 inline const position&118 inline position&
101 operator+= (position& res, const int width)119 operator+= (position& res, int width)
102 {120 {
103 res.columns (width);121 res.columns (width);
104 return res;122 return res;
105 }123 }
106124
107 /// Add two position objects.125 /// Add two position objects.
108 inline const position126 inline position
109 operator+ (const position& begin, const int width)127 operator+ (position res, int width)
110 {128 {
111 position res = begin;
112 return res += width;129 return res += width;
113 }130 }
114131
115 /// Add and assign a position.132 /// Add and assign a position.
116 inline const position&133 inline position&
117 operator-= (position& res, const int width)134 operator-= (position& res, int width)
118 {135 {
119 return res += -width;136 return res += -width;
120 }137 }
121138
122 /// Add two position objects.139 /// Add two position objects.
123 inline const position140 inline position
124 operator- (const position& begin, const int width)141 operator- (position res, int width)
125 {142 {
126 return begin + -width;143 return res -= width;
127 }144 }
128145
129 /// Compare two position objects.146 /// Compare two position objects.
130 inline bool147 inline bool
131 operator== (const position& pos1, const position& pos2)148 operator== (const position& pos1, const position& pos2)
132 {149 {
133 return150 return (pos1.line == pos2.line
134 (pos1.filename == pos2.filename151 && pos1.column == pos2.column
135 || pos1.filename && pos2.filename && *pos1.filename == *pos2.filename)152 && (pos1.filename == pos2.filename
136 && pos1.line == pos2.line && pos1.column == pos2.column;153 || (pos1.filename && pos2.filename
154 && *pos1.filename == *pos2.filename)));
137 }155 }
138156
139 /// Compare two position objects.157 /// Compare two position objects.
@@ -147,19 +165,16 @@
147 ** \param ostr the destination output stream165 ** \param ostr the destination output stream
148 ** \param pos a reference to the position to redirect166 ** \param pos a reference to the position to redirect
149 */167 */
150 inline std::ostream&168 template <typename YYChar>
151 operator<< (std::ostream& ostr, const position& pos)169 inline std::basic_ostream<YYChar>&
170 operator<< (std::basic_ostream<YYChar>& ostr, const position& pos)
152 {171 {
153 if (pos.filename)172 if (pos.filename)
154 ostr << *pos.filename << ':';173 ostr << *pos.filename << ':';
155 return ostr << pos.line << '.' << pos.column;174 return ostr << pos.line << '.' << pos.column;
156 }175 }
157176
158
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches