CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::pathStatusExpression::Grammar< Iterator > Class Template Reference
Inheritance diagram for edm::pathStatusExpression::Grammar< Iterator >:

Public Member Functions

 Grammar (ShuntingYardAlgorithm *algorithm)
 

Private Attributes

qi::rule< IteratorafterOperator
 
ShuntingYardAlgorithmalgorithm_
 
qi::rule< Iterator, ascii::space_type > binaryOperand
 
qi::rule< IteratorbinaryOperator
 
qi::rule< IteratorbinaryOperatorTest
 
qi::rule< Iterator, ascii::space_type > expression
 
qi::rule< IteratorpathName
 
qi::rule< IteratorunaryOperator
 

Detailed Description

template<typename Iterator>
class edm::pathStatusExpression::Grammar< Iterator >

Definition at line 302 of file PathStatusFilter.cc.

Constructor & Destructor Documentation

◆ Grammar()

template<typename Iterator>
edm::pathStatusExpression::Grammar< Iterator >::Grammar ( ShuntingYardAlgorithm algorithm)
inline

Definition at line 304 of file PathStatusFilter.cc.

304  : Grammar::base_type(expression), algorithm_(algorithm) {
305  // setup functors that call into shunting algorithm while parsing the logical expression
306  auto addPathName = std::bind(&ShuntingYardAlgorithm::addPathName, algorithm_, std::placeholders::_1);
307  auto addOperatorNot = std::bind(&ShuntingYardAlgorithm::addOperatorNot, algorithm_);
308  auto addOperatorAnd = std::bind(&ShuntingYardAlgorithm::addOperatorAnd, algorithm_);
309  auto addOperatorOr = std::bind(&ShuntingYardAlgorithm::addOperatorOr, algorithm_);
310  auto addBeginParenthesis = std::bind(&ShuntingYardAlgorithm::addBeginParenthesis, algorithm_);
311  auto addEndParenthesis = std::bind(&ShuntingYardAlgorithm::addEndParenthesis, algorithm_);
312 
313  // Define the syntax allowed in the logical expressions
314  pathName = !unaryOperator >> !binaryOperatorTest >> (+qi::char_("a-zA-Z0-9_"))[addPathName];
315  binaryOperand = (qi::lit('(')[addBeginParenthesis] >> expression >> qi::lit(')')[addEndParenthesis]) |
316  (unaryOperator[addOperatorNot] >> binaryOperand) | pathName;
317  afterOperator = ascii::space | &qi::lit('(') | &qi::eoi;
318  unaryOperator = qi::lit("not") >> afterOperator;
319  // The only difference in the next two is that one calls a functor and the other does not
320  binaryOperatorTest = (qi::lit("and") >> afterOperator) | (qi::lit("or") >> afterOperator);
322  (qi::lit("and") >> afterOperator)[addOperatorAnd] | (qi::lit("or") >> afterOperator)[addOperatorOr];
324  }

References edm::pathStatusExpression::ShuntingYardAlgorithm::addBeginParenthesis(), edm::pathStatusExpression::ShuntingYardAlgorithm::addEndParenthesis(), edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorAnd(), edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorNot(), edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorOr(), edm::pathStatusExpression::ShuntingYardAlgorithm::addPathName(), edm::pathStatusExpression::Grammar< Iterator >::afterOperator, edm::pathStatusExpression::Grammar< Iterator >::algorithm_, edm::pathStatusExpression::Grammar< Iterator >::binaryOperand, edm::pathStatusExpression::Grammar< Iterator >::binaryOperator, edm::pathStatusExpression::Grammar< Iterator >::binaryOperatorTest, edm::pathStatusExpression::Grammar< Iterator >::expression, edm::pathStatusExpression::Grammar< Iterator >::pathName, and edm::pathStatusExpression::Grammar< Iterator >::unaryOperator.

Member Data Documentation

◆ afterOperator

template<typename Iterator>
qi::rule<Iterator> edm::pathStatusExpression::Grammar< Iterator >::afterOperator
private

◆ algorithm_

template<typename Iterator>
ShuntingYardAlgorithm* edm::pathStatusExpression::Grammar< Iterator >::algorithm_
private

◆ binaryOperand

template<typename Iterator>
qi::rule<Iterator, ascii::space_type> edm::pathStatusExpression::Grammar< Iterator >::binaryOperand
private

◆ binaryOperator

template<typename Iterator>
qi::rule<Iterator> edm::pathStatusExpression::Grammar< Iterator >::binaryOperator
private

◆ binaryOperatorTest

template<typename Iterator>
qi::rule<Iterator> edm::pathStatusExpression::Grammar< Iterator >::binaryOperatorTest
private

◆ expression

template<typename Iterator>
qi::rule<Iterator, ascii::space_type> edm::pathStatusExpression::Grammar< Iterator >::expression
private

◆ pathName

template<typename Iterator>
qi::rule<Iterator> edm::pathStatusExpression::Grammar< Iterator >::pathName
private

◆ unaryOperator

template<typename Iterator>
qi::rule<Iterator> edm::pathStatusExpression::Grammar< Iterator >::unaryOperator
private
edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorOr
void addOperatorOr()
Definition: PathStatusFilter.cc:239
edm::pathStatusExpression::Grammar::afterOperator
qi::rule< Iterator > afterOperator
Definition: PathStatusFilter.cc:329
edm::pathStatusExpression::Grammar::unaryOperator
qi::rule< Iterator > unaryOperator
Definition: PathStatusFilter.cc:330
edm::pathStatusExpression::Grammar::binaryOperator
qi::rule< Iterator > binaryOperator
Definition: PathStatusFilter.cc:332
edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorAnd
void addOperatorAnd()
Definition: PathStatusFilter.cc:225
edm::pathStatusExpression::Grammar::expression
qi::rule< Iterator, ascii::space_type > expression
Definition: PathStatusFilter.cc:333
edm::pathStatusExpression::ShuntingYardAlgorithm::addEndParenthesis
void addEndParenthesis()
Definition: PathStatusFilter.cc:255
edm::pathStatusExpression::Grammar::binaryOperand
qi::rule< Iterator, ascii::space_type > binaryOperand
Definition: PathStatusFilter.cc:328
edm::pathStatusExpression::ShuntingYardAlgorithm::addPathName
void addPathName(std::vector< char > const &s)
Definition: PathStatusFilter.cc:196
edm::pathStatusExpression::Grammar::binaryOperatorTest
qi::rule< Iterator > binaryOperatorTest
Definition: PathStatusFilter.cc:331
edm::pathStatusExpression::Grammar::pathName
qi::rule< Iterator > pathName
Definition: PathStatusFilter.cc:327
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorNot
void addOperatorNot()
Definition: PathStatusFilter.cc:198
edm::pathStatusExpression::ShuntingYardAlgorithm::addBeginParenthesis
void addBeginParenthesis()
Definition: PathStatusFilter.cc:253
edm::pathStatusExpression::Grammar::algorithm_
ShuntingYardAlgorithm * algorithm_
Definition: PathStatusFilter.cc:335