LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
shims::catchall_parser Struct Reference

#include "parse_shims.h"

Inheritance diagram for shims::catchall_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 46 of file parse_shims.h.

Member Function Documentation

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

Definition at line 59 of file parse_shims.h.

References shims::isSnippetMode(), and shims::maximally_munched_ass().

64  {
65  boost::spirit::qi::skip_over(first, last, skipper);
66 
67  if (!::shims::isSnippetMode())
68  return false;
69 
70  Iterator it = first;
71  while (it != last &&
72  (std::isalnum(*it) || *it == '_' || *it == ':' || *it == '@'))
73  ++it;
74 
75  if (it != last && !maximally_munched_ass(*it))
76  return false;
77 
78  Attribute result(first, it);
79  if (result.empty() || std::isdigit(result[0]))
80  return false;
81 
82  first = it;
83  boost::spirit::traits::assign_to(result, attr);
84  return true;
85  }
bool maximally_munched_ass(char ch)
Definition: parse_shims.h:40
bool isSnippetMode(bool m)
Definition: parse_shims.cc:9
template<typename Context >
boost::spirit::info shims::catchall_parser::what ( Context &  ) const
inline

Definition at line 89 of file parse_shims.h.

90  {
91  return boost::spirit::info("shims::catchall");
92  }

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