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.

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.

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  }
qi::rule< Iterator, ascii::space_type > expression
qi::rule< Iterator, ascii::space_type > binaryOperand
void addPathName(std::vector< char > const &s)
ShuntingYardAlgorithm * algorithm_

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