LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 42 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 55 of file parse_shims.h.

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

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

Definition at line 85 of file parse_shims.h.

86  {
87  return boost::spirit::info("shims::catchall");
88  }

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