jmespath.cpp
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
grammar.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Author: Róbert Márki <gsmiko@gmail.com>
4 ** Copyright (c) 2016 Róbert Márki
5 **
6 ** This file is part of the jmespath.cpp project which is distributed under
7 ** the MIT License (MIT).
8 **
9 ** Permission is hereby granted, free of charge, to any person obtaining a copy
10 ** of this software and associated documentation files (the "Software"), to
11 ** deal in the Software without restriction, including without limitation the
12 ** rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 ** sell copies of the Software, and to permit persons to whom the Software is
14 ** furnished to do so, subject to the following conditions:
15 **
16 ** The above copyright notice and this permission notice shall be included in
17 ** all copies or substantial portions of the Software.
18 **
19 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 ** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 ** DEALINGS IN THE SOFTWARE.
26 **
27 ****************************************************************************/
28 #ifndef GRAMMAR_H
29 #define GRAMMAR_H
30 #include "jmespath/types.h"
31 #include "src/ast/allnodes.h"
32 #include "src/parser/noderank.h"
39 #include <boost/spirit/include/qi.hpp>
40 #include <boost/phoenix.hpp>
41 
46 namespace jmespath { namespace parser {
47 
48 namespace qi = boost::spirit::qi;
49 namespace encoding = qi::unicode;
50 namespace phx = boost::phoenix;
51 
62 template <typename Iterator, typename Skipper = encoding::space_type>
63 class Grammar : public qi::grammar<Iterator,
64  ast::ExpressionNode(),
65  Skipper>
66 {
67 public:
72  : Grammar::base_type(m_topLevelExpressionRule)
73  {
74  using encoding::char_;
75  using qi::lit;
76  using qi::lexeme;
77  using qi::int_parser;
78  using qi::_val;
79  using qi::_1;
80  using qi::_2;
81  using qi::_pass;
82  using qi::_r1;
83  using qi::_r2;
84  using qi::eps;
85  using qi::_a;
86  using phx::at_c;
87  using phx::if_;
88  using phx::ref;
89 
90  // Since boost spirit doesn't support left recursive grammars, some of
91  // the rules are converted into tail expressions. When a tail expression
92  // is parsed and the parser returns from a recursion the
93  // InsertNodeAction functor is used to compensate for tail expressions.
94  // It inserts the binary expression nodes into the appropriate position
95  // which leads to an easy to interpret AST.
96 
97  // lazy function for inserting binary nodes to the appropriate position
98  phx::function<InsertNodeAction<
100  NodeInsertCondition> > insertNode;
101  // lazy function for appending UTF-32 characters to a string encoded
102  // in UTF-8
103  phx::function<AppendUtf8Action> appendUtf8;
104  // lazy function for appending UTF-32 encoded escape sequence to a
105  // string encoded in UTF-8
106  phx::function<AppendEscapeSequenceAction> appendEscape;
107  // lazy function for for combining surrogate pair characters into a
108  // single codepoint
109  phx::function<EncodeSurrogatePairAction> encodeSurrogatePair;
110 
111  // optionally match an expression
112  // this ensures that the parsing of empty expressions which contain
113  // only whitespaces will be successful
114  m_topLevelExpressionRule = -m_expressionRule[insertNode(_val, _1)];
115 
116  // match a standalone index expression or hash wildcard expression or
117  // not expression or function expression or identifier or multiselect
118  // list or multiselect hash or literal or a raw string or paren
119  // expression or current node expression, optionally followed by a
120  // subexpression an index expression a hash wildcard subexpression a
121  // pipe expresion a comparator expression an or expression and an and
122  // expression
123  m_expressionRule = (m_indexExpressionRule(_val)[insertNode(_val, _1)]
124  | m_hashWildcardRule(_val)[insertNode(_val, _1)]
125  | m_notExpressionRule(_val)[insertNode(_val, _1)]
130  | m_literalRule
133  | m_currentNodeRule)[_a = _1])
134  >> -m_subexpressionRule(_val)[insertNode(_val, _1)]
135  >> -m_indexExpressionRule(_val)[insertNode(_val, _1)]
136  >> -m_hashWildcardSubexpressionRule(_val)[insertNode(_val, _1)]
137  >> -m_pipeExpressionRule(_val)[insertNode(_val, _1)]
138  >> -m_comparatorExpressionRule(_val)[insertNode(_val, _1)]
139  >> -m_orExpressionRule(_val)[insertNode(_val, _1)]
140  >> -m_andExpressionRule(_val)[insertNode(_val, _1)]
141  >> eps[insertNode(_val, _a)];
142 
143  // match an identifier or multiselect list or multiselect hash preceded
144  // by a dot, a subexpression can also be optionally followed by an index
145  // expression a hash wildcard subexpression by another subexpression
146  // a pipe expresion a comparator expression an or expression and an
147  // and expression
148  m_subexpressionRule = (lit('.')
152  | m_multiselectHashRule)[at_c<1>(_val) = _1])
153  >> -m_indexExpressionRule(_r1)[insertNode(_r1, _1)]
154  >> -m_hashWildcardSubexpressionRule(_r1)[insertNode(_r1, _1)]
155  >> -m_subexpressionRule(_r1)[insertNode(_r1, _1)]
156  >> -m_pipeExpressionRule(_r1)[insertNode(_r1, _1)]
157  >> -m_comparatorExpressionRule(_r1)[insertNode(_r1, _1)]
158  >> -m_orExpressionRule(_r1)[insertNode(_r1, _1)]
159  >> -m_andExpressionRule(_r1)[insertNode(_r1, _1)];
160 
161  // match a bracket specifier which can be optionally followed by a
162  // subexpression a hash wildcard subexpression an index expression
163  // a pipe expresion a comparator expression an or expression and an
164  // and expression
165  m_indexExpressionRule = m_bracketSpecifierRule[at_c<1>(_val) = _1]
166  >> -m_subexpressionRule(_r1)[insertNode(_r1, _1)]
167  >> -m_hashWildcardSubexpressionRule(_r1)[insertNode(_r1, _1)]
168  >> -m_indexExpressionRule(_r1)[insertNode(_r1, _1)]
169  >> -m_pipeExpressionRule(_r1)[insertNode(_r1, _1)]
170  >> -m_comparatorExpressionRule(_r1)[insertNode(_r1, _1)]
171  >> -m_orExpressionRule(_r1)[insertNode(_r1, _1)]
172  >> -m_andExpressionRule(_r1)[insertNode(_r1, _1)];
173 
174  // match a slice expression or an array item or a list wildcard or a
175  // flatten operator or a filter expression
176  m_bracketSpecifierRule = (lit("[")
180  >> lit("]"))
183 
184  // match an integer of type Index
185  m_indexRule = int_parser<Index>();
186 
187  // match an index
189 
190  // match a pair of square brackets
191  m_flattenOperatorRule = eps >> lit("[]");
192 
193  // match an expression preceded by a question mark
194  m_filterExpressionRule = lit("[?") >> m_expressionRule >> lit("]");
195 
196  // match a colon which can be optionally preceded and followed by a
197  // single index, these matches can also be optionally followed by
198  // another colon which can be followed by an index
199  m_sliceExpressionRule = -m_indexRule[at_c<0>(_val) = _1]
200  >> lit(':')
201  >> -m_indexRule[at_c<1>(_val) = _1]
202  >> -(lit(':') >> -m_indexRule[at_c<2>(_val) = _1]);
203 
204  // match an asterisk
205  m_listWildcardRule = eps >> lit("*");
206 
207  // match an asterisk optionally followd by a subexpression an
208  // index expression a hash wildcard subexpression a pipe expresion
209  // a comparator expression an or expression and an and expression
210  m_hashWildcardRule = eps >> lit("*")
211  >> -m_subexpressionRule(_r1)[insertNode(_r1, _1)]
212  >> -m_indexExpressionRule(_r1)[insertNode(_r1, _1)]
213  >> -m_hashWildcardSubexpressionRule(_r1)[insertNode(_r1, _1)]
214  >> -m_pipeExpressionRule(_r1)[insertNode(_r1, _1)]
215  >> -m_comparatorExpressionRule(_r1)[insertNode(_r1, _1)]
216  >> -m_orExpressionRule(_r1)[insertNode(_r1, _1)]
217  >> -m_andExpressionRule(_r1)[insertNode(_r1, _1)];
218 
219  // match a dot followd by an asterisk optionally followd by a
220  // subexpression an index expression a hash wildcard subexpression
221  // a pipe expresion a comparator expression an or expression and an
222  // and expression
223  m_hashWildcardSubexpressionRule = eps >> lit(".") >> lit("*")
224  >> -m_subexpressionRule(_r1)[insertNode(_r1, _1)]
225  >> -m_indexExpressionRule(_r1)[insertNode(_r1, _1)]
226  >> -m_hashWildcardSubexpressionRule(_r1)[insertNode(_r1, _1)]
227  >> -m_pipeExpressionRule(_r1)[insertNode(_r1, _1)]
228  >> -m_comparatorExpressionRule(_r1)[insertNode(_r1, _1)]
229  >> -m_orExpressionRule(_r1)[insertNode(_r1, _1)]
230  >> -m_andExpressionRule(_r1)[insertNode(_r1, _1)];
231 
232  // matches an expression enclosed in square brackets, the expression
233  // can optionally be followd by more expressions separated with commas
234  m_multiselectListRule = lit('[')
235  >> m_expressionRule % lit(',')
236  >> lit(']');
237 
238  // match a key-value pair enclosed in curly braces, the key-value pair
239  // can optionally be followed by more key-value pairs separated with
240  // commas
241  m_multiselectHashRule = lit('{')
242  >> m_keyValuePairRule % lit(',')
243  >> lit('}');
244 
245  // match an expression preceded by an exclamation mark
246  m_notExpressionRule = lit('!') >> m_expressionRule[_r1 = _1];
247 
248  // match an expression inside parentheses
249  m_parenExpressionRule = lit('(') >> m_expressionRule >> lit(')');
250 
251  // match a comparator symbol followed by an expression
252  m_comparatorExpressionRule = m_comparatorSymbols[at_c<1>(_val) = _1]
253  >> m_expressionRule[_r1 = _1];
254 
255  // convert textual comparator symbols to enum values
263 
264  // match a single vertical bar followed by an expression
265  m_pipeExpressionRule = lit("|") >> m_expressionRule[_r1 = _1];
266 
267  // match double vertical bars followed by an expression
268  m_orExpressionRule = lit("||") >> m_expressionRule[_r1 = _1];
269 
270  // match double ampersand followed by an expression
271  m_andExpressionRule = lit("&&") >> m_expressionRule[_r1 = _1];
272 
273  // match
274  m_currentNodeRule = eps >> lit('@');
275 
276  // match an unquoted string which is optionally followed by an argument
277  // list enclosed in parenthesis
279  >> lit('(') >> -m_functionArgumentListRule >> lit(')');
280 
281  // match a sequence of function arguments separated with commas
283 
284  // match an expression or an expression argument
286 
287  // match an expression following an ampersand
289 
290  // match an identifier and an expression separated with a colon
292 
293  // match zero or more literal characters enclosed in grave accents
294  m_literalRule = lexeme[ lit('\x60')
295  >> *m_literalCharRule[appendUtf8(at_c<0>(_val), _1)]
296  >> lit('\x60') ];
297 
298  // match a character in the range of 0x00-0x5B or 0x5D-0x5F or
299  // 0x61-0x10FFFF or a literal escape
300  m_literalCharRule = char_(U'\x00', U'\x5B')
301  | char_(U'\x5D', U'\x5F')
302  | char_(U'\x61', U'\U0010FFFF')
304 
305  // match a grave accent preceded by an escape or match a backslash if
306  // it's not followed by a grave accent
307  m_literalEscapeRule = (m_escapeRule >> char_(U'\x60'))
308  | (char_(U'\\') >> & (!lit('`')));
309 
310  // match zero or more raw string characters enclosed in apostrophes
311  m_rawStringRule = lexeme[ lit("\'")
312  >> * (m_rawStringEscapeRule[appendEscape(at_c<0>(_val), _1)]
313  | m_rawStringCharRule[appendUtf8(at_c<0>(_val), _1)])
314  >> lit("\'") ];
315 
316  // match a single character in the range of 0x07-0x0D or 0x20-0x26 or
317  // 0x28-0x5B or 0x5D-0x10FFFF or an escaped apostrophe
318  m_rawStringCharRule = (char_(U'\x07', U'\x0D')
319  | char_(U'\x20', U'\x26')
320  | char_(U'\x28', U'\x5B')
321  | char_(U'\x5D', U'\U0010FFFF'));
322 
323  // match escape sequences
324  m_rawStringEscapeRule = char_(U'\\') >>
325  (char_(U'\x07', U'\x0D')
326  | char_(U'\x20', U'\U0010FFFF'));
327 
328  // match unquoted or quoted strings
330 
331  // match a single character in the range of 0x41-0x5A or 0x61-0x7A
332  // or 0x5F (A-Za-z_) followed by zero or more characters in the range of
333  // 0x30-0x39 (0-9) or 0x41-0x5A (A-Z) or 0x5F (_) or 0x61-0x7A (a-z)
334  // and append them to the rule's string attribute encoded as UTF-8
336  = lexeme[ ((char_(U'\x41', U'\x5A')
337  | char_(U'\x61', U'\x7A')
338  | char_(U'\x5F'))[appendUtf8(_val, _1)]
339  >> *(char_(U'\x30', U'\x39')
340  | char_(U'\x41', U'\x5A')
341  | char_(U'\x5F')
342  | char_(U'\x61', U'\x7A'))[appendUtf8(_val, _1)]) ];
343 
344  // match unescaped or escaped characters enclosed in quotes one or more
345  // times and append them to the rule's string attribute encoded as UTF-8
347  = lexeme[ m_quoteRule
349  | m_escapedCharRule)[appendUtf8(_val, _1)]
350  >> m_quoteRule ];
351 
352  // match characters in the range of 0x20-0x21 or 0x23-0x5B or
353  // 0x5D-0x10FFFF
354  m_unescapedCharRule = char_(U'\x20', U'\x21')
355  | char_(U'\x23', U'\x5B')
356  | char_(U'\x5D', U'\U0010FFFF');
357 
358  // match quotation mark literal
359  m_quoteRule = lit('\"');
360 
361  // match backslash literal
362  m_escapeRule = lit('\\');
363 
364  // match an escape character followed by quotation mark or backslash or
365  // slash or control character or surrogate pair or a single unicode
366  // escape
368  >> (char_(U'\"')
369  | char_(U'\\')
370  | char_(U'/')
373  | m_unicodeCharRule) ];
374 
375  // match a pair of unicode character escapes separated by an escape
376  // symbol if the first character's value is between 0xD800-0xDBFF
377  // and convert them into a single codepoint
380  [_pass = (_1 >= 0xD800 && _1 <= 0xDBFF),
381  _val = encodeSurrogatePair(_1, _2)] ];
382 
383  // match a unicode character escape and convert it into a
384  // single codepoint
385  m_unicodeCharRule = lexeme[ lit('u')
386  >> int_parser<UnicodeChar, 16, 4, 4>() ];
387 
388  // convert symbols into control characters
390  (U"b", U'\x08') // backspace
391  (U"f", U'\x0C') // form feed
392  (U"n", U'\x0A') // line feed
393  (U"r", U'\x0D') // carriage return
394  (U"t", U'\x09'); // tab
395  }
396 
397 private:
398  qi::rule<Iterator,
401  qi::rule<Iterator,
403  qi::locals<ast::ExpressionNode>,
404  Skipper > m_expressionRule;
405  qi::rule<Iterator,
408  qi::rule<Iterator,
411  qi::rule<Iterator,
414  qi::rule<Iterator,
417  qi::rule<Iterator,
420  qi::rule<Iterator,
422  Skipper> m_arrayItemRule;
423  qi::rule<Iterator,
426  qi::rule<Iterator,
429  qi::rule<Iterator,
432  qi::rule<Iterator,
435  qi::rule<Iterator,
438  qi::rule<Iterator,
441  qi::rule<Iterator,
444  qi::rule<Iterator,
447  qi::rule<Iterator,
450  qi::rule<Iterator,
453  qi::symbols<UnicodeChar,
455  qi::rule<Iterator,
458  qi::rule<Iterator,
461  qi::rule<Iterator,
464  qi::rule<Iterator,
467  qi::rule<Iterator,
468  std::vector<ast::FunctionExpressionNode::ArgumentType>(),
470  qi::rule<Iterator,
473  qi::rule<Iterator,
476  qi::rule<Iterator, ast::IdentifierNode(), Skipper> m_identifierRule;
477  qi::rule<Iterator, ast::RawStringNode(), Skipper> m_rawStringRule;
478  qi::rule<Iterator, ast::LiteralNode(), Skipper> m_literalRule;
479  qi::rule<Iterator, ast::CurrentNode()> m_currentNodeRule;
480  qi::rule<Iterator, UnicodeChar()> m_literalCharRule;
481  qi::rule<Iterator, UnicodeChar()> m_literalEscapeRule;
482  qi::rule<Iterator, UnicodeChar()> m_rawStringCharRule;
483  qi::rule<Iterator,
484  std::pair<UnicodeChar,
486  qi::rule<Iterator, String()> m_quotedStringRule;
487  qi::rule<Iterator, String()> m_unquotedStringRule;
488  qi::rule<Iterator, UnicodeChar()> m_unescapedCharRule;
489  qi::rule<Iterator, UnicodeChar()> m_escapedCharRule;
490  qi::rule<Iterator, UnicodeChar()> m_unicodeCharRule;
491  qi::rule<Iterator, UnicodeChar()> m_surrogatePairCharacterRule;
492  qi::rule<Iterator> m_quoteRule;
493  qi::rule<Iterator> m_escapeRule;
494  qi::symbols<UnicodeChar, UnicodeChar> m_controlCharacterSymbols;
495  qi::rule<Iterator, Index()> m_indexRule;
496 };
497 }} // namespace jmespath::parser
498 #endif // GRAMMAR_H
The NodeInsertCondition class is a functor that will either yield a true or false result based on whe...
Definition: nodeinsertcondition.h:41
qi::rule< Iterator, ast::IdentifierNode(), Skipper > m_identifierRule
Definition: grammar.h:476
The ComparatorExpressionNode class represents a JMESPath comparator expression.
Definition: comparatorexpressionnode.h:39
The ListWildcardNode class represents a JMESPath list wildcard expression.
Definition: listwildcardnode.h:38
qi::rule< Iterator, ast::ExpressionNode(), Skipper > m_topLevelExpressionRule
Definition: grammar.h:400
qi::rule< Iterator, UnicodeChar()> m_escapedCharRule
Definition: grammar.h:489
qi::rule< Iterator, ast::ParenExpressionNode(), Skipper > m_parenExpressionRule
Definition: grammar.h:463
qi::rule< Iterator, ast::PipeExpressionNode(ast::ExpressionNode &), Skipper > m_pipeExpressionRule
Definition: grammar.h:449
qi::rule< Iterator, ast::CurrentNode()> m_currentNodeRule
Definition: grammar.h:479
qi::rule< Iterator, ast::SliceExpressionNode(), Skipper > m_sliceExpressionRule
Definition: grammar.h:431
qi::rule< Iterator, ast::FilterExpressionNode(), Skipper > m_filterExpressionRule
Definition: grammar.h:428
The HashWildcardNode class represents a JMESPath hash wildcard expression.
Definition: hashwildcardnode.h:38
The BracketSpecifierNode class represents a JMESPath bracket specifier.
Definition: bracketspecifiernode.h:44
qi::rule< Iterator, ast::ArrayItemNode(), Skipper > m_arrayItemRule
Definition: grammar.h:422
qi::rule< Iterator, ast::ComparatorExpressionNode(ast::ExpressionNode &), Skipper > m_comparatorExpressionRule
Definition: grammar.h:452
qi::rule< Iterator, UnicodeChar()> m_unicodeCharRule
Definition: grammar.h:490
qi::rule< Iterator, ast::ListWildcardNode(), Skipper > m_listWildcardRule
Definition: grammar.h:434
qi::rule< Iterator, ast::OrExpressionNode(ast::ExpressionNode &), Skipper > m_orExpressionRule
Definition: grammar.h:457
The AndExpressionNode class represents a JMESPath and expression.
Definition: andexpressionnode.h:38
boost::variant< boost::blank, boost::recursive_wrapper< ExpressionNode >, boost::recursive_wrapper< ExpressionArgumentNode > > ArgumentType
Definition: functionexpressionnode.h:50
qi::rule< Iterator, ast::ExpressionArgumentNode(), Skipper > m_expressionArgumentRule
Definition: grammar.h:475
qi::rule< Iterator, String()> m_quotedStringRule
Definition: grammar.h:486
qi::rule< Iterator, UnicodeChar()> m_literalCharRule
Definition: grammar.h:480
The SliceExpressionNode class represents a JMESPath slice expression.
Definition: sliceexpressionnode.h:41
The NodeInsertPolicy class is a functor for inserting a given node into the AST.
Definition: nodeinsertpolicy.h:38
qi::rule< Iterator, ast::FunctionExpressionNode::ArgumentType(), Skipper > m_functionArgumentRule
Definition: grammar.h:472
The MultiselectHashNode class represents a JMESPath multiselect hash expression.
Definition: multiselecthashnode.h:45
The PipeExpressionNode class represents a JMESPath pipe expression.
Definition: pipeexpressionnode.h:38
qi::rule< Iterator, ast::AndExpressionNode(ast::ExpressionNode &), Skipper > m_andExpressionRule
Definition: grammar.h:460
qi::rule< Iterator, ast::HashWildcardNode(ast::ExpressionNode &), Skipper > m_hashWildcardSubexpressionRule
Definition: grammar.h:416
The Grammar class contains the PEG rule definition based on the EBNF specifications of JMESPath...
Definition: grammar.h:63
qi::rule< Iterator, ast::LiteralNode(), Skipper > m_literalRule
Definition: grammar.h:478
qi::rule< Iterator, ast::IndexExpressionNode(ast::ExpressionNode &), Skipper > m_indexExpressionRule
Definition: grammar.h:410
The SubexpressionNode class represents a JMESPath subexpression.
Definition: subexpressionnode.h:37
The ExpressionArgumentNode class represents a JMESPath expression argument.
Definition: expressionargumentnode.h:40
The InsertNodeAction class is a functor for inserting the given node into the AST whose root node is ...
Definition: insertnodeaction.h:59
qi::rule< Iterator, ast::FlattenOperatorNode(), Skipper > m_flattenOperatorRule
Definition: grammar.h:425
qi::rule< Iterator > m_escapeRule
Definition: grammar.h:493
qi::rule< Iterator, ast::NotExpressionNode(ast::ExpressionNode &), Skipper > m_notExpressionRule
Definition: grammar.h:446
qi::rule< Iterator, ast::MultiselectHashNode::KeyValuePairType(), Skipper > m_keyValuePairRule
Definition: grammar.h:443
qi::rule< Iterator, ast::ExpressionNode(), qi::locals< ast::ExpressionNode >, Skipper > m_expressionRule
Definition: grammar.h:404
qi::rule< Iterator, ast::MultiselectHashNode(), Skipper > m_multiselectHashRule
Definition: grammar.h:440
qi::rule< Iterator, String()> m_unquotedStringRule
Definition: grammar.h:487
qi::rule< Iterator, UnicodeChar()> m_unescapedCharRule
Definition: grammar.h:488
The FilterExpressionNode class represents a JMESPath filter expression.
Definition: filterexpressionnode.h:39
qi::rule< Iterator, ast::HashWildcardNode(ast::ExpressionNode &), Skipper > m_hashWildcardRule
Definition: grammar.h:413
qi::rule< Iterator, ast::RawStringNode(), Skipper > m_rawStringRule
Definition: grammar.h:477
qi::rule< Iterator, std::pair< UnicodeChar, UnicodeChar >)> m_rawStringEscapeRule
Definition: grammar.h:485
Comparator
The Comparator enum defines the available comparison operators.
Definition: comparatorexpressionnode.h:45
The OrExpressionNode class represents a JMESPath or expression.
Definition: orexpressionnode.h:38
qi::rule< Iterator, Index()> m_indexRule
Definition: grammar.h:495
qi::rule< Iterator, ast::BracketSpecifierNode(), Skipper > m_bracketSpecifierRule
Definition: grammar.h:419
Grammar()
Constructs a Grammar object.
Definition: grammar.h:71
The IndexExpressionNode class represents a JMESPath index expression.
Definition: indexexpressionnode.h:39
qi::symbols< UnicodeChar, UnicodeChar > m_controlCharacterSymbols
Definition: grammar.h:494
The NotExpressionNode class represents a JMESPath not expression.
Definition: notexpressionnode.h:39
qi::rule< Iterator, ast::FunctionExpressionNode(), Skipper > m_functionExpressionRule
Definition: grammar.h:466
qi::rule< Iterator, UnicodeChar()> m_rawStringCharRule
Definition: grammar.h:482
The ArrayItemNode class represents a JMESPath array index expression.
Definition: arrayitemnode.h:40
The FlattenOperatorNode class represents a JMESPath flatten operator.
Definition: flattenoperatornode.h:39
The MultiselectListNode class represents a JMESPath list wildcard expression.
Definition: multiselectlistnode.h:42
The ExpressionNode class represents a JMESPath expression.
Definition: expressionnode.h:56
std::pair< IdentifierNode, ExpressionNode > KeyValuePairType
Definition: multiselecthashnode.h:48
qi::symbols< UnicodeChar, ast::ComparatorExpressionNode::Comparator > m_comparatorSymbols
Definition: grammar.h:454
qi::rule< Iterator, UnicodeChar()> m_literalEscapeRule
Definition: grammar.h:481
qi::rule< Iterator, UnicodeChar()> m_surrogatePairCharacterRule
Definition: grammar.h:491
qi::rule< Iterator, std::vector< ast::FunctionExpressionNode::ArgumentType >), Skipper > m_functionArgumentListRule
Definition: grammar.h:469
qi::rule< Iterator > m_quoteRule
Definition: grammar.h:492
qi::rule< Iterator, ast::MultiselectListNode(), Skipper > m_multiselectListRule
Definition: grammar.h:437
The ParenExpressionNode class represents a JMESPath paren expression.
Definition: parenexpressionnode.h:38
char32_t UnicodeChar
32 bit character type
Definition: types.h:48
qi::rule< Iterator, ast::SubexpressionNode(ast::ExpressionNode &), Skipper > m_subexpressionRule
Definition: grammar.h:407
The FunctionExpressionNode class represents a JMESPath function expression.
Definition: functionexpressionnode.h:45