![]() |
XTL
0.1
eXtended Template Library
|
Base class of both rules and terminals Though rules and terminals are technically different they share the rule_base ancestor in XTL to have a cleaner object model and simpler parsing algorithms. More...
Inheritance diagram for xtd::parse::rule_base:
Collaboration diagram for xtd::parse::rule_base:Public Types | |
| using | pointer_type = std::shared_ptr< rule_base > |
| using | vector_type = std::vector< pointer_type > |
Public Member Functions | |
| template<typename... _ChildRuleTs> | |
| rule_base (_ChildRuleTs &&...oChildRules) | |
| Constructor. More... | |
| virtual bool | isa (const std::type_info &oType) const =0 |
| Determines if the interface is implemented by a concrete type. More... | |
| const vector_type & | items () const |
| Accessor for child parse elements. More... | |
| virtual const std::type_info & | type () const =0 |
| Gets the type info of the concrete implementation. | |
Protected Attributes | |
| vector_type | _Items |
Base class of both rules and terminals Though rules and terminals are technically different they share the rule_base ancestor in XTL to have a cleaner object model and simpler parsing algorithms.
Its an abstract interface of parsable text or containers of same satisfying various rules (one or more, zero or more, exactly one, etc).
|
inlineexplicit |
Constructor.
| [in] | oChildRules | list of child rules that successfully parsed to satisfy the current parse rule. The child rules are stored in a local variable and accessible via the items() member. |
Definition at line 79 of file parse.hpp.
Referenced by xtd::parse::rule< zero_or_one_< _Ty > >::isa().
Here is the call graph for this function:
Here is the caller graph for this function:
|
pure virtual |
Determines if the interface is implemented by a concrete type.
| [in] | oType | type to test |
Implemented in xtd::parse::rule< _DeclT, _ImplT >, xtd::parse::rule< zero_or_more_< _Ty > >, xtd::parse::rule< one_or_more_< _Ty > >, xtd::parse::rule< character< _value > >, and xtd::parse::rule< zero_or_one_< _Ty > >.
Referenced by rule_base().
Here is the caller graph for this function:
|
inline |