CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
expressionParser.cc
Go to the documentation of this file.
4 
5 using namespace reco::parser;
6 
8  using namespace boost::spirit::classic;
9  Grammar grammar(expr, t, lazy);
10  bool returnValue = false;
11  const char* startingFrom = value.c_str();
12  try {
13  returnValue=parse(startingFrom, grammar.use_parser<1>() >> end_p, space_p).full;
14  } catch(BaseException&e){
15  throw edm::Exception(edm::errors::Configuration)<<"Expression parser error:"<<baseExceptionWhat(e)<<" (char "<<e.where-startingFrom<<")\n";
16  }
17  return returnValue;
18 }
tuple t
Definition: tree.py:139
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:37
Evaluator * parse(const T &text)
boost::shared_ptr< ExpressionBase > ExpressionPtr
const char * baseExceptionWhat(const BaseException &e)
returns the appropriate &#39;what&#39; message for the exception
Definition: Exception.h:40