 |
Belle II Software
release-05-02-19
|
12 #define BOOST_SPIRIT_UNICODE
13 #include <boost/spirit/include/qi.hpp>
14 #include <analysis/DecayDescriptor/DecayStringParticle.h>
15 #include <analysis/DecayDescriptor/DecayStringDecay.h>
16 #include <analysis/DecayDescriptor/DecayString.h>
31 template <
typename Iterator>
32 struct DecayStringGrammar : boost::spirit::qi::grammar<Iterator, DecayString(), boost::spirit::unicode::space_type> {
35 using boost::spirit::unicode::char_;
36 using boost::spirit::unicode::string;
37 using boost::spirit::unicode::space;
38 using boost::spirit::qi::lit;
39 using boost::spirit::qi::lexeme;
40 using boost::spirit::repeat;
50 reserved = space ||
'^' ||
'[' ||
']' ||
'>' ||
':' ||
'.' ||
'?' ||
'!' ||
'@';
55 selector = string(
"^") | string(
"@") | string(
"(misID)") | string(
"(decay)");
59 arrow %= string(
"->") | string(
"=direct=>") | string(
"=norad=>") | string(
"=exact=>");
62 keyword = string(
"...") | string(
"?nu") | string(
"!nu") | string(
"?gamma") | string(
"!gamma") | string(
"?addbrems");
80 boost::spirit::qi::rule<
Iterator, std::string(), boost::spirit::unicode::space_type>
selector;
82 boost::spirit::qi::rule<
Iterator, std::string(), boost::spirit::unicode::space_type>
label;
84 boost::spirit::qi::rule<
Iterator, std::string(), boost::spirit::unicode::space_type>
arrow;
86 boost::spirit::qi::rule<
Iterator, std::string(), boost::spirit::unicode::space_type>
keyword;
88 boost::spirit::qi::rule<Iterator, std::vector<std::string>(), boost::spirit::unicode::space_type>
keywordlist;
96 boost::spirit::qi::rule<Iterator, std::vector<DecayString>(), boost::spirit::unicode::space_type>
daughterlist;
boost::spirit::qi::rule< Iterator, DecayString(), boost::spirit::unicode::space_type > start
The rule where the parser starts.
boost::spirit::qi::rule< Iterator, std::string(), boost::spirit::unicode::space_type > arrow
Allowed arrow types.
Holds the information of a particle in the decay string.
boost::variant< boost::recursive_wrapper< DecayStringDecay >, DecayStringParticle > DecayString
The DecayStringElement can be either a DecayStringDecay or a vector of mother particles.
boost::spirit::qi::rule< Iterator, std::string(), boost::spirit::unicode::space_type > label
Label that can be attached to a particle name, separated by the '/' symbol.
boost::spirit::qi::rule< Iterator, std::vector< DecayString >), boost::spirit::unicode::space_type > daughterlist
The list of the daughters, i.e.
map< unsigned, const TOPSampleTimes * >::const_iterator Iterator
Iteratior for m_map.
boost::spirit::qi::rule< Iterator, std::string(), boost::spirit::unicode::space_type > selector
Particles can be selected by preceeding '^' symbol.
boost::spirit::qi::rule< Iterator, std::vector< std::string >), boost::spirit::unicode::space_type > keywordlist
The list of the keywords.
boost::spirit::qi::rule< Iterator, DecayStringParticle(), boost::spirit::unicode::space_type > particle
Particle in the decay string: 'selector name label'.
boost::spirit::qi::rule< Iterator, DecayStringDecay(), boost::spirit::unicode::space_type > decay
Syntax of a decay: 'mother arrow daughters ...'.
Abstract base class for different kinds of events.
boost::spirit::qi::rule< Iterator, DecayStringDecay(), boost::spirit::unicode::space_type > daughterdecay
Syntax of decaying daughter particle.
boost::spirit::qi::rule< Iterator, std::string(), boost::spirit::unicode::space_type > keyword
Syntax keyword.
This class describes the grammar and the syntax elements of decay strings.
boost::spirit::qi::rule< Iterator, DecayString(), boost::spirit::unicode::space_type > daughter
A daughter particle which can be either a plain particle or a decaying particle.
Holds the information of a decay.
boost::spirit::qi::rule< Iterator > reserved
Reserved characters that are not allowed in particle names or labels.