LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fhicl::uint_parser Struct Reference

#include "tokens.h"

Inheritance diagram for fhicl::uint_parser:

Classes

struct  attribute
 

Public Member Functions

template<typename Iterator , typename Context , typename Skipper , typename Attribute >
bool parse (Iterator &first, Iterator const &last, Context &, Skipper const &skipper, Attribute &attr) const
 
template<typename Context >
boost::spirit::info what (Context &) const
 

Detailed Description

Definition at line 157 of file tokens.h.

Member Function Documentation

template<typename Iterator , typename Context , typename Skipper , typename Attribute >
bool fhicl::uint_parser::parse ( Iterator &  first,
Iterator const &  last,
Context &  ,
Skipper const &  skipper,
Attribute &  attr 
) const
inline

Definition at line 170 of file tokens.h.

References fhicl::maximally_munched_number().

175  {
176  boost::spirit::qi::skip_over(first, last, skipper);
177 
178  Iterator it = first;
179  while (it != last && std::isdigit(*it))
180  ++it;
181  Attribute result(first, it);
182 
183  if (result.empty())
184  return false;
185 
186  if (it != last && !maximally_munched_number(*it))
187  return false;
188 
189  for (std::size_t ndig = result.size(); ndig > 1 && result[0] == '0';
190  --ndig)
191  result.erase(0, 1);
192 
193  first = it;
194  boost::spirit::traits::assign_to(result, attr);
195  return true;
196  }
bool maximally_munched_number(char const ch)
Definition: tokens.h:35
template<typename Context >
boost::spirit::info fhicl::uint_parser::what ( Context &  ) const
inline

Definition at line 201 of file tokens.h.

202  {
203  return boost::spirit::info{"fhicl::uint"};
204  }

The documentation for this struct was generated from the following file: