1 #ifndef HLTrigger_HLTfilters_TriggerExpressionParser_h 2 #define HLTrigger_HLTfilters_TriggerExpressionParser_h 5 #include <boost/spirit/include/phoenix.hpp> 6 #include <boost/spirit/include/qi.hpp> 16 namespace qi = boost::spirit::qi;
17 namespace ascii = boost::spirit::ascii;
19 using boost::phoenix::new_;
20 using boost::spirit::unused_type;
22 template <
typename Iterator>
23 class Parser :
public qi::grammar<Iterator, Evaluator*(), ascii::space_type>
29 token_l1algo %= qi::raw[qi::lexeme[
"L1_" >> +(qi::char_(
"a-zA-Z0-9_*?"))]];
30 token_path %= qi::raw[qi::lexeme[ +(qi::char_(
"a-zA-Z0-9_*?"))]];
32 token = ( qi::lit(
"TRUE") [qi::_val = new_<Constant>(
true)]
33 | qi::lit(
"FALSE") [qi::_val = new_<Constant>(
false)]
35 |
token_path [qi::_val = new_<PathReader>(qi::_1)]
42 prescale = (
element >>
'/' >> qi::uint_) [qi::_val = new_<Prescaler> (qi::_1, qi::_2)];
47 | (qi::lit(
"NOT") >>
operand) [qi::_val = new_<OperatorNot> (qi::_1)]
52 (qi::lit(
"AND") >>
unary) [qi::_val = new_<OperatorAnd> (qi::_val, qi::_1)]
53 | (qi::lit(
"OR") >>
unary) [qi::_val = new_<OperatorOr> (qi::_val, qi::_1)]
58 typedef qi::rule<Iterator, std::string(), ascii::space_type>
name_rule;
59 typedef qi::rule<Iterator, Evaluator*(), ascii::space_type>
rule;
77 typedef typename T::const_iterator
Iterator;
81 Iterator
begin = text.begin();
82 Iterator
end = text.end();
85 bool result = qi::phrase_parse( begin, end, parser, ascii::space, evaluator );
87 if (not result
or begin != end) {
101 const char *
end = text + strlen(text);
104 bool result = qi::phrase_parse( begin, end, parser, ascii::space, evaluator );
106 if (not result
or begin != end) {
116 #endif // HLTrigger_HLTfilters_TriggerExpressionParser_h
Evaluator * parse(const T &text)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
qi::rule< Iterator, std::string(), ascii::space_type > name_rule
qi::rule< Iterator, Evaluator *(), ascii::space_type > rule