|
RESTinio
|
Namespaces | |
| namespace | impl |
Classes | |
| class | parse_error_t |
| Information about parsing error. More... | |
| struct | nothing_t |
| A special type to be used in the case where there is no need to store produced value. More... | |
| struct | result_value_wrapper |
| A template with specializations for different kind of result values and for type nothing. More... | |
| struct | result_wrapper_for |
| A metafunction for detection of actual result_value_wrapper type for T. More... | |
| struct | result_value_wrapper< std::vector< T, Args... > > |
| struct | result_value_wrapper< std::array< T, S > > |
| struct | result_wrapper_for< impl::std_array_wrapper< T, S > > |
| A specialization of result_wrapper_for metafunction for the case of std::array wrapper. More... | |
| struct | result_value_wrapper< std::basic_string< Char, Args... > > |
| struct | result_value_wrapper< std::map< K, V, Args... > > |
| struct | result_value_wrapper< nothing_t > |
| class | digits_to_consume_t |
| Limits for number of digits to be extracted during parsing of decimal numbers. More... | |
Typedefs | |
| template<typename T> | |
| using | result_wrapper_for_t = typename result_wrapper_for<T>::type |
Enumerations | |
| enum class | error_reason_t { unexpected_character , unexpected_eof , no_appropriate_alternative , pattern_not_found , unconsumed_input , illegal_value_found , force_only_this_alternative_failed } |
| Reason of parsing error. More... | |
Functions | |
| constexpr digits_to_consume_t | expected_digits (digits_to_consume_t::underlying_int_t total) noexcept |
| Create a limit for number of digits to be extracted. | |
| constexpr digits_to_consume_t | expected_digits (digits_to_consume_t::underlying_int_t min, digits_to_consume_t::underlying_int_t max) noexcept |
| Create a limit for number of digits to be extracted. | |
| template<typename Target_Type, typename... Clauses> | |
| auto | produce (Clauses &&... clauses) |
| A factory function to create a producer that creates an instance of the target type by using specified clauses. | |
| template<typename... Clauses> | |
| auto | alternatives (Clauses &&... clauses) |
| A factory function to create an alternatives clause. | |
| template<typename... Clauses> | |
| auto | maybe (Clauses &&... clauses) |
| A factory function to create an optional clause. | |
| template<typename... Clauses> | |
| auto | not_clause (Clauses &&... clauses) |
| A factory function to create a not_clause. | |
| template<typename... Clauses> | |
| auto | and_clause (Clauses &&... clauses) |
| A factory function to create an and_clause. | |
| template<typename... Clauses> | |
| auto | sequence (Clauses &&... clauses) |
| A factory function to create a sequence of subclauses. | |
| template<typename... Clauses> | |
| auto | force_only_this_alternative (Clauses &&... clauses) |
| An alternative that should be parsed correctly or the parsing of the whole alternatives clause should fail. | |
| template<typename... Clauses> | |
| auto | repeat (std::size_t min_occurences, std::size_t max_occurences, Clauses &&... clauses) |
| A factory function to create repetitor of subclauses. | |
| auto | skip () noexcept |
| A factory function to create a skip_consumer. | |
| auto | any_symbol_p () noexcept |
| A factory function to create an any_symbol_producer. | |
| auto | symbol_p (char expected) noexcept |
| A factory function to create a symbol_producer. | |
| auto | any_symbol_if_not_p (char sentinel) noexcept |
| A factory function to create a any_symbol_if_not_producer. | |
| auto | caseless_symbol_p (char expected) noexcept |
| A factory function to create a caseless_symbol_producer. | |
| auto | symbol_from_range_p (char left, char right) noexcept |
| A factory function to create a symbol_from_range_producer. | |
| auto | symbol (char expected) noexcept |
| A factory function to create a clause that expects the speficied symbol, extracts it and then skips it. | |
| auto | caseless_symbol (char expected) noexcept |
| A factory function to create a clause that expects the speficied symbol, extracts it and then skips it. | |
| auto | symbol_from_range (char left, char right) noexcept |
| A factory function to create a clause that expects a symbol from specified range, extracts it and then skips it. | |
| auto | space_p () noexcept |
| A factory function to create a space_producer. | |
| auto | space () noexcept |
| A factory function to create a clause that expects a space, extracts it and then skips it. | |
| auto | digit_p () noexcept |
| A factory function to create a digit_producer. | |
| auto | digit () noexcept |
| A factory function to create a clause that expects a decimal digit, extracts it and then skips it. | |
| auto | hexdigit_p () noexcept |
| A factory function to create a hexdigit_producer. | |
| auto | hexdigit () noexcept |
| A factory function to create a clause that expects a hexadecimal digit, extracts it and then skips it. | |
| template<typename T> | |
| auto | non_negative_decimal_number_p () noexcept |
| A factory function to create a non_negative_decimal_number_producer. | |
| template<typename T> | |
| auto | non_negative_decimal_number_p (digits_to_consume_t digits_limit) noexcept |
| A factory function to create a non_negative_decimal_number_producer. | |
| template<typename T> | |
| auto | hexadecimal_number_p () noexcept |
| A factory function to create a hexadecimal_number_producer. | |
| template<typename T> | |
| auto | hexadecimal_number_p (digits_to_consume_t digits_limit) noexcept |
| A factory function to create a hexadecimal_number_producer. | |
| template<typename T> | |
| auto | decimal_number_p () noexcept |
| A factory function to create a decimal_number_producer. | |
| template<typename T> | |
| auto | decimal_number_p (digits_to_consume_t digits_limit) noexcept |
| A factory function to create a decimal_number_producer. | |
| auto | as_result () noexcept |
| A factory function to create a as_result_consumer. | |
| template<typename F> | |
| auto | custom_consumer (F consumer) |
| A factory function to create a custom_consumer. | |
| auto | to_container () |
| A factory function to create a to_container_consumer. | |
| auto | to_lower () noexcept |
| A factory function to create a to_lower_transformer. | |
| template<typename T> | |
| auto | just (T value) noexcept(noexcept(impl::just_value_transformer_t< T >{value})) |
| A special transformer that replaces the produced value by a value specified by a user. | |
| template<typename T> | |
| auto | just_result (T value) noexcept(noexcept(impl::just_result_consumer_t< T >{value})) |
| A special consumer that replaces the produced value by a value specified by a user and sets that user-specified value as the result. | |
| template<typename Converter> | |
| auto | convert (Converter &&converter) |
| A factory function to create convert_transformer. | |
| auto | exact_p (string_view_t fragment) |
| A factory function that creates an instance of exact_fragment_producer. | |
| template<std::size_t Size> | |
| auto | exact_p (const char(&fragment)[Size]) |
| A factory function that creates an instance of exact_fragment_producer. | |
| auto | exact (string_view_t fragment) |
| A factory function that creates an instance of exact_fragment clause. | |
| template<std::size_t Size> | |
| auto | exact (const char(&fragment)[Size]) |
| A factory function that creates an instance of exact_fragment clause. | |
| auto | caseless_exact_p (string_view_t fragment) |
| A factory function that creates an instance of caseless_exact_fragment_producer. | |
| template<std::size_t Size> | |
| auto | caseless_exact_p (const char(&fragment)[Size]) |
| A factory function that creates an instance of caseless_exact_fragment_producer. | |
| auto | caseless_exact (string_view_t fragment) |
| A factory function that creates an instance of caseless_exact_fragment clause. | |
| template<std::size_t Size> | |
| auto | caseless_exact (const char(&fragment)[Size]) |
| A factory function that creates an instance of caseless_exact_fragment clause. | |
| template<typename Producer> | |
| expected_t< typename Producer::result_type, parse_error_t > | try_parse (string_view_t from, Producer producer) |
| Perform the parsing of the specified content by using specified value producer. | |
| std::string | make_error_description (const parse_error_t &error, string_view_t from) |
| Make textual description of error returned by try_parse function. | |
Variables | |
| constexpr std::size_t | N = std::numeric_limits<std::size_t>::max() |
| A special marker that means infinite repetitions. | |
| using restinio::easy_parser::result_wrapper_for_t = typename result_wrapper_for<T>::type |
Definition at line 253 of file easy_parser.hpp.
|
strong |
Reason of parsing error.
| Enumerator | |
|---|---|
| unexpected_character | Unexpected character is found in the input. |
| unexpected_eof | Unexpected end of input is encontered when some character expected. |
| no_appropriate_alternative | None of alternatives was found in the input. |
| pattern_not_found | Required pattern is not found in the input. |
| unconsumed_input | There are some unconsumed non-whitespace characters in the input after the completion of parsing. |
| illegal_value_found | Illegal value was found in the input.
|
| force_only_this_alternative_failed | A failure of parsing an alternative marked as "force only this alternative". This error code is intended for internal use for the implementation of alternatives() and force_only_this_alternative() stuff. This error tells the parser that other alternatives should not be checked and the parsing of the whole alternatives clause should failed too.
|
Definition at line 54 of file easy_parser.hpp.
|
nodiscard |
A factory function to create an alternatives clause.
Usage example:
Please note the usage of sequence() inside the call to alternatives().
| Clauses | the list of clauses to be used as alternatives. |
Definition at line 3598 of file easy_parser.hpp.
|
nodiscard |
A factory function to create an and_clause.
Usage example:
this expression corresponds the following rule:
T := token SP token &(',' [' '] token)
| Clauses | the list of clauses to be used as sequence to be checked. |
Definition at line 3721 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a any_symbol_if_not_producer.
Definition at line 3976 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create an any_symbol_producer.
Definition at line 3940 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a as_result_consumer.
Usage example:
Definition at line 4453 of file easy_parser.hpp.
|
nodiscard |
A factory function that creates an instance of caseless_exact_fragment clause.
Usage example:
Definition at line 4983 of file easy_parser.hpp.
|
inlinenodiscard |
A factory function that creates an instance of caseless_exact_fragment clause.
Usage example:
Definition at line 4945 of file easy_parser.hpp.
|
nodiscard |
A factory function that creates an instance of caseless_exact_fragment_producer.
Usage example:
Definition at line 4924 of file easy_parser.hpp.
|
inlinenodiscard |
A factory function that creates an instance of caseless_exact_fragment_producer.
Usage example:
Definition at line 4880 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects the speficied symbol, extracts it and then skips it.
This clause performs caseless comparison of characters.
The call to caseless_symbol('a') function is an equivalent of:
Definition at line 4058 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a caseless_symbol_producer.
This producer performs caseless comparison of characters.
Definition at line 3996 of file easy_parser.hpp.
|
nodiscard |
A factory function to create convert_transformer.
Usage example:
Definition at line 4720 of file easy_parser.hpp.
|
nodiscard |
A factory function to create a custom_consumer.
Usage example:
Definition at line 4499 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a decimal_number_producer.
Parses numbers in the form:
number := [sign] DIGIT+ sign := '-' | '+'
Definition at line 4370 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a decimal_number_producer.
Parses numbers in the form:
number := [sign] DIGIT+ sign := '-' | '+'
Usage example:
Definition at line 4423 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects a decimal digit, extracts it and then skips it.
The call to digit() function is an equivalent of:
Definition at line 4157 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a digit_producer.
Definition at line 4136 of file easy_parser.hpp.
|
nodiscard |
A factory function that creates an instance of exact_fragment clause.
Usage example:
Definition at line 4854 of file easy_parser.hpp.
|
inlinenodiscard |
A factory function that creates an instance of exact_fragment clause.
Usage example:
Definition at line 4816 of file easy_parser.hpp.
|
nodiscard |
A factory function that creates an instance of exact_fragment_producer.
Usage example:
Definition at line 4795 of file easy_parser.hpp.
|
inlinenodiscard |
A factory function that creates an instance of exact_fragment_producer.
Usage example:
Definition at line 4751 of file easy_parser.hpp.
|
inlinenodiscardconstexprnoexcept |
Create a limit for number of digits to be extracted.
Makes a limit where min and max are specified separately.
Usage example:
Definition at line 573 of file easy_parser.hpp.
|
inlinenodiscardconstexprnoexcept |
Create a limit for number of digits to be extracted.
Makes a limit where min==max and both are equal to total.
Usage example:
Definition at line 552 of file easy_parser.hpp.
|
nodiscard |
An alternative that should be parsed correctly or the parsing of the whole alternatives clause should fail.
This special clause is intended to be used to avoid mistakes in grammars like that:
v = "key" '=' token | token '=' 1*VCHAR
If that grammar will be used for parsing a sentence like "key=123" then the second alternative will be selected. It's because the parsing of rule "key" '=' token fails at 123 and the second alternative will be tried. And "key" will be recognized as a token.
Before v.0.6.7 this mistake can be avoided by using rules like those:
v = "key" '=' token | !"key" token '=' 1*VCHAR
Since v.0.6.7 this mistake can be avoided by using force_only_this_alternative() function:
Definition at line 3824 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a hexadecimal_number_producer.
Definition at line 4290 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a hexadecimal_number_producer.
Usage example:
Definition at line 4332 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects a hexadecimal digit, extracts it and then skips it.
The call to hexdigit() function is an equivalent of:
Definition at line 4196 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a hexdigit_producer.
Definition at line 4175 of file easy_parser.hpp.
|
nodiscardnoexcept |
A special transformer that replaces the produced value by a value specified by a user.
Usage example:
Definition at line 4618 of file easy_parser.hpp.
|
nodiscardnoexcept |
A special consumer that replaces the produced value by a value specified by a user and sets that user-specified value as the result.
Usage example:
Definition at line 4647 of file easy_parser.hpp.
|
inlinenodiscard |
Make textual description of error returned by try_parse function.
Usage example:
Definition at line 5086 of file easy_parser.hpp.
|
nodiscard |
A factory function to create an optional clause.
Usage example:
| Clauses | the list of clauses to be used as optional sequence. |
Definition at line 3637 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a non_negative_decimal_number_producer.
Definition at line 4221 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a non_negative_decimal_number_producer.
Usage example:
Definition at line 4260 of file easy_parser.hpp.
|
nodiscard |
A factory function to create a not_clause.
Usage example:
this expression corresponds the following rule:
T := token SP token !'.'
| Clauses | the list of clauses to be used as sequence to be checked. |
Definition at line 3679 of file easy_parser.hpp.
|
nodiscard |
A factory function to create a producer that creates an instance of the target type by using specified clauses.
Usage example:
| Target_Type | the type of value to be produced. |
| Clauses | the list of clauses to be used for a new value. |
Definition at line 3557 of file easy_parser.hpp.
|
nodiscard |
A factory function to create repetitor of subclauses.
Usage example:
this expression corresponds to the following rule:
T := token '=' token *(',' token '=' token)
| Clauses | the list of clauses to be used as the sequence to be repeated. |
| min_occurences | Minimal occurences of the sequences in the repetition. |
| max_occurences | Maximal occurences of the sequences in the repetition. |
| clauses | The sequence of clauses to be repeated. |
Definition at line 3879 of file easy_parser.hpp.
|
nodiscard |
A factory function to create a sequence of subclauses.
Usage example:
Please note the usage of sequence() inside the call to alternatives().
| Clauses | the list of clauses to be used as the sequence. |
Definition at line 3761 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a skip_consumer.
Usage example:
Definition at line 3925 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects a space, extracts it and then skips it.
The call to space() function is an equivalent of:
Definition at line 4118 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a space_producer.
Definition at line 4097 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects the speficied symbol, extracts it and then skips it.
The call to symbol('a') function is an equivalent of:
Definition at line 4035 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a clause that expects a symbol from specified range, extracts it and then skips it.
The call to symbol_from_range('a', 'z') function is an equivalent of:
Definition at line 4079 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a symbol_from_range_producer.
Definition at line 4014 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a symbol_producer.
Definition at line 3958 of file easy_parser.hpp.
|
inlinenodiscard |
A factory function to create a to_container_consumer.
Usage example:
Definition at line 4566 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
A factory function to create a to_lower_transformer.
Usage example:
Definition at line 4593 of file easy_parser.hpp.
|
nodiscard |
Perform the parsing of the specified content by using specified value producer.
Usage example
Definition at line 5025 of file easy_parser.hpp.
|
constexpr |
A special marker that means infinite repetitions.
Definition at line 458 of file easy_parser.hpp.