The easiest way to write a Boost Spirit Parser is to define a functor_parser (boost/spirit/home/classic/utility/functor_parser.hpp).
To use it you have to define a functor(struct with a operator()):
struct function_functor
{
typedef nil_t result_t;
template
std::ptrdiff_t
operator() (ScannerT const& scan, result_t& result) const
{
// Return -1 if parsing was unsuccesful or number of characters parsed if successful.
}
};
result_t is the attribute type of the parser: int, float, etc. Default is nil_t. result will be passed to the action associated with the parser.

