CMS 3D CMS Logo

expressionParser.cc
Go to the documentation of this file.
4 
5 using namespace reco::parser;
6 
8  const std::string& value,
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) {
19  << "Expression parser error:" << baseExceptionWhat(e) << " (char " << e.where - startingFrom << ")\n";
20  }
21  return returnValue;
22 }
vector< string > parse(string line, const string &delimiter)
bool expressionParser(const edm::TypeWithDict &t, const std::string &value, ExpressionPtr &expr, bool lazy)
boost::spirit::classic::parser_error< reco::parser::SyntaxErrors > BaseException
Definition: Exception.h:33
std::shared_ptr< ExpressionBase > ExpressionPtr
Definition: value.py:1
const char * baseExceptionWhat(const BaseException &e)
returns the appropriate &#39;what&#39; message for the exception
Definition: Exception.h:36