CMS 3D CMS Logo

reco::parser Namespace Reference


Classes

struct  Abort
struct  abs_f
struct  acos_f
struct  AndCombiner
class  AnyMethodArgument2VoidPtr
class  AnyMethodArgumentFixup
class  AnyObjSelector
struct  asin_f
struct  atan2_f
struct  atan_f
struct  BinaryCutSetter
struct  BinarySelector
class  BinarySelectorSetter
struct  chi2prob_f
struct  CombinerSetter
struct  Comparison
struct  ComparisonBase
struct  ComparisonSetter
struct  cos_f
struct  cosh_f
struct  CutBinaryOperator
struct  CutBinaryOperatorSetter
struct  CutSetter
class  Exception
struct  exp_f
struct  ExpressionBase
struct  ExpressionBinaryOperator
struct  ExpressionBinaryOperatorSetter
struct  ExpressionFunctionSetter
struct  ExpressionNumber
struct  ExpressionNumberSetter
class  ExpressionSelectorSetter
struct  ExpressionSetter
struct  ExpressionUnaryOperator
struct  ExpressionUnaryOperatorSetter
struct  ExpressionVar
struct  ExpressionVarSetter
struct  FunctionSetter
struct  Grammar
struct  IntSetter
struct  log10_f
struct  log_f
struct  LogicalBinaryOperator
struct  LogicalUnaryOperator
struct  max_f
struct  MethodArgumentSetter
struct  MethodInvoker
struct  MethodSetter
struct  min_f
struct  NotCombiner
struct  OrCombiner
struct  pow_f
struct  power_of
class  SelectorBase
struct  sin_f
struct  sinh_f
struct  sqrt_f
struct  tan_f
struct  tanh_f
struct  TrinarySelector
class  TrinarySelectorSetter
struct  UnaryCutSetter

Typedefs

typedef boost::variant< int8_t,
uint8_t, int16_t, uint16_t,
int32_t, uint32_t, int64_t,
uint64_t, double, float,
std::string > 
AnyMethodArgument
typedef
boost::spirit::parser_error
< reco::parser::SyntaxErrors
BaseException
typedef std::vector
< boost::shared_ptr
< ComparisonBase > > 
ComparisonStack
typedef boost::shared_ptr
< ExpressionBase
ExpressionPtr
typedef std::vector
< boost::shared_ptr
< ExpressionBase > > 
ExpressionStack
typedef std::vector< FunctionFunctionStack
typedef std::vector< intIntStack
typedef std::vector
< AnyMethodArgument
MethodArgumentStack
typedef std::vector
< MethodInvoker
MethodStack
typedef boost::shared_ptr
< SelectorBase
SelectorPtr
typedef std::vector< SelectorPtrSelectorStack
typedef std::vector
< ROOT::Reflex::Type > 
TypeStack

Enumerations

enum  ErrorCodes {
  kNoError = 0, kNameDoesNotExist, kIsNotPublic, kIsStatic,
  kIsNotConst, kIsFunctionAddedByROOT, kIsConstructor, kIsDestructor,
  kIsOperator, kWrongNumberOfArguments, kWrongArgumentType, kOverloaded
}
enum  Function {
  kAbs, kAcos, kAsin, kAtan,
  kAtan2, kChi2Prob, kCos, kCosh,
  kExp, kLog, kLog10, kMax,
  kMin, kPow, kSin, kSinh,
  kSqrt, kTan, kTanh
}
enum  SyntaxErrors { kSyntaxError, kMissingClosingParenthesis, kSpecialError }

Functions

const char * baseExceptionWhat (const BaseException &e)
 returns the appropriate 'what' message for the exception
template<typename T>
bool cutParser (const std::string &cut, SelectorPtr &sel)
template<typename T>
bool expressionParser (const std::string &value, ExpressionPtr &expr)
Exceptionoperator<< (const Exception &e, std::ios_base &(*f)(std::ios_base &))
Exceptionoperator<< (Exception &e, std::ios_base &(*f)(std::ios_base &))
Exceptionoperator<< (const Exception &e, std::ostream &(*f)(std::ostream &))
Exceptionoperator<< (Exception &e, std::ostream &(*f)(std::ostream &))
template<class T>
Exceptionoperator<< (const Exception &e, const T &iT)
template<class T>
Exceptionoperator<< (Exception &e, const T &iT)


Typedef Documentation

typedef boost::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, double,float, std::string> reco::parser::AnyMethodArgument

Definition at line 21 of file AnyMethodArgument.h.

typedef boost::spirit::parser_error<reco::parser::SyntaxErrors> reco::parser::BaseException

Definition at line 37 of file Exception.h.

typedef std::vector<boost::shared_ptr<ComparisonBase> > reco::parser::ComparisonStack

Definition at line 18 of file ComparisonStack.h.

typedef boost::shared_ptr< ExpressionBase > reco::parser::ExpressionPtr

Definition at line 24 of file ExpressionBase.h.

typedef std::vector<boost::shared_ptr<ExpressionBase> > reco::parser::ExpressionStack

Definition at line 18 of file ExpressionStack.h.

typedef std::vector<Function> reco::parser::FunctionStack

Definition at line 17 of file FunctionStack.h.

typedef std::vector<int> reco::parser::IntStack

Definition at line 16 of file IntStack.h.

typedef std::vector<AnyMethodArgument> reco::parser::MethodArgumentStack

Definition at line 17 of file MethodArgumentStack.h.

typedef std::vector<MethodInvoker> reco::parser::MethodStack

Definition at line 17 of file MethodStack.h.

typedef boost::shared_ptr<SelectorBase> reco::parser::SelectorPtr

Definition at line 17 of file SelectorPtr.h.

typedef std::vector<SelectorPtr> reco::parser::SelectorStack

Definition at line 18 of file SelectorStack.h.

typedef std::vector<ROOT::Reflex::Type> reco::parser::TypeStack

Definition at line 17 of file TypeStack.h.


Enumeration Type Documentation

enum reco::parser::ErrorCodes

Enumerator:
kNoError 
kNameDoesNotExist 
kIsNotPublic 
kIsStatic 
kIsNotConst 
kIsFunctionAddedByROOT 
kIsConstructor 
kIsDestructor 
kIsOperator 
kWrongNumberOfArguments 
kWrongArgumentType 
kOverloaded 

Definition at line 30 of file ErrorCodes.h.

00030                       {
00031          kNoError = 0,
00032          kNameDoesNotExist,
00033          kIsNotPublic,
00034          kIsStatic,
00035          kIsNotConst,
00036          kIsFunctionAddedByROOT,
00037          kIsConstructor,
00038          kIsDestructor,
00039          kIsOperator,
00040          kWrongNumberOfArguments,
00041          kWrongArgumentType,
00042          kOverloaded
00043       };

enum reco::parser::Function

Enumerator:
kAbs 
kAcos 
kAsin 
kAtan 
kAtan2 
kChi2Prob 
kCos 
kCosh 
kExp 
kLog 
kLog10 
kMax 
kMin 
kPow 
kSin 
kSinh 
kSqrt 
kTan 
kTanh 

Definition at line 18 of file Function.h.

00018                   { 
00019       kAbs, kAcos, kAsin, kAtan, kAtan2, kChi2Prob, kCos, kCosh, kExp, 
00020       kLog, kLog10, kMax, kMin, kPow, kSin, kSinh, kSqrt, kTan, kTanh 
00021     };

enum reco::parser::SyntaxErrors

Enumerator:
kSyntaxError 
kMissingClosingParenthesis 
kSpecialError 

Definition at line 31 of file Exception.h.

00031                         {
00032          kSyntaxError,
00033          kMissingClosingParenthesis,
00034          kSpecialError
00035       };


Function Documentation

const char* reco::parser::baseExceptionWhat ( const BaseException &  e  )  [inline]

returns the appropriate 'what' message for the exception

Definition at line 40 of file Exception.h.

References kMissingClosingParenthesis, kSpecialError, and kSyntaxError.

Referenced by cutParser(), and expressionParser().

00040                                                                     {
00041          switch(e.descriptor) {
00042             case kMissingClosingParenthesis:
00043             return "Missing close parenthesis.";
00044             case kSyntaxError:
00045             return "Syntax error.";
00046             case kSpecialError:
00047             default:
00048                break;
00049          }
00050          return e.what();
00051       }

template<typename T>
bool reco::parser::cutParser ( const std::string &  cut,
SelectorPtr &  sel 
) [inline]

Definition at line 12 of file cutParser.h.

References baseExceptionWhat(), c, edm::errors::Configuration, e, and parse().

00012                                                              {
00013       bool justBlanks = true;
00014       for(std::string::const_iterator c = cut.begin(); c != cut.end(); ++c) {
00015          if(*c != ' ') { justBlanks = false; break; }
00016       }
00017       if(justBlanks) {
00018          sel = SelectorPtr(new AnyObjSelector);
00019          return true;
00020       } else {
00021          using namespace boost::spirit;
00022          Grammar grammar(sel, (const T *)(0));
00023          bool returnValue = false;
00024          const char* startingFrom =cut.c_str();
00025          try {
00026             returnValue = parse(startingFrom, grammar.use_parser<0>() >> end_p, space_p).full;
00027          } 
00028          catch(BaseException& e) {
00029             throw edm::Exception(edm::errors::Configuration)<<"Cut parser error:"<<baseExceptionWhat(e)<<" (char "<<e.where-startingFrom<<")\n";
00030          }
00031          return returnValue;
00032       }
00033     } 

template<typename T>
bool reco::parser::expressionParser ( const std::string &  value,
ExpressionPtr &  expr 
) [inline]

Definition at line 11 of file expressionParser.h.

References baseExceptionWhat(), edm::errors::Configuration, e, and parse().

00011                                                                           {
00012       using namespace boost::spirit;
00013       Grammar grammar(expr, (const T*)(0));
00014       bool returnValue = false;
00015       const char* startingFrom = value.c_str();
00016       try {
00017          returnValue=parse(startingFrom, grammar.use_parser<1>() >> end_p, space_p).full;
00018       } catch(BaseException&e){
00019          throw edm::Exception(edm::errors::Configuration)<<"Expression parser error:"<<baseExceptionWhat(e)<<" (char "<<e.where-startingFrom<<")\n";
00020       }
00021       return returnValue;
00022     }

Exception& reco::parser::operator<< ( const Exception e,
std::ios_base &(*)(std::ios_base &)  f 
) [inline]

Definition at line 108 of file Exception.h.

References f.

00108                                                                                        {
00109          f(const_cast<Exception&>(e).ost_);
00110          return const_cast<Exception&>(e);
00111       }

Exception& reco::parser::operator<< ( Exception e,
std::ios_base &(*)(std::ios_base &)  f 
) [inline]

Definition at line 104 of file Exception.h.

References f, and reco::parser::Exception::ost_.

00104                                                                                  {
00105          f(e.ost_);
00106          return e;
00107       }      

Exception& reco::parser::operator<< ( const Exception e,
std::ostream &(*)(std::ostream &)  f 
) [inline]

Definition at line 99 of file Exception.h.

References f.

00100       {
00101          f(const_cast<Exception&>(e).ost_);
00102          return const_cast<Exception&>(e);
00103       }

Exception& reco::parser::operator<< ( Exception e,
std::ostream &(*)(std::ostream &)  f 
) [inline]

Definition at line 94 of file Exception.h.

References f, and reco::parser::Exception::ost_.

00095       {
00096          f(e.ost_);
00097          return e;
00098       }

template<class T>
Exception& reco::parser::operator<< ( const Exception e,
const T &  iT 
) [inline]

Definition at line 91 of file Exception.h.

00091                                                                     {
00092          return operator<<(const_cast<Exception&>(e), iT);
00093       }

template<class T>
Exception& reco::parser::operator<< ( Exception e,
const T &  iT 
) [inline]

Definition at line 86 of file Exception.h.

References reco::parser::Exception::ost_.

00086                                                                {
00087          e.ost_ << iT;
00088          return e;
00089       }


Generated on Tue Jun 9 18:52:20 2009 for CMSSW by  doxygen 1.5.4