CommonTools
Utils
src
expressionParser.cc
Go to the documentation of this file.
1
#include "
CommonTools/Utils/src/Grammar.h
"
2
#include "
FWCore/Utilities/interface/EDMException.h
"
3
#include "
CommonTools/Utils/interface/expressionParser.h
"
4
5
using namespace
reco::parser
;
6
7
bool
reco::parser::expressionParser
(
const
edm::TypeWithDict
&
t
,
8
const
std::string
&
value
,
9
ExpressionPtr
&
expr
,
10
bool
lazy) {
11
using namespace
boost::spirit::classic
;
12
Grammar
grammar(
expr
,
t
, lazy);
13
bool
returnValue =
false
;
14
const
char
* startingFrom =
value
.c_str();
15
try
{
16
returnValue =
parse
(startingFrom, grammar.use_parser<1>() >> end_p, space_p).full;
17
}
catch
(
BaseException
&
e
) {
18
throw
edm::Exception
(
edm::errors::Configuration
)
19
<<
"Expression parser error:"
<<
baseExceptionWhat
(
e
) <<
" (char "
<<
e
.where - startingFrom <<
")\n"
;
20
}
21
return
returnValue;
22
}
reco::parser::baseExceptionWhat
const char * baseExceptionWhat(const BaseException &e)
returns the appropriate 'what' message for the exception
Definition:
Exception.h:36
boost::spirit::classic
Definition:
DDPartSelection.cc:10
EDMException.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
dumpparser.parse
def parse(path, config)
Definition:
dumpparser.py:13
edm::TypeWithDict
Definition:
TypeWithDict.h:38
reco::parser::BaseException
boost::spirit::classic::parser_error< reco::parser::SyntaxErrors > BaseException
Definition:
Exception.h:33
value
Definition:
value.py:1
reco::parser::ExpressionPtr
std::shared_ptr< ExpressionBase > ExpressionPtr
Definition:
ExpressionBase.h:25
reco::parser::Grammar
Definition:
Grammar.h:45
reco::parser
Definition:
cutParser.h:9
jets_cff.expr
expr
Definition:
jets_cff.py:483
Exception
Definition:
hltDiff.cc:246
reco::parser::expressionParser
bool expressionParser(const edm::TypeWithDict &t, const std::string &value, ExpressionPtr &expr, bool lazy)
Definition:
expressionParser.cc:7
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:644
edm::errors::Configuration
Definition:
EDMException.h:36
expressionParser.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Grammar.h
Generated for CMSSW Reference Manual by
1.8.16