The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Grammars.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11
12// cppcheck-suppress-file useInitializationList; for consistency
13
14#pragma once
15
16#ifdef __GNUC__
17# pragma GCC system_header
18#endif
19
20#include <GaudiKernel/HashMap.h>
26#include <list>
27#include <map>
28#include <set>
29#include <string>
30#include <tuple>
31#include <type_traits>
32#include <unordered_map>
33#include <unordered_set>
34#include <vector>
35
36#include <boost/fusion/include/std_pair.hpp>
37#include <boost/fusion/include/unused.hpp>
38#if ( BOOST_VERSION >= 187000 ) && ( BOOST_VERSION < 188000 )
39# define BOOST_ALLOW_DEPRECATED_HEADERS
40#endif
41#include <boost/spirit/include/qi.hpp>
42#undef BOOST_ALLOW_DEPRECATED_HEADERS
43
44#include <boost/phoenix/core.hpp>
45#include <boost/phoenix/operator.hpp>
46
47#include <boost/spirit/repository/include/qi_confix.hpp>
48
49namespace Gaudi {
50 namespace Parsers {
51 namespace sp = boost::spirit;
52 namespace ph = boost::phoenix;
53 namespace qi = sp::qi;
54 namespace enc = sp::ascii;
55 namespace rep = sp::repository;
56
57 typedef std::string::const_iterator DefaultIterator;
58 typedef enc::space_type DefaultSkipper;
59
60 template <typename Iterator, typename T, typename Skipper, class Enable = void>
61 struct Grammar_ {
62 /* READ THIS IF YOUR COMPILE BREAKS ON THE FOLLOWING LINE
63 *
64 * To users: You have to ask developers to implement parser for your type T
65 * To developer: You have to implement and register Grammar for type T
66 *
67 */
68 BOOST_MPL_ASSERT_MSG( false, GRAMMAR_FOR_TYPE_DOES_NOT_EXISTS, ( T ) );
69 };
70
71#define REGISTER_GRAMMAR( ResultType, GrammarName ) \
72 template <typename Iterator, typename Skipper> \
73 struct Grammar_<Iterator, ResultType, Skipper> { \
74 typedef GrammarName<Iterator, Skipper> Grammar; \
75 }
76
77 template <typename Iterator>
78 struct SkipperGrammar : qi::grammar<Iterator> {
80 comments = enc::space | rep::confix( "/*", "*/" )[*( qi::char_ - "*/" )] |
81 rep::confix( "//", ( sp::eol | sp::eoi ) )[*( qi::char_ - ( sp::eol | sp::eoi ) )];
82 }
83 qi::rule<Iterator> comments;
84 };
85
86 template <typename Iterator, typename Skipper>
87 struct StringGrammar : qi::grammar<Iterator, std::string(), qi::locals<char>, Skipper> {
88
89 typedef std::string ResultT;
90
91 StringGrammar() : StringGrammar::base_type( str ) {
92 begin_quote = enc::char_( "\"'" );
93 quote = enc::char_( qi::_r1 );
94
95 str = qi::lexeme[begin_quote[qi::_a = qi::_1] >
96 *( ( enc::char_( '\\' ) >> quote( qi::_a ) )[qi::_val += qi::_a] |
97 ( enc::char_( '\\' ) >> enc::char_( '\\' ) )[qi::_val += '\\'] |
98 ( enc::char_[qi::_val += qi::_1] - quote( qi::_a ) ) ) > quote( qi::_a )];
99 }
100
101 qi::rule<Iterator, std::string(), qi::locals<char>, Skipper> str;
102 qi::rule<Iterator, char()> begin_quote;
103 qi::rule<Iterator, void( char )> quote;
104 };
107
108 template <typename Iterator, typename Skipper>
109 struct CharGrammar : qi::grammar<Iterator, char(), Skipper> {
110 typedef char ResultT;
111 CharGrammar() : CharGrammar::base_type( ch ) {
112 ch = qi::int_parser<char>() | '\'' >> ( qi::char_ - '\'' ) >> '\'';
113 }
114 qi::rule<Iterator, char(), Skipper> ch;
115 };
117
118 template <typename Iterator, typename Skipper>
119 struct BoolGrammar : qi::grammar<Iterator, bool(), Skipper> {
120 typedef bool ResultT;
122 boolean_literal = ( qi::lit( "true" ) | "True" | "TRUE" | "1" )[qi::_val = true] |
123 ( qi::lit( "false" ) | "False" | "FALSE" | "0" )[qi::_val = false];
124 }
125 qi::rule<Iterator, bool(), Skipper> boolean_literal;
126 };
128
129 template <typename Iterator, typename RT, typename Skipper>
130 struct IntGrammar : qi::grammar<Iterator, RT(), Skipper> {
131 typedef RT ResultT;
132 IntGrammar() : IntGrammar::base_type( integer ) {
133 integer = qi::int_parser<RT>()[qi::_val = qi::_1] >> -qi::no_case[qi::char_( 'L' )];
134 }
135 qi::rule<Iterator, RT(), Skipper> integer;
136 };
137
138 template <typename Iterator, std::integral T, typename Skipper>
139 struct Grammar_<Iterator, T, Skipper> {
141 };
142
143 template <typename Iterator, typename RT, typename Skipper>
144 struct RealGrammar : qi::grammar<Iterator, RT(), Skipper> {
145 typedef RT ResultT;
146 RealGrammar() : RealGrammar::base_type( real ) { real = qi::real_parser<RT>(); }
147 qi::rule<Iterator, RT(), Skipper> real;
148 };
149
150 template <typename Iterator, std::floating_point T, typename Skipper>
154
155 template <typename T>
157
158 template <typename T>
160
161 template <typename T, typename... Ts>
162 struct tuple_remove_first_type<std::tuple<T, Ts...>> {
163 typedef std::tuple<Ts...> type;
164 };
165
166 template <typename T, typename... Ts>
167 struct tuple_get_first_type<std::tuple<T, Ts...>> {
168 typedef T type;
169 };
170
171 template <typename Iterator, typename TupleT, std::size_t N, typename Skipper>
173 : qi::grammar<Iterator, TupleT(), qi::locals<typename tuple_get_first_type<TupleT>::type>, Skipper> {
174 typedef TupleT ResultT;
177
178 struct Operations {
179 void operator()( ResultT& res, HeadT& head, TailT& tail ) const {
180 res = std::tuple_cat( std::tuple<HeadT>( head ), tail );
181 }
182 };
183
185 tup = grHead[qi::_a = qi::_1] >> ',' >> grLast[op( qi::_val, qi::_a, qi::_1 )];
186 }
187
190
191 qi::rule<Iterator, ResultT(), qi::locals<HeadT>, Skipper> tup;
192 ph::function<Operations> op;
193 };
194
195 template <typename Iterator, typename TupleT, typename Skipper>
196 struct TupleInnerGrammar<Iterator, TupleT, 1, Skipper> : qi::grammar<Iterator, TupleT(), Skipper> {
197 typedef TupleT ResultT;
198
199 struct Operations {
200 void operator()( ResultT& res, const std::tuple_element_t<0, ResultT>& val ) const {
201 res = ResultT();
202 std::get<0>( res ) = val;
203 }
204 };
205
206 TupleInnerGrammar() : TupleInnerGrammar::base_type( tup ) { tup = grFirst[op( qi::_val, qi::_1 )]; }
207
209
211 ph::function<Operations> op;
212 };
213
214 template <typename Iterator, typename TupleT, std::size_t N, typename Skipper>
215 struct TupleGrammar : qi::grammar<Iterator, TupleT(), qi::locals<char>, Skipper> {
216 typedef TupleT ResultT;
217 TupleGrammar() : TupleGrammar::base_type( tup ) {
218 begin = enc::char_( '[' )[qi::_val = ']'] | enc::char_( '(' )[qi::_val = ')'];
219 end = *( enc::char_( ',' ) ) >> enc::char_( qi::_r1 );
220
221 tup = begin[qi::_a = qi::_1] >> grTuple[qi::_val = qi::_1] >> end( qi::_a );
222 }
223
224 qi::rule<Iterator, char()> begin;
225 qi::rule<Iterator, void( char )> end;
226 qi::rule<Iterator, ResultT(), qi::locals<char>, Skipper> tup;
228 };
229
230 template <typename Iterator, typename Skipper, typename... Args>
231 struct Grammar_<Iterator, std::tuple<Args...>, Skipper> {
232 typedef TupleGrammar<Iterator, std::tuple<Args...>, sizeof...( Args ), Skipper> Grammar;
233 };
234
235 template <typename Iterator, typename VectorT, typename Skipper>
236 struct VectorGrammar : qi::grammar<Iterator, VectorT(), qi::locals<char>, Skipper> {
237 typedef VectorT ResultT;
238
239 VectorGrammar() : VectorGrammar::base_type( vec ) {
240 begin =
241 enc::char_( '[' )[qi::_val = ']'] | enc::char_( '{' )[qi::_val = '}'] | enc::char_( '(' )[qi::_val = ')'];
242 end = *( enc::char_( ',' ) ) >> enc::char_( qi::_r1 );
243 list = elementGrammar % ',';
244 vec = begin[qi::_a = qi::_1] >> -list[qi::_val = qi::_1] >> end( qi::_a );
245 }
246
248 qi::rule<Iterator, char()> begin;
249 qi::rule<Iterator, void( char )> end;
250
251 qi::rule<Iterator, ResultT(), qi::locals<char>, Skipper> vec;
253 };
254
255 template <typename Iterator, typename InnerT, typename AllocatorT, typename Skipper>
259
260 template <typename Iterator, typename InnerT, typename AllocatorT, typename Skipper>
264
265 template <typename Iterator, typename InnerT, typename CompareT, typename AllocatorT, typename Skipper>
269
270 template <typename Iterator, typename SetT, typename Skipper>
271 struct SetGrammar : qi::grammar<Iterator, SetT(), qi::locals<char>, Skipper> {
272 SetGrammar() : SetGrammar::base_type( set ) {
273 // special handling of empty set as "{}" is always a dict
274 set = qi::lit( "set()" ) | grVector;
275 }
277 qi::rule<Iterator, SetT(), qi::locals<char>, Skipper> set;
278 };
279
280 template <typename Iterator, typename InnerT, typename HashT, typename CompareT, typename AllocatorT,
281 typename Skipper>
282 struct Grammar_<Iterator, std::unordered_set<InnerT, HashT, CompareT, AllocatorT>, Skipper> {
284 };
285
286 template <typename Iterator, typename PairT, typename Skipper>
287 struct PairGrammar : qi::grammar<Iterator, PairT(), qi::locals<char>, Skipper> {
288 typedef PairT ResultT;
289 typedef typename PairT::first_type first_type;
290 typedef typename PairT::second_type second_type;
291
292 struct first {};
293 struct second {};
294
296 PairGrammar( const std::string& delimeter ) : PairGrammar::base_type( pair ) {
297 begin = enc::char_( '(' )[qi::_val = ')'] | enc::char_( '[' )[qi::_val = ']'];
298 end = qi::char_( qi::_r1 );
299 pair = begin[qi::_a = qi::_1] >> pair_in[qi::_val = qi::_1] >> end( qi::_a );
300 pair_in = key >> qi::lit( delimeter ) >> value;
301 }
302
305 qi::rule<Iterator, char()> begin;
306 qi::rule<Iterator, void( char )> end;
307 qi::rule<Iterator, ResultT(), qi::locals<char>, Skipper> pair;
309 };
310
311 template <typename Iterator, typename KeyT, typename ValueT, typename Skipper>
315
316 template <typename Iterator, typename MapT, typename Skipper>
317 struct MapGrammar : qi::grammar<Iterator, MapT(), Skipper> {
318 typedef MapT ResultT;
319 typedef typename MapT::key_type KeyT;
320 typedef typename MapT::mapped_type MappedT;
321 typedef std::pair<KeyT, MappedT> PairT;
322
323 typedef std::vector<PairT> VectorPairT;
324
325 struct tag_key {};
326 struct tag_mapped {};
327 struct Operations {
328 void operator()( ResultT& res, const VectorPairT& vec ) const {
329 for ( auto cur = vec.begin(); cur != vec.end(); ++cur ) { res.insert( *cur ); }
330 }
331 void operator()( PairT& res, const KeyT& key, tag_key ) const { res.first = key; }
332 void operator()( PairT& res, const MappedT& value, tag_mapped ) const { res.second = value; }
333 };
334
335 MapGrammar() : MapGrammar::base_type( map ) {
336 pair = key[op( qi::_val, qi::_1, tag_key() )] > ( qi::lit( ':' ) | '=' ) >
337 value[op( qi::_val, qi::_1, tag_mapped() )];
338 list = -( pair % enc::char_( ',' ) );
339 map = ( ( '[' >> list >> ']' ) | ( '{' >> list >> '}' ) | ( '[' >> list >> ',' >> ']' ) |
340 ( '{' >> list >> ',' >> '}' ) )[op( qi::_val, qi::_1 )];
341 }
342
345 qi::rule<Iterator, PairT(), Skipper> pair;
348 ph::function<Operations> op;
349 };
350
351 template <typename Iterator, typename KeyT, typename ValueT, typename KeyCompareT, typename AllocatorT,
352 typename Skipper>
353 struct Grammar_<Iterator, std::map<KeyT, ValueT, KeyCompareT, AllocatorT>, Skipper> {
355 };
356
357 template <typename Iterator, typename KeyT, typename ValueT, typename HashT, typename KeyCompareT,
358 typename AllocatorT, typename Skipper>
359 struct Grammar_<Iterator, std::unordered_map<KeyT, ValueT, HashT, KeyCompareT, AllocatorT>, Skipper> {
361 };
362
363 template <typename Iterator, typename KeyT, typename ValueT, typename KeyCompareT, typename AllocatorT,
364 typename Skipper>
368
369 template <typename Iterator, typename PointT, typename Skipper>
370 struct Pnt3DGrammar : qi::grammar<Iterator, PointT(), Skipper> {
371 typedef PointT ResultT;
372 typedef typename PointT::Scalar Scalar;
373
374 struct Operations {
375 void operator()( ResultT& res, const Scalar& scalar, const char xyz ) const {
376 switch ( xyz ) {
377 case 'x':
378 res.SetX( scalar );
379 break;
380 case 'y':
381 res.SetY( scalar );
382 break;
383 case 'z':
384 res.SetZ( scalar );
385 break;
386 default:
387 break;
388 }
389 }
390 };
391
392 Pnt3DGrammar() : Pnt3DGrammar::base_type( point ) {
393 point = list | ( '(' >> list >> ')' ) | ( '[' >> list >> ']' );
394 list = -( enc::no_case[qi::lit( "x" ) | qi::lit( "px" )] >> ':' ) >> scalar[op( qi::_val, qi::_1, 'x' )] >>
395 ',' >> -( enc::no_case[qi::lit( "y" ) | qi::lit( "py" )] >> ':' ) >>
396 scalar[op( qi::_val, qi::_1, 'y' )] >> ',' >>
397 -( enc::no_case[qi::lit( "z" ) | qi::lit( "pz" )] >> ':' ) >> scalar[op( qi::_val, qi::_1, 'z' )];
398 }
399
402 ph::function<Operations> op;
403 };
404
405 template <typename Iterator, typename T1, typename T2, typename Skipper>
409
410 template <typename Iterator, typename T1, typename T2, typename Skipper>
414
415 template <typename Iterator, typename PointT, typename Skipper>
416 struct Pnt4DGrammar : qi::grammar<Iterator, PointT(), Skipper> {
417 typedef PointT ResultT;
418 typedef typename PointT::Scalar ScalarT;
419
420 struct Operations {
421 void operator()( ResultT& res, const ScalarT& scalar, const char xyz ) const {
422 switch ( xyz ) {
423 case 'x':
424 res.SetPx( scalar );
425 break;
426 case 'y':
427 res.SetPy( scalar );
428 break;
429 case 'z':
430 res.SetPz( scalar );
431 break;
432 case 'e':
433 res.SetE( scalar );
434 break;
435 default:
436 break;
437 }
438 }
439 void operator()( ResultT& res, const ResultT& xyz ) const {
440 res.SetPx( xyz.Px() );
441 res.SetPy( xyz.Py() );
442 res.SetPz( xyz.Pz() );
443 }
444 };
445
447 point4d = list4d | ( '(' >> list4d >> ')' ) | ( '[' >> list4d >> ']' );
448 list4d = ( point3d[op( qi::_val, qi::_1 )] >> enc::char_( ";," ) >> e[op( qi::_val, qi::_1, 'e' )] ) |
449 ( e[op( qi::_val, qi::_1, 'e' )] >> enc::char_( ";," ) >> point3d[op( qi::_val, qi::_1 )] );
450 e = -( enc::no_case[enc::char_( "te" )] >> ':' ) >> scalar[qi::_val = qi::_1];
451
452 point3d = list3d | ( '(' >> list3d >> ')' ) | ( '[' >> list3d >> ']' );
453 list3d = -( enc::no_case[qi::lit( "x" ) | qi::lit( "px" )] >> ':' ) >> scalar[op( qi::_val, qi::_1, 'x' )] >>
454 ',' >> -( enc::no_case[qi::lit( "y" ) | qi::lit( "py" )] >> ':' ) >>
455 scalar[op( qi::_val, qi::_1, 'y' )] >> ',' >>
456 -( enc::no_case[qi::lit( "z" ) | qi::lit( "pz" )] >> ':' ) >> scalar[op( qi::_val, qi::_1, 'z' )];
457 }
458
460 qi::rule<Iterator, ScalarT(), Skipper> e;
462 ph::function<Operations> op;
463 };
464
465 template <typename Iterator, typename T1, typename Skipper>
469
470 template <typename Iterator, typename Skipper>
471 struct Histo1DGrammar : qi::grammar<Iterator, Gaudi::Histo1DDef(), qi::locals<char>, Skipper> {
473
474 struct Operations {
475 void operator()( ResultT& res, const std::string& title ) const { res.setTitle( title ); }
476 void operator()( ResultT& res, const double& val, const char lh ) const {
477 switch ( lh ) {
478 case 'l':
479 res.setLowEdge( val );
480 break;
481 case 'h':
482 res.setHighEdge( val );
483 break;
484 default:
485 break;
486 }
487 }
488 void operator()( ResultT& res, int val ) const { res.setBins( val ); }
489 void operator()( ResultT& res ) const {}
490 };
491
493 val1 = title[op( qi::_val, qi::_1 )] >> ',' >> qi::double_[op( qi::_val, qi::_1, 'l' )] >> ',' >>
494 qi::double_[op( qi::_val, qi::_1, 'h' )] >> -( ',' >> qi::int_[op( qi::_val, qi::_1 )] );
495 val2 = qi::double_[op( qi::_val, qi::_1, 'l' )] >> ',' >> qi::double_[op( qi::_val, qi::_1, 'h' )] >> ',' >>
496 title[op( qi::_val, qi::_1 )] >> -( ',' >> qi::int_[op( qi::_val, qi::_1 )] );
497 val3 = qi::double_[op( qi::_val, qi::_1, 'l' )] >> ',' >> qi::double_[op( qi::_val, qi::_1, 'h' )] >>
498 -( ',' >> title[op( qi::_val, qi::_1 )] ) >> -( ',' >> qi::int_[op( qi::_val, qi::_1 )] );
499 begin = enc::char_( '[' )[qi::_val = ']'] | enc::char_( '(' )[qi::_val = ')'];
500 end = enc::char_( qi::_r1 );
501 hist = begin[qi::_a = qi::_1] >> ( val1 | val2 | val3 )[qi::_val = qi::_1] >> end( qi::_a );
502 }
503
504 qi::rule<Iterator, ResultT(), qi::locals<char>, Skipper> hist;
506 qi::rule<Iterator, char()> begin;
507 qi::rule<Iterator, void( char )> end;
509 ph::function<Operations> op;
510 };
512
513 template <typename Iterator, typename Skipper>
514 struct KeyValueGrammar : qi::grammar<Iterator, std::pair<std::string, std::string>(), Skipper> {
515 typedef std::pair<std::string, std::string> ResultT;
516
517 struct first {};
518 struct second {};
519
520 KeyValueGrammar() : KeyValueGrammar::base_type( pair ) { pair = gstring >> ":" >> +enc::char_; }
521
524 };
525 // We don't register KeyalueGrammar because it's a special parser
526 } // namespace Parsers
527} // namespace Gaudi
#define REGISTER_GRAMMAR(ResultType, GrammarName)
Definition Grammars.h:71
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition Iterator.h:18
3D point typedefs
4D point typedefs
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition HistoDef.h:30
void setTitle(std::string value)
set the title
Definition HistoDef.h:61
void setBins(int value)
set number of bis
Definition HistoDef.h:59
void setLowEdge(double value)
set low edge
Definition HistoDef.h:55
void setHighEdge(double value)
set high edge
Definition HistoDef.h:57
Helper class for efficient "key" access for strings.
Definition StringKey.h:66
STL class.
enc::space_type DefaultSkipper
Definition Grammars.h:58
SkipperGrammar< IteratorT > Skipper
Definition Factory.h:24
std::string::const_iterator DefaultIterator
Definition Grammars.h:57
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
STL namespace.
qi::rule< Iterator, bool(), Skipper > boolean_literal
Definition Grammars.h:125
qi::rule< Iterator, char(), Skipper > ch
Definition Grammars.h:114
MapGrammar< Iterator, std::map< KeyT, ValueT, KeyCompareT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:354
VectorGrammar< Iterator, std::set< InnerT, CompareT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:267
MapGrammar< Iterator, GaudiUtils::VectorMap< KeyT, ValueT, KeyCompareT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:366
IntGrammar< Iterator, T, Skipper > Grammar
Definition Grammars.h:140
TupleGrammar< Iterator, std::tuple< Args... >, sizeof...(Args), Skipper > Grammar
Definition Grammars.h:232
PairGrammar< Iterator, std::pair< KeyT, ValueT >, Skipper > Grammar
Definition Grammars.h:313
Pnt3DGrammar< Iterator, ROOT::Math::PositionVector3D< T1, T2 >, Skipper > Grammar
Definition Grammars.h:407
SetGrammar< Iterator, std::unordered_set< InnerT, HashT, CompareT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:283
VectorGrammar< Iterator, std::list< InnerT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:262
VectorGrammar< Iterator, std::vector< InnerT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:257
MapGrammar< Iterator, std::unordered_map< KeyT, ValueT, HashT, KeyCompareT, AllocatorT >, Skipper > Grammar
Definition Grammars.h:360
Pnt3DGrammar< Iterator, ROOT::Math::DisplacementVector3D< T1, T2 >, Skipper > Grammar
Definition Grammars.h:412
Pnt4DGrammar< Iterator, ROOT::Math::LorentzVector< T1 >, Skipper > Grammar
Definition Grammars.h:467
BOOST_MPL_ASSERT_MSG(false, GRAMMAR_FOR_TYPE_DOES_NOT_EXISTS,(T))
void operator()(ResultT &res, const double &val, const char lh) const
Definition Grammars.h:476
void operator()(ResultT &res, int val) const
Definition Grammars.h:488
void operator()(ResultT &res, const std::string &title) const
Definition Grammars.h:475
void operator()(ResultT &res) const
Definition Grammars.h:489
qi::rule< Iterator, ResultT(), qi::locals< char >, Skipper > hist
Definition Grammars.h:504
Gaudi::Histo1DDef ResultT
Definition Grammars.h:472
qi::rule< Iterator, ResultT(), Skipper > val3
Definition Grammars.h:505
qi::rule< Iterator, void(char)> end
Definition Grammars.h:507
qi::rule< Iterator, ResultT(), Skipper > val2
Definition Grammars.h:505
StringGrammar< Iterator, Skipper > title
Definition Grammars.h:508
ph::function< Operations > op
Definition Grammars.h:509
qi::rule< Iterator, char()> begin
Definition Grammars.h:506
qi::rule< Iterator, ResultT(), Skipper > val1
Definition Grammars.h:505
qi::rule< Iterator, T(), Skipper > integer
Definition Grammars.h:135
std::pair< std::string, std::string > ResultT
Definition Grammars.h:515
qi::rule< Iterator, ResultT(), Skipper > pair
Definition Grammars.h:523
StringGrammar< Iterator, Skipper > gstring
Definition Grammars.h:522
void operator()(PairT &res, const MappedT &value, tag_mapped) const
Definition Grammars.h:332
void operator()(ResultT &res, const VectorPairT &vec) const
Definition Grammars.h:328
void operator()(PairT &res, const KeyT &key, tag_key) const
Definition Grammars.h:331
MapT::mapped_type MappedT
Definition Grammars.h:320
Grammar_< Iterator, typenameMapT::key_type, Skipper >::Grammar key
Definition Grammars.h:343
ph::function< Operations > op
Definition Grammars.h:348
std::vector< PairT > VectorPairT
Definition Grammars.h:323
Grammar_< Iterator, typenameMapT::mapped_type, Skipper >::Grammar value
Definition Grammars.h:344
std::pair< KeyT, MappedT > PairT
Definition Grammars.h:321
PairT::second_type second_type
Definition Grammars.h:290
PairGrammar(const std::string &delimeter)
Definition Grammars.h:296
Grammar_< Iterator, typenamePairT::first_type, Skipper >::Grammar key
Definition Grammars.h:303
Grammar_< Iterator, typenamePairT::second_type, Skipper >::Grammar value
Definition Grammars.h:304
PairT::first_type first_type
Definition Grammars.h:289
qi::rule< Iterator, ResultT(), qi::locals< char >, Skipper > pair
Definition Grammars.h:307
void operator()(ResultT &res, const Scalar &scalar, const char xyz) const
Definition Grammars.h:375
Grammar_< Iterator, Scalar, Skipper >::Grammar scalar
Definition Grammars.h:401
ph::function< Operations > op
Definition Grammars.h:402
void operator()(ResultT &res, const ScalarT &scalar, const char xyz) const
Definition Grammars.h:421
void operator()(ResultT &res, const ResultT &xyz) const
Definition Grammars.h:439
ph::function< Operations > op
Definition Grammars.h:462
Grammar_< Iterator, ScalarT, Skipper >::Grammar scalar
Definition Grammars.h:461
qi::rule< Iterator, Node(), Skipper > real
Definition Grammar.h:90
VectorGrammar< Iterator, std::unordered_set< InnerT, HashT, CompareT, AllocatorT >, Skipper > grVector
Definition Grammars.h:276
qi::rule< Iterator, std::unordered_set< InnerT, HashT, CompareT, AllocatorT >(), qi::locals< char >, Skipper > set
Definition Grammars.h:277
qi::rule< Iterator, void(char)> quote
Definition Grammar.h:58
qi::rule< Iterator, char()> begin_quote
Definition Grammar.h:57
qi::rule< Iterator, std::string(), qi::locals< char >, Skipper > str
Definition Grammar.h:56
qi::rule< Iterator, ResultT(), qi::locals< char >, Skipper > tup
Definition Grammars.h:226
TupleInnerGrammar< Iterator, std::tuple< Args... >, N, Skipper > grTuple
Definition Grammars.h:227
void operator()(ResultT &res, HeadT &head, TailT &tail) const
Definition Grammars.h:179
void operator()(ResultT &res, const std::tuple_element_t< 0, ResultT > &val) const
Definition Grammars.h:200
Grammar_< Iterator, std::tuple_element_t< 0, ResultT >, Skipper >::Grammar grFirst
Definition Grammars.h:208
tuple_remove_first_type< TupleT >::type TailT
Definition Grammars.h:175
tuple_get_first_type< TupleT >::type HeadT
Definition Grammars.h:176
ph::function< Operations > op
Definition Grammars.h:192
TupleInnerGrammar< Iterator, TailT, N - 1, Skipper > grLast
Definition Grammars.h:188
Grammar_< Iterator, HeadT, Skipper >::Grammar grHead
Definition Grammars.h:189
qi::rule< Iterator, ResultT(), qi::locals< HeadT >, Skipper > tup
Definition Grammars.h:191
Grammar_< Iterator, typenameVectorT::value_type, Skipper >::Grammar elementGrammar
Definition Grammars.h:247
qi::rule< Iterator, ResultT(), qi::locals< char >, Skipper > vec
Definition Grammars.h:251