|
RESTinio
|
A template for implementation of clause that selects one of alternative clauses. More...
#include <easy_parser.hpp>
Public Member Functions | |
| alternatives_clause_t (Subitems_Tuple &&subitems) | |
| template<typename Target_Type > | |
| RESTINIO_NODISCARD optional_t< parse_error_t > | try_process (source_t &from, Target_Type &target) |
Private Attributes | |
| Subitems_Tuple | m_subitems |
Additional Inherited Members | |
Static Public Attributes inherited from restinio::easy_parser::impl::clause_tag | |
| static constexpr entity_type_t | entity_type = entity_type_t::clause |
A template for implementation of clause that selects one of alternative clauses.
This template implements rules like:
T := A | B | C
It works very simple way:
try_process for the first alternative is called. If it fails then...try_process for the second alternative is called. If it fails then...try_process for the third alternative is called...If no one of alternatives is selected then the current position in the input stream is restored.
try_process method is created before checking each alternative.| Subitems_Tuple | the type of std::tuple with items for every alternative clauses. |
Definition at line 1635 of file easy_parser.hpp.
|
inline |
Definition at line 1640 of file easy_parser.hpp.
|
inline |
Definition at line 1648 of file easy_parser.hpp.
|
private |
Definition at line 1637 of file easy_parser.hpp.