...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The template create_parser
is a type used as an customization point. It is invoked by the Qi
create_parser
API function in
order to create a custom mapping of the given data type to a parser expression.
This parser expression will be returned from create_parser
whenever the given
data type is encountered.
// forwards to <boost/spirit/home/qi/auto.hpp> #include <boost/spirit/include/qi_auto.hpp>
Also, see Include Structure.
Name |
---|
|
template <typename T, typename Enable> struct create_parser { typedef <unspecified> type; static type const& call(); };
Parameter |
Description |
Default |
---|---|---|
|
The type, |
none |
|
Helper template parameter usable to selectively enable or disable
certain specializations of |
|
Notation
T
An arbitrary type.
Expression |
Semantics |
---|---|
|
Defines the type of the parser expression returned from |
|
Returns a parser expression (usually this is a proto::expression)
to be used as the default parser for the given type, |
Spirit predefines specializations of this customization point for several types. All predefined mappings are listed here: Additional Attribute Requirements for Parsers.
Note | |
---|---|
It is possible to overload the predefined mappings for the listed types
by providing your own specialization of the |
The customization point create_parser
needs to be implemented for a specific type whenever this type should
be usable with the API function create_parser
(which includes
using the qi::auto_
parser and the special API functions
based on the automatic creation of the matching parser type).
For an example of how to use the customization point create_parser
please see here: Example
for Using the qi::auto_
Parser.