RESTinio
|
An very small, simple and somewhat limited implementation of recursive-descent parser. More...
#include <restinio/impl/to_lower_lut.hpp>
#include <restinio/impl/overflow_controlled_integer_accumulator.hpp>
#include <restinio/utils/tuple_algorithms.hpp>
#include <restinio/utils/metaprogramming.hpp>
#include <restinio/string_view.hpp>
#include <restinio/compiler_features.hpp>
#include <restinio/exception.hpp>
#include <restinio/optional.hpp>
#include <restinio/expected.hpp>
#include <iostream>
#include <limits>
#include <map>
#include <array>
#include <vector>
#include <cstring>
Go to the source code of this file.
Classes | |
class | restinio::easy_parser::parse_error_t |
Information about parsing error. More... | |
struct | restinio::easy_parser::nothing_t |
A special type to be used in the case where there is no need to store produced value. More... | |
struct | restinio::easy_parser::result_value_wrapper< T > |
A template with specializations for different kind of result values and for type nothing . More... | |
struct | restinio::easy_parser::result_wrapper_for< T > |
A metafunction for detection of actual result_value_wrapper type for T. More... | |
struct | restinio::easy_parser::result_value_wrapper< std::vector< T, Args... > > |
struct | restinio::easy_parser::impl::std_array_wrapper< T, S > |
A special wrapper for std::array type to be used inside a producer during the parsing. More... | |
struct | restinio::easy_parser::result_value_wrapper< std::array< T, S > > |
struct | restinio::easy_parser::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 | restinio::easy_parser::result_value_wrapper< std::basic_string< Char, Args... > > |
struct | restinio::easy_parser::result_value_wrapper< std::map< K, V, Args... > > |
struct | restinio::easy_parser::result_value_wrapper< nothing_t > |
class | restinio::easy_parser::digits_to_consume_t |
Limits for number of digits to be extracted during parsing of decimal numbers. More... | |
struct | restinio::easy_parser::impl::character_t |
One character extracted from the input stream. More... | |
struct | restinio::easy_parser::impl::is_space_predicate_t |
A preducate for symbol_producer_template that checks that a symbol is a space. More... | |
struct | restinio::easy_parser::impl::is_digit_predicate_t |
A predicate for cases where char to be expected to be a decimal digit. More... | |
struct | restinio::easy_parser::impl::is_hexdigit_predicate_t |
A predicate for cases where char to be expected to be a hexadecimal digit. More... | |
class | restinio::easy_parser::impl::source_t |
The class that implements "input stream". More... | |
class | restinio::easy_parser::impl::source_t::content_consumer_t |
A helper class to automatically return acquired content back to the input stream. More... | |
struct | restinio::easy_parser::impl::producer_tag< Result_Type > |
A special base class to be used with producers. More... | |
struct | restinio::easy_parser::impl::is_producer< T, typename > |
struct | restinio::easy_parser::impl::is_producer< T, meta::void_t< decltype(T::entity_type) > > |
struct | restinio::easy_parser::impl::transformer_tag< Result_Type > |
A special base class to be used with transformers. More... | |
struct | restinio::easy_parser::impl::is_transformer< T, typename > |
struct | restinio::easy_parser::impl::is_transformer< T, meta::void_t< decltype(T::entity_type) > > |
struct | restinio::easy_parser::impl::transformer_invoker< Result_Type > |
A helper template for calling transformation function. More... | |
struct | restinio::easy_parser::impl::transformer_invoker< expected_t< Result_Type, error_reason_t > > |
struct | restinio::easy_parser::impl::is_appropriate_transformer_result_type< Result_Type > |
A metafunction that checks is Result_Type can be used as the result of transformation method. More... | |
struct | restinio::easy_parser::impl::is_appropriate_transformer_result_type< expected_t< Result_Type, error_reason_t > > |
struct | restinio::easy_parser::impl::is_appropriate_transformer_result_type< expected_t< Result_Type, parse_error_t > > |
struct | restinio::easy_parser::impl::transformed_value_producer_traits_checker< Producer, Transformer > |
A helper template for checking a possibility to connect a producer with a transformer. More... | |
class | restinio::easy_parser::impl::transformed_value_producer_t< Producer, Transformer > |
A template of producer that gets a value from another producer, transforms it and produces transformed value. More... | |
struct | restinio::easy_parser::impl::transformer_proxy_tag |
A special base class to be used with transformer-proxies. More... | |
struct | restinio::easy_parser::impl::is_transformer_proxy< T, typename > |
struct | restinio::easy_parser::impl::is_transformer_proxy< T, meta::void_t< decltype(T::entity_type) > > |
struct | restinio::easy_parser::impl::consumer_tag |
A special base class to be used with consumers. More... | |
struct | restinio::easy_parser::impl::is_consumer< T, typename > |
struct | restinio::easy_parser::impl::is_consumer< T, meta::void_t< decltype(T::entity_type) > > |
struct | restinio::easy_parser::impl::clause_tag |
A special base class to be used with clauses. More... | |
struct | restinio::easy_parser::impl::is_clause< T, typename > |
struct | restinio::easy_parser::impl::is_clause< T, meta::void_t< decltype(std::decay_t< T >::entity_type) > > |
class | restinio::easy_parser::impl::consume_value_clause_t< P, C > |
A template for a clause that binds a value producer with value consumer. More... | |
class | restinio::easy_parser::impl::top_level_clause_t< Producer > |
A special class to be used as the top level clause in parser. More... | |
class | restinio::easy_parser::impl::alternatives_clause_t< Subitems_Tuple > |
A template for implementation of clause that selects one of alternative clauses. More... | |
class | restinio::easy_parser::impl::maybe_clause_t< Subitems_Tuple > |
A template for implementation of clause that checks and handles presence of optional entity in the input stream. More... | |
class | restinio::easy_parser::impl::not_clause_t< Subitems_Tuple > |
A template for implementation of clause that checks absence of some entity in the input stream. More... | |
class | restinio::easy_parser::impl::and_clause_t< Subitems_Tuple > |
A template for implementation of clause that checks the presence of some entity in the input stream. More... | |
class | restinio::easy_parser::impl::sequence_clause_t< Subitems_Tuple > |
A template for implementation of clause that checks and handles presence of sequence of entities in the input stream. More... | |
class | restinio::easy_parser::impl::forced_alternative_clause_t< Subitems_Tuple > |
An alternative that should be parsed correctly or the parsing of the whole alternatives clause should fail. More... | |
class | restinio::easy_parser::impl::produce_t< Target_Type, Subitems_Tuple > |
A template for producing a value of specific type of a sequence of entities from the input stream. More... | |
class | restinio::easy_parser::impl::repeat_clause_t< Subitems_Tuple > |
A template for handling repetition of clauses. More... | |
class | restinio::easy_parser::impl::symbol_producer_template_t< Predicate > |
A template for producer of charachers that satisfy some predicate. More... | |
struct | restinio::easy_parser::impl::any_symbol_predicate_t |
A predicate that allows extraction of any symbol. More... | |
struct | restinio::easy_parser::impl::particular_symbol_predicate_t |
A predicate for cases where exact match of expected and actual symbols is required. More... | |
struct | restinio::easy_parser::impl::not_particular_symbol_predicate_t |
A predicate for cases where mismatch with a particular symbol is required. More... | |
struct | restinio::easy_parser::impl::caseless_particular_symbol_predicate_t |
A predicate for cases where the case-insensitive match of expected and actual symbols is required. More... | |
struct | restinio::easy_parser::impl::symbol_from_range_predicate_t |
A predicate for cases where a symbol should belong to specified range. More... | |
class | restinio::easy_parser::impl::symbol_producer_t |
A producer for the case when a particual character is expected in the input stream. More... | |
class | restinio::easy_parser::impl::any_symbol_if_not_producer_t |
A producer for the case when any character except the specific sentinel character is expected in the input stream. More... | |
class | restinio::easy_parser::impl::caseless_symbol_producer_t |
A producer for the case when a particual character is expected in the input stream. More... | |
class | restinio::easy_parser::impl::symbol_from_range_producer_t |
A producer for the case when a symbol should belong to specified range. More... | |
class | restinio::easy_parser::impl::digit_producer_t |
A producer for the case when a decimal digit is expected in the input stream. More... | |
class | restinio::easy_parser::impl::hexdigit_producer_t |
A producer for the case when a hexadecimal digit is expected in the input stream. More... | |
class | restinio::easy_parser::impl::non_negative_decimal_number_producer_t< T > |
A producer for the case when a non-negative decimal number is expected in the input stream. More... | |
class | restinio::easy_parser::impl::non_negative_decimal_number_producer_with_digits_limit_t< T > |
A producer for the case when a non-negative decimal number is expected in the input stream. More... | |
class | restinio::easy_parser::impl::hexadecimal_number_producer_t< T > |
A producer for the case when a number in hexadecimal form is expected in the input stream. More... | |
class | restinio::easy_parser::impl::hexadecimal_number_producer_with_digits_limit_t< T > |
A producer for the case when a number in hexadecimal form is expected in the input stream. More... | |
class | restinio::easy_parser::impl::decimal_number_producer_t< T > |
A producer for the case when a signed decimal number is expected in the input stream. More... | |
class | restinio::easy_parser::impl::decimal_number_producer_with_digits_limit_t< T > |
A producer for the case when a signed decimal number is expected in the input stream. More... | |
struct | restinio::easy_parser::impl::any_value_skipper_t |
A special consumer that simply throws any value away. More... | |
struct | restinio::easy_parser::impl::as_result_consumer_t |
A consumer for the case when the current value should be returned as the result for the producer at one level up. More... | |
class | restinio::easy_parser::impl::just_result_consumer_t< Result_Type > |
A consumer for the case when a specific value should be used as the result instead of the value produced on the previous step. More... | |
class | restinio::easy_parser::impl::custom_consumer_t< C > |
A template for consumers that are released by lambda/functional objects. More... | |
class | restinio::easy_parser::impl::field_setter_consumer_t< F, C > |
A template for consumers that store a value to the specified field of a target object. More... | |
struct | restinio::easy_parser::impl::tuple_item_consumer_t< Index > |
A consumer that stores a result value at the specified index in the result tuple. More... | |
struct | restinio::easy_parser::impl::to_lower_transformer_t< std::string > |
An implementation of transformer that converts the content of the input std::string to lower case. More... | |
struct | restinio::easy_parser::impl::to_lower_transformer_t< char > |
An implementation of transformer that converts the content of the input character to lower case. More... | |
struct | restinio::easy_parser::impl::to_lower_transformer_t< std::array< char, S > > |
An implementation of transformer that converts the content of the input std::array to lower case. More... | |
struct | restinio::easy_parser::impl::to_lower_transformer_proxy_t |
A proxy for the creation of an appropriate to_lower_transformer. More... | |
class | restinio::easy_parser::impl::just_value_transformer_t< T > |
A transformer that skips incoming value and returns a value specified by a user. More... | |
class | restinio::easy_parser::impl::convert_transformer_t< Output_Type, Converter > |
A transformator that uses a user supplied function/functor for conversion a value from one type to another. More... | |
struct | restinio::easy_parser::impl::conversion_result_type_detector< Result_Type > |
A helper template for the detection of type to be produced as conversion procedure. More... | |
struct | restinio::easy_parser::impl::conversion_result_type_detector< expected_t< Result_Type, error_reason_t > > |
class | restinio::easy_parser::impl::convert_transformer_proxy_t< Converter > |
A proxy for the creation of convert_transformer instances for a specific value producers. More... | |
class | restinio::easy_parser::impl::exact_fixed_size_fragment_producer_t< Size > |
A producer that expects a fragment in the input and produces boolean value if that fragment is found. More... | |
class | restinio::easy_parser::impl::exact_fragment_producer_t |
A producer that expects a fragment in the input and produces boolean value if that fragment is found. More... | |
class | restinio::easy_parser::impl::caseless_exact_fixed_size_fragment_producer_t< Size > |
A producer that expects a fragment in the input and produces boolean value if that fragment is found. More... | |
class | restinio::easy_parser::impl::caseless_exact_fragment_producer_t |
A producer that expects a fragment in the input and produces boolean value if that fragment is found. More... | |
struct | restinio::easy_parser::impl::to_container_consumer_t |
A template for a consumer that stories values into a container. More... | |
Namespaces | |
namespace | restinio |
namespace | restinio::easy_parser |
namespace | restinio::easy_parser::impl |
Typedefs | |
template<typename T > | |
using | restinio::easy_parser::result_wrapper_for_t = typename result_wrapper_for< T >::type |
template<typename... Entities> | |
using | restinio::easy_parser::impl::tuple_of_entities_t = meta::rename_t< meta::transform_t< std::decay, meta::type_list< Entities... > >, std::tuple > |
A helper meta-function to create an actual type of tuple with clauses/producers. | |
template<typename Result_Type > | |
using | restinio::easy_parser::impl::conversion_result_type_detector_t = typename conversion_result_type_detector< Result_Type >::type |
Enumerations | |
enum class | restinio::easy_parser::error_reason_t { restinio::easy_parser::unexpected_character , restinio::easy_parser::unexpected_eof , restinio::easy_parser::no_appropriate_alternative , restinio::easy_parser::pattern_not_found , restinio::easy_parser::unconsumed_input , restinio::easy_parser::illegal_value_found , restinio::easy_parser::force_only_this_alternative_failed } |
Reason of parsing error. More... | |
enum class | restinio::easy_parser::impl::entity_type_t { restinio::easy_parser::impl::producer , restinio::easy_parser::impl::transformer , restinio::easy_parser::impl::consumer , restinio::easy_parser::impl::clause , restinio::easy_parser::impl::transformer_proxy } |
A marker for distinguish different kind of entities in parser. More... | |
Variables | |
constexpr std::size_t | restinio::easy_parser::N = std::numeric_limits<std::size_t>::max() |
A special marker that means infinite repetitions. | |
constexpr char | restinio::easy_parser::impl::SP = ' ' |
A constant for SPACE value. | |
constexpr char | restinio::easy_parser::impl::HTAB = '\x09' |
A constant for Horizontal Tab value. | |
template<typename T > | |
constexpr bool | restinio::easy_parser::impl::is_producer_v = is_producer<T>::value |
A meta-value to check whether T is a producer type. | |
template<typename T > | |
constexpr bool | restinio::easy_parser::impl::is_transformer_v = is_transformer<T>::value |
A meta-value to check whether T is a transformer type. | |
template<typename T > | |
constexpr bool | restinio::easy_parser::impl::is_transformer_proxy_v = is_transformer_proxy<T>::value |
A meta-value to check whether T is a transformer-proxy type. | |
template<typename T > | |
constexpr bool | restinio::easy_parser::impl::is_consumer_v = is_consumer<T>::value |
A meta-value to check whether T is a consumer type. | |
template<typename T > | |
constexpr bool | restinio::easy_parser::impl::is_clause_v = is_clause<T>::value |
A meta-value to check whether T is a consumer type. | |
An very small, simple and somewhat limited implementation of recursive-descent parser.
Definition in file easy_parser.hpp.