LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::real_parser Struct Reference

#include "tokens.h"

Inheritance diagram for fhicl::real_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 113 of file tokens.h.

Member Function Documentation

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

Definition at line 126 of file tokens.h.

References fhicl::maximally_munched_number().

131  {
132  boost::spirit::qi::skip_over(first, last, skipper);
133 
134  static std::string const allowed{"0123456789.-+eE"};
135  Iterator it = first;
136  while (it != last && allowed.find(*it) != std::string::npos)
137  ++it;
138 
139  if (it != last && !maximally_munched_number(*it))
140  return false;
141 
142  Attribute raw(first, it);
143  if (raw.empty())
144  return false;
145 
146  Attribute result;
147  if (!cet::canonical_number(raw, result))
148  return false;
149 
150  first = it;
151  boost::spirit::traits::assign_to(result, attr);
152  return true;
153  }
Raw data description.
Definition: RawTypes.h:6
bool maximally_munched_number(char const ch)
Definition: tokens.h:35
template<typename Context >
boost::spirit::info fhicl::real_parser::what ( Context &  ) const
inline

Definition at line 158 of file tokens.h.

159  {
160  return boost::spirit::info{"fhicl::real"};
161  }

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