Hello,
for my data parser I want to use different generic checking policies
using static polymorphism. But the way I've used won't compile (concrete
the grammar class). The check policy p***** the data the parse actions
which fills (and knows about) the data container.
What is the correct syntax for this? Note, that boost::spirit::grammar
self uses static polymorphism.
Thanks,
Olaf
---8<---
struct parse_actions { ... };
struct parse_error_handler { ... };
template<typename DerivedT, typename ActionsT>
struct check_policy
{
explicit check_policy( const ActionsT& actions )
...
};
template <typename ActionsT = parse_actions,
typename CheckPolicyT = check_policy,
typename ErrorHandlerT = parse_error_handler>
struct grammar :
CheckPolicyT< grammar<CheckPolicyT, ActionsT, ErrorHandlerT> >,
boost::spirit::grammar<
grammar<CheckPolicyT, ActionsT, ErrorHandlerT>
>
{
explicit grammar(const ActionsT& actions = ActionsT(),
const ErrorHandlerT& handler = ErrorHandlerT())
: CheckPolicyT( actions ),
actions(actions),
error_handler(handler)
{ }
--->8---


|