ATLAS Offline Software
Public Member Functions | List of all members
CP::DetailSelectionExprParser::Separator Class Reference

Separator to be used in a boost::tokenizer. More...

#include <SelectionExprParser.h>

Collaboration diagram for CP::DetailSelectionExprParser::Separator:

Public Member Functions

bool operator() (std::string::const_iterator &next, const std::string::const_iterator &end, std::string &tok) const
 Extracts the subsequent token from the input string iterator. More...
 
void reset ()
 Optional state reset method, does nothing. More...
 

Detailed Description

Separator to be used in a boost::tokenizer.

Definition at line 22 of file SelectionExprParser.h.

Member Function Documentation

◆ operator()()

bool CP::DetailSelectionExprParser::Separator::operator() ( std::string::const_iterator &  next,
const std::string::const_iterator &  end,
std::string &  tok 
) const

Extracts the subsequent token from the input string iterator.

Definition at line 21 of file SelectionExprParser.cxx.

23  {
24  if (next == end) {
25  return false;
26  }
27 
28  static const std::regex base_regex(
29  "^( ?((?:[^|&()! ]+)|(?:&&)|(?:!)|(?:\\()|(?:\\))|(?:\\|\\|))).*");
30  std::smatch m;
31 
32  if (std::regex_match(next, end, m, base_regex)) {
33  tok = m[2].str();
34  next += m[1].length();
35  } else {
36  std::smatch m2;
37  static const std::regex space_re{"^ +$"};
38  if (std::regex_match(next, end, m, space_re)) {
39  // only spaces left, we're done
40  return false;
41  }
42  throw std::runtime_error("Cannot tokenize: '" + std::string(next, end) +
43  "'");
44  }
45  return true;
46 }

◆ reset()

void CP::DetailSelectionExprParser::Separator::reset ( )
inline

Optional state reset method, does nothing.

Definition at line 30 of file SelectionExprParser.h.

30 {}

The documentation for this class was generated from the following files:
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52