JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Query_State.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 08/05/2019.
3 //
4 
5 #ifndef JODA_QUERY_STATE_H
6 #define JODA_QUERY_STATE_H
8 
9 #include <stack>
11 
12 struct queriesState {
13  inline queriesState() {}
14 
15  template <typename Input>
16  inline void success(const Input &in){};
17 
18  std::vector<std::shared_ptr<joda::query::Query>> q{};
19 };
20 
21 struct queryState {
22  inline queryState() { q = std::make_shared<joda::query::Query>(); }
23 
24  template <typename Input>
25  inline queryState(const Input &in, queriesState &qs) {q = std::make_shared<joda::query::Query>();}
26 
27  template <typename Input>
28  inline void success(const Input &in){};
29 
30  template <typename Input>
31  inline void success(const Input &in, queriesState &state) {
32  state.q.emplace_back(std::move(q));
33  };
34 
35  std::shared_ptr<joda::query::Query> q;
36 };
37 
38 enum Comparison { NONE, GT, GTE, LT, LTE, EQU, NEQU };
39 enum stackMod { BASE, AND, OR };
40 
41 typedef std::stack<
42  std::pair<stackMod, std::vector<std::unique_ptr<joda::query::Predicate>>>>
44 } // namespace joda::queryparsing::grammar
45 #endif // JODA_QUERY_STATE_H
Comparison
Definition: Query_State.h:38
@ LTE
Definition: Query_State.h:38
@ GTE
Definition: Query_State.h:38
@ NEQU
Definition: Query_State.h:38
@ GT
Definition: Query_State.h:38
@ NONE
Definition: Query_State.h:38
@ LT
Definition: Query_State.h:38
@ EQU
Definition: Query_State.h:38
stackMod
Definition: Query_State.h:39
@ BASE
Definition: Query_State.h:39
@ AND
Definition: Query_State.h:39
@ OR
Definition: Query_State.h:39
std::stack< std::pair< stackMod, std::vector< std::unique_ptr< joda::query::Predicate > > > > predStack
Definition: Query_State.h:43
Definition: Query_State.h:12
void success(const Input &in)
Definition: Query_State.h:16
std::vector< std::shared_ptr< joda::query::Query > > q
Definition: Query_State.h:18
queriesState()
Definition: Query_State.h:13
Definition: Query_State.h:21
queryState()
Definition: Query_State.h:22
std::shared_ptr< joda::query::Query > q
Definition: Query_State.h:33
void success(const Input &in, queriesState &state)
Definition: Query_State.h:31
queryState(const Input &in, queriesState &qs)
Definition: Query_State.h:25
void success(const Input &in)
Definition: Query_State.h:28