RESTinio
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
easy_parser.hpp File Reference

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. More...
 
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...
 

Functions

RESTINIO_NODISCARD constexpr digits_to_consume_t restinio::easy_parser::expected_digits (digits_to_consume_t::underlying_int_t total) noexcept
 Create a limit for number of digits to be extracted. More...
 
RESTINIO_NODISCARD constexpr digits_to_consume_t restinio::easy_parser::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. More...
 
RESTINIO_NODISCARD bool restinio::easy_parser::impl::operator== (const character_t &a, const character_t &b) noexcept
 
RESTINIO_NODISCARD bool restinio::easy_parser::impl::operator!= (const character_t &a, const character_t &b) noexcept
 
RESTINIO_NODISCARD constexpr bool restinio::easy_parser::impl::is_space (const char ch) noexcept
 If a character a space character? More...
 
RESTINIO_NODISCARD constexpr bool restinio::easy_parser::impl::is_digit (const char ch) noexcept
 Is a character a decimal digit? More...
 
RESTINIO_NODISCARD constexpr bool restinio::easy_parser::impl::is_hexdigit (const char ch) noexcept
 Is a character a hexadecimal digit? More...
 
template<typename P , typename T >
RESTINIO_NODISCARD std::enable_if_t< is_producer_v< P > &is_transformer_v< T >, transformed_value_producer_t< P, T > > restinio::easy_parser::impl::operator>> (P producer, T transformer)
 A special operator to connect a value producer with value transformer. More...
 
template<typename P , typename T , typename S = std::enable_if_t< is_producer_v<P> & is_transformer_proxy_v<T>, void >>
RESTINIO_NODISCARD auto restinio::easy_parser::impl::operator>> (P producer, T transformer_proxy)
 A special operator to connect a value producer with value transformer via transformer-proxy. More...
 
template<typename P , typename C >
RESTINIO_NODISCARD std::enable_if_t< is_producer_v< P > &&is_consumer_v< C >, consume_value_clause_t< P, C > > restinio::easy_parser::impl::operator>> (P producer, C consumer)
 A special operator to connect a value producer with a value consumer. More...
 
RESTINIO_NODISCARD optional_t< parse_error_t > restinio::easy_parser::impl::ensure_no_remaining_content (source_t &from)
 A special function to check that there is no more actual data in the input stream except whitespaces. More...
 
RESTINIO_NODISCARD string_view_t restinio::easy_parser::impl::remove_trailing_spaces (string_view_t from) noexcept
 Helper function for removal of trailing spaces from a string-view. More...
 
template<typename T , typename Value_Accumulator >
RESTINIO_NODISCARD expected_t< T, parse_error_t > restinio::easy_parser::impl::try_parse_digits_with_digits_limit (source_t &from, digits_to_consume_t digits_limit, Value_Accumulator acc) noexcept
 Helper function for parsing integers with respect to the number of digits to be consumed. More...
 
template<typename T , typename Value_Accumulator >
RESTINIO_NODISCARD expected_t< T, parse_error_t > restinio::easy_parser::impl::try_parse_hexdigits_with_digits_limit (source_t &from, digits_to_consume_t digits_limit, Value_Accumulator acc) noexcept
 Helper function for parsing integers in hexadecimal form. More...
 
template<typename P , typename F , typename C >
RESTINIO_NODISCARD std::enable_if_t< is_producer_v< P >, consume_value_clause_t< P, field_setter_consumer_t< F, C > > > restinio::easy_parser::impl::operator>> (P producer, F C::*member_ptr)
 A special operator to connect a value producer with field_setter_consumer. More...
 
template<typename It >
RESTINIO_NODISCARD expected_t< bool, parse_error_t > restinio::easy_parser::impl::try_parse_exact_fragment (source_t &from, It begin, It end)
 
template<typename It >
RESTINIO_NODISCARD expected_t< bool, parse_error_t > restinio::easy_parser::impl::try_parse_caseless_exact_fragment (source_t &from, It begin, It end)
 
template<typename Target_Type , typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::produce (Clauses &&... clauses)
 A factory function to create a producer that creates an instance of the target type by using specified clauses. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::alternatives (Clauses &&... clauses)
 A factory function to create an alternatives clause. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::maybe (Clauses &&... clauses)
 A factory function to create an optional clause. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::not_clause (Clauses &&... clauses)
 A factory function to create a not_clause. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::and_clause (Clauses &&... clauses)
 A factory function to create an and_clause. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::sequence (Clauses &&... clauses)
 A factory function to create a sequence of subclauses. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::force_only_this_alternative (Clauses &&... clauses)
 An alternative that should be parsed correctly or the parsing of the whole alternatives clause should fail. More...
 
template<typename... Clauses>
RESTINIO_NODISCARD auto restinio::easy_parser::repeat (std::size_t min_occurences, std::size_t max_occurences, Clauses &&... clauses)
 A factory function to create repetitor of subclauses. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::skip () noexcept
 A factory function to create a skip_consumer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::any_symbol_p () noexcept
 A factory function to create an any_symbol_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::symbol_p (char expected) noexcept
 A factory function to create a symbol_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::any_symbol_if_not_p (char sentinel) noexcept
 A factory function to create a any_symbol_if_not_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_symbol_p (char expected) noexcept
 A factory function to create a caseless_symbol_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::symbol_from_range_p (char left, char right) noexcept
 A factory function to create a symbol_from_range_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::symbol (char expected) noexcept
 A factory function to create a clause that expects the speficied symbol, extracts it and then skips it. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_symbol (char expected) noexcept
 A factory function to create a clause that expects the speficied symbol, extracts it and then skips it. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::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. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::space_p () noexcept
 A factory function to create a space_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::space () noexcept
 A factory function to create a clause that expects a space, extracts it and then skips it. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::digit_p () noexcept
 A factory function to create a digit_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::digit () noexcept
 A factory function to create a clause that expects a decimal digit, extracts it and then skips it. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::hexdigit_p () noexcept
 A factory function to create a hexdigit_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::hexdigit () noexcept
 A factory function to create a clause that expects a hexadecimal digit, extracts it and then skips it. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::non_negative_decimal_number_p () noexcept
 A factory function to create a non_negative_decimal_number_producer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::non_negative_decimal_number_p (digits_to_consume_t digits_limit) noexcept
 A factory function to create a non_negative_decimal_number_producer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::positive_decimal_number_producer () noexcept
 A factory function to create a producer for non-negative decimal numbers. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::hexadecimal_number_p () noexcept
 A factory function to create a hexadecimal_number_producer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::hexadecimal_number_p (digits_to_consume_t digits_limit) noexcept
 A factory function to create a hexadecimal_number_producer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::decimal_number_p () noexcept
 A factory function to create a decimal_number_producer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::decimal_number_p (digits_to_consume_t digits_limit) noexcept
 A factory function to create a decimal_number_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::as_result () noexcept
 A factory function to create a as_result_consumer. More...
 
template<typename F >
RESTINIO_NODISCARD auto restinio::easy_parser::custom_consumer (F consumer)
 A factory function to create a custom_consumer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::to_container ()
 A factory function to create a to_container_consumer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::to_lower () noexcept
 A factory function to create a to_lower_transformer. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::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. More...
 
template<typename T >
RESTINIO_NODISCARD auto restinio::easy_parser::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. More...
 
template<typename Converter >
RESTINIO_NODISCARD auto restinio::easy_parser::convert (Converter &&converter)
 A factory function to create convert_transformer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::exact_p (string_view_t fragment)
 A factory function that creates an instance of exact_fragment_producer. More...
 
template<std::size_t Size>
RESTINIO_NODISCARD auto restinio::easy_parser::exact_p (const char(&fragment)[Size])
 A factory function that creates an instance of exact_fragment_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::exact (string_view_t fragment)
 A factory function that creates an instance of exact_fragment clause. More...
 
template<std::size_t Size>
RESTINIO_NODISCARD auto restinio::easy_parser::exact (const char(&fragment)[Size])
 A factory function that creates an instance of exact_fragment clause. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_exact_p (string_view_t fragment)
 A factory function that creates an instance of caseless_exact_fragment_producer. More...
 
template<std::size_t Size>
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_exact_p (const char(&fragment)[Size])
 A factory function that creates an instance of caseless_exact_fragment_producer. More...
 
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_exact (string_view_t fragment)
 A factory function that creates an instance of caseless_exact_fragment clause. More...
 
template<std::size_t Size>
RESTINIO_NODISCARD auto restinio::easy_parser::caseless_exact (const char(&fragment)[Size])
 A factory function that creates an instance of caseless_exact_fragment clause. More...
 
template<typename Producer >
RESTINIO_NODISCARD expected_t< typename Producer::result_type, parse_error_t > restinio::easy_parser::try_parse (string_view_t from, Producer producer)
 Perform the parsing of the specified content by using specified value producer. More...
 
RESTINIO_NODISCARD std::string restinio::easy_parser::make_error_description (const parse_error_t &error, string_view_t from)
 Make textual description of error returned by try_parse function. More...
 

Variables

constexpr std::size_t restinio::easy_parser::N = std::numeric_limits<std::size_t>::max()
 A special marker that means infinite repetitions. More...
 
constexpr char restinio::easy_parser::impl::SP = ' '
 A constant for SPACE value. More...
 
constexpr char restinio::easy_parser::impl::HTAB = '\x09'
 A constant for Horizontal Tab value. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

An very small, simple and somewhat limited implementation of recursive-descent parser.

Since
v.0.6.1

Definition in file easy_parser.hpp.