I tried the following, and the compiler wasn't happy about it. I guess the tutorial's discussion of parameters was too complicated for me.
#include <boost/parser/parser.hpp>
namespace bp = ::boost::parser;
bp::rule< struct toprule, double > toprule = "toprule";
auto const toprule_def = bp::double_ >> bp::_p<0>;
BOOST_PARSER_DEFINE_RULES( toprule );
static void ParamTest( const bp::symbols<double>& syms )
{
auto result = bp::parse( "10.3", toprule.with( syms ), bp::ws );
}
By the way, am I correct that a rule must be defined at global scope?
See also a discussion on Stack Overflow, where a reply said "you're looking for lazy rule references" but I don't really know what that means.
I tried the following, and the compiler wasn't happy about it. I guess the tutorial's discussion of parameters was too complicated for me.
By the way, am I correct that a rule must be defined at global scope?
See also a discussion on Stack Overflow, where a reply said "you're looking for lazy rule references" but I don't really know what that means.