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

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

Definition at line 306 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(), and edm::pathStatusExpression::ShuntingYardAlgorithm::addPathName().

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];
325  expression = binaryOperand % binaryOperator;
326  }
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

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

Definition at line 331 of file PathStatusFilter.cc.

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

Definition at line 337 of file PathStatusFilter.cc.

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

Definition at line 330 of file PathStatusFilter.cc.

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

Definition at line 334 of file PathStatusFilter.cc.

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

Definition at line 333 of file PathStatusFilter.cc.

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

Definition at line 335 of file PathStatusFilter.cc.

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

Definition at line 329 of file PathStatusFilter.cc.

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

Definition at line 332 of file PathStatusFilter.cc.