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 304 of file PathStatusFilter.cc.

Constructor & Destructor Documentation

◆ Grammar()

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

Definition at line 306 of file PathStatusFilter.cc.

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

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:241
edm::pathStatusExpression::Grammar::afterOperator
qi::rule< Iterator > afterOperator
Definition: PathStatusFilter.cc:331
edm::pathStatusExpression::Grammar::unaryOperator
qi::rule< Iterator > unaryOperator
Definition: PathStatusFilter.cc:332
edm::pathStatusExpression::Grammar::binaryOperator
qi::rule< Iterator > binaryOperator
Definition: PathStatusFilter.cc:334
edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorAnd
void addOperatorAnd()
Definition: PathStatusFilter.cc:227
edm::pathStatusExpression::Grammar::expression
qi::rule< Iterator, ascii::space_type > expression
Definition: PathStatusFilter.cc:335
edm::pathStatusExpression::ShuntingYardAlgorithm::addEndParenthesis
void addEndParenthesis()
Definition: PathStatusFilter.cc:257
edm::pathStatusExpression::Grammar::binaryOperand
qi::rule< Iterator, ascii::space_type > binaryOperand
Definition: PathStatusFilter.cc:330
edm::pathStatusExpression::ShuntingYardAlgorithm::addPathName
void addPathName(std::vector< char > const &s)
Definition: PathStatusFilter.cc:198
edm::pathStatusExpression::Grammar::binaryOperatorTest
qi::rule< Iterator > binaryOperatorTest
Definition: PathStatusFilter.cc:333
edm::pathStatusExpression::Grammar::pathName
qi::rule< Iterator > pathName
Definition: PathStatusFilter.cc:329
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
edm::pathStatusExpression::ShuntingYardAlgorithm::addOperatorNot
void addOperatorNot()
Definition: PathStatusFilter.cc:200
edm::pathStatusExpression::ShuntingYardAlgorithm::addBeginParenthesis
void addBeginParenthesis()
Definition: PathStatusFilter.cc:255
edm::pathStatusExpression::Grammar::algorithm_
ShuntingYardAlgorithm * algorithm_
Definition: PathStatusFilter.cc:337