![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
30 std::string valid_sym =
"_";
31 if (isalpha(
c) || isdigit(
c) || valid_sym.find(
c)!=std::string::npos) {
42 for (
unsigned int i=0;
i<expr.size(); ++
i) {
59 while (no_problem &&
i < expr.size()) {
66 if ( (
n = sub.
parse(expr.substr(
i+1),
true)) > 0) {
83 std::ostringstream formatedoutput;
97 std::ostringstream formatedoutput;
98 formatedoutput <<
kAND <<
" or " <<
kOR <<
" must come after a logic element";
112 }
else if ( (
i+1)<expr.size() && expr[
i+1]==
kOPEN) {
114 if ( (
n = sub2.
parse(expr.substr(
i+2),
true)) > 0) {
122 printError(
"Was expecting a sub-logic after !",
i);
126 printError(
"! must not come directly after a logic element",
i);
136 if (
name.size() > 0) {
145 printError(
"A logic element may not come immediately after another logic element",
i);
160 printError(
"The expression started with a '(' but ')' not found.",
i);
181 LogicV_t::const_iterator
p;
184 s += (*p)->logicRep();
187 if (
s.size() > 1)
s[
s.size()-1] =
kCLOSE;
205 LogicV_t::const_iterator
p;
216 for (
p=sublogics.begin();
p!=sublogics.end(); ++
p) {
226 LogicV_t::const_iterator
p;
234 n += (*p)->totalNumberOfElements();
247 std::string
m=
"Error while parsing : ";
250 for (
int j=0; j<(
n+
i); ++j)
s +=
" ";
261 sprintf(aaa,
"Current state: State=%c Nsublogics=%d Element=%s",
275 LogicV_t::const_iterator
p;
277 (*p)->print(
indent +
" ");
virtual std::string logicRep() const
virtual int parse(const std::string &expr, bool enclosed=false)
const LogicV_t & subLogics() const
std::vector< std::shared_ptr< LogicExpression > > LogicV_t
void setElement(const std::string &e)
Forward iterator to traverse the main components of the trigger configuration.
bool isPlaceHolder() const
void addSubLogic(const LogicExpression &sub)
LogicExpression(std::ostream &o=std::cout)
constructor
static const char kNOT
NOT of a sub-logic. (only one sub-logic)
static const char kELEMENT
simple element.
static std::string extractElementName(const std::string &expr)
static const char kOR
OR of sub-logics.
static const char kCLOSE
')' is a valid symbol, but not allowed as a state.
const std::shared_ptr< LogicExpression > subLogic(int i) const
static const char kAND
AND of sub-logics.
int totalNumberOfElements() const
void printError(const std::string &message, int i)
std::ostream & m_ostream
output stream for all messages
static bool isValidElementChar(char c)
static const char kOPEN
empty logic but may have sub-logics.
void print(const std::string &indent="")