32 #include <boost/spirit/include/qi.hpp>
34 namespace jmespath {
namespace parser {
36 namespace qi = boost::spirit::qi;
37 namespace encoding = qi::unicode;
43 template <
template<
typename,
typename>
class T>
58 using ResultType =
typename GrammarType::start_type::attr_type;
79 bool parsingSuccesful = qi::phrase_parse(it, endIt,
84 if (!parsingSuccesful || (it != endIt))
87 auto syntaxErrorLocation = std::distance(beginIt, it);
90 BOOST_THROW_EXCEPTION(exception);
boost::error_info< struct tag_syntax_error_location, long > InfoSyntaxErrorLocation
InfoSyntaxErrorLocation contains the location of the syntax error in the JMESPath expression...
Definition: exceptions.h:50
The Parser class parses expressions with the specified grammar.
Definition: parser.h:44
ResultType parse(const String &expression)
Parses the given expression.
Definition: parser.h:67
UnicodeIteratorAdaptor IteratorType
Iterator type which will be used to instantiate the grammar.
Definition: parser.h:50
std::basic_string< Char > String
UTF-8 encoded string type.
Definition: types.h:44
boost::error_info< struct tag_search_expression, std::string > InfoSearchExpression
InfoSearchExpression contains the JMESPath expression being evaluated.
Definition: exceptions.h:43
GrammarType m_grammar
Grammar object used for parsing.
Definition: parser.h:105
typename GrammarType::start_type::attr_type ResultType
The type of the result of parsing.
Definition: parser.h:58
The SyntaxError struct represents a syntax error in the evaluated expression.
Definition: exceptions.h:80
T< IteratorType, encoding::space_type > GrammarType
The type of the grammar that will be instantiated.
Definition: parser.h:54
The Exception struct is the common base class for for all the exceptions thrown by the library...
Definition: exceptions.h:67
boost::u8_to_u32_iterator< String::const_iterator > UnicodeIteratorAdaptor
UTF-32 string iterator adaptor.
Definition: types.h:57