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

Constructor & Destructor Documentation

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

Definition at line 327 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().

327  :
328  Grammar::base_type(expression),
330 
331  // setup functors that call into shunting algorithm while parsing the logical expression
332  auto addPathName = phoenix::bind(&ShuntingYardAlgorithm::addPathName, algorithm_, qi::_1);
333  auto addOperatorNot = phoenix::bind(&ShuntingYardAlgorithm::addOperatorNot, algorithm_);
334  auto addOperatorAnd = phoenix::bind(&ShuntingYardAlgorithm::addOperatorAnd, algorithm_);
335  auto addOperatorOr = phoenix::bind(&ShuntingYardAlgorithm::addOperatorOr, algorithm_);
336  auto addBeginParenthesis = phoenix::bind(&ShuntingYardAlgorithm::addBeginParenthesis, algorithm_);
337  auto addEndParenthesis = phoenix::bind(&ShuntingYardAlgorithm::addEndParenthesis, algorithm_);
338 
339  // Define the syntax allowed in the logical expressions
340  pathName = !unaryOperator >> !binaryOperatorTest >> (+qi::char_("a-zA-Z0-9_"))[addPathName];
341  binaryOperand = (qi::lit('(')[addBeginParenthesis] >> expression >> qi::lit(')')[addEndParenthesis]) |
342  (unaryOperator[addOperatorNot] >> binaryOperand) |
343  pathName;
344  afterOperator = ascii::space | &qi::lit('(') | &qi::eoi;
345  unaryOperator = qi::lit("not") >> afterOperator;
346  // The only difference in the next two is that one calls a functor and the other does not
347  binaryOperatorTest = (qi::lit("and") >> afterOperator) |
348  (qi::lit("or") >> afterOperator);
349  binaryOperator = (qi::lit("and") >> afterOperator)[addOperatorAnd] |
350  (qi::lit("or") >> afterOperator)[addOperatorOr];
351  expression = binaryOperand % binaryOperator;
352  }
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 358 of file PathStatusFilter.cc.

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

Definition at line 364 of file PathStatusFilter.cc.

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

Definition at line 357 of file PathStatusFilter.cc.

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

Definition at line 361 of file PathStatusFilter.cc.

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

Definition at line 360 of file PathStatusFilter.cc.

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

Definition at line 362 of file PathStatusFilter.cc.

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

Definition at line 356 of file PathStatusFilter.cc.

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

Definition at line 359 of file PathStatusFilter.cc.