DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Namespaces | Macros | Functions
GrammarParsed.h File Reference
#include <DD4hep/Grammar.h>
#include <DD4hep/Printout.h>
#include <Parsers/Parsers.h>
#include <Evaluator/Evaluator.h>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <deque>

Go to the source code of this file.

Namespaces

 dd4hep
 Namespace for the AIDA detector description toolkit.
 
 dd4hep::detail
 DD4hep internal namespace.
 

Macros

#define DD4HEP_PARSER_GRAMMAR_CNAME(serial, name)   namespace_dd4hep__grammar_##serial##_##name
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL(xx, func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_INSTANCE(serial, xx)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial, ctxt, xx, func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL(serial, xx, eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_ROOTMATH(serial, xx, eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL_SERIAL(serial, xx, eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT_SERIAL(serial, xx)   DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL(serial,xx,eval_item)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR(xx, func)   DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(__LINE__,__LINE__,xx,func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT(xx, eval_func)   DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL(__LINE__,xx,eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_ROOTMATH(xx, eval_func)   DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_ROOTMATH(__LINE__,xx,eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT(xx)   DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT_SERIAL(__LINE__,xx)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL(xx, eval_func)   DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL_SERIAL(__LINE__,xx,eval_func)
 
#define DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY(xx, func)   DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY_SERIAL(__LINE__,xx,func)
 

Functions

std::string dd4hep::detail::grammar_pre_parse_map (const std::string &in)
 Helper function to parse data type. More...
 
std::string dd4hep::detail::grammar_pre_parse_cont (const std::string &in)
 Helper function to parse data type. More...
 
std::string dd4hep::detail::grammar_pre_parse_obj (const std::string &in)
 Helper function to parse data type. More...
 
std::pair< int, double > dd4hep::detail::grammar_evaluate_item (std::string val)
 Helper to parse single item. More...
 
template<typename TYPE >
bool dd4hep::detail::grammar_fromString (const BasicGrammar &gr, void *ptr, const std::string &val)
 PropertyGrammar overload: Retrieve value from string. More...
 
template<typename TYPE >
std::string dd4hep::detail::grammar_str (const BasicGrammar &, const void *ptr)
 Serialize a property to a string. More...
 
template<typename T >
int dd4hep::detail::eval_item (T *ptr, const std::string &val)
 Item evaluator. More...
 
template<>
int dd4hep::detail::eval_item< std::string > (std::string *ptr, const std::string &val)
 String evaluator: Nothing to do! More...
 
template<typename T , typename Q >
int dd4hep::detail::eval_pair (std::pair< T, Q > *ptr, std::string str)
 Item evaluator. More...
 
template<typename T >
int dd4hep::detail::eval_obj (T *ptr, const std::string &str)
 Object evaluator. More...
 
template<typename T >
int dd4hep::detail::grammar_eval (const BasicGrammar &, void *, const std::string &)
 

Macro Definition Documentation

◆ DD4HEP_DEFINE_PARSER_GRAMMAR

#define DD4HEP_DEFINE_PARSER_GRAMMAR (   xx,
  func 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(__LINE__,__LINE__,xx,func)

Definition at line 371 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_CONT

#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT (   xx,
  eval_func 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL(__LINE__,xx,eval_func)

Definition at line 372 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_ROOTMATH

#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_ROOTMATH (   serial,
  xx,
  eval_func 
)
Value:
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,1,xx,eval_func) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,2,std::vector<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,3,std::list<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,4,std::set<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,5,dd4hep::detail::Primitive<xx>::int_map_t, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,6,dd4hep::detail::Primitive<xx>::string_map_t, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,7,dd4hep::detail::Primitive<xx>::int_pair_t, eval_pair) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,8,dd4hep::detail::Primitive<xx>::string_pair_t, eval_pair)

Definition at line 351 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL (   serial,
  xx,
  eval_func 
)
Value:
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,1,xx,eval_func) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,2,std::vector<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,3,std::list<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,4,std::set<xx>, eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,5,dd4hep::detail::Primitive<xx>::int_map_t, eval_map) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,6,dd4hep::detail::Primitive<xx>::string_map_t, eval_map) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,7,dd4hep::detail::Primitive<xx>::int_pair_t, eval_pair) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,8,dd4hep::detail::Primitive<xx>::string_pair_t, eval_pair)

Definition at line 341 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL (   xx,
  eval_func 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL_SERIAL(__LINE__,xx,eval_func)

Definition at line 375 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL_SERIAL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_VL_SERIAL (   serial,
  xx,
  eval_func 
)
Value:
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,9,xx,eval_func) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,10,std::vector<xx>,eval_container) \
DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial,11,std::list<xx>,eval_container)

Definition at line 361 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY

#define DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY (   xx,
  func 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_DUMMY_SERIAL(__LINE__,xx,func)

Definition at line 376 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL (   xx,
  func 
)
Value:
namespace dd4hep { namespace detail { \
template<> int grammar_eval<xx>(const BasicGrammar&, void* _p, const std::string& _v) { \
return func ((xx*)_p,_v); \
}}}

Definition at line 295 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_INSTANCE

#define DD4HEP_DEFINE_PARSER_GRAMMAR_INSTANCE (   serial,
  xx 
)
Value:
namespace dd4hep { \
template class Grammar< xx >; \
template BasicGrammar const& BasicGrammar::instance< xx >(); \
template const GrammarRegistry& GrammarRegistry::pre_note<xx>(int); \
} \
namespace DD4HEP_PARSER_GRAMMAR_CNAME(serial,0) { \
static auto s_reg = ::dd4hep::GrammarRegistry::pre_note< xx >(1); \
}

Definition at line 302 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_ROOTMATH

#define DD4HEP_DEFINE_PARSER_GRAMMAR_ROOTMATH (   xx,
  eval_func 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_ROOTMATH(__LINE__,xx,eval_func)

Definition at line 373 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL (   serial,
  ctxt,
  xx,
  func 
)
Value:
DD4HEP_DEFINE_PARSER_GRAMMAR_INSTANCE(DD4HEP_PARSER_GRAMMAR_CNAME(serial,ctxt),xx)

Definition at line 312 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT

#define DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT (   xx)    DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT_SERIAL(__LINE__,xx)

Definition at line 374 of file GrammarParsed.h.

◆ DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT_SERIAL

#define DD4HEP_DEFINE_PARSER_GRAMMAR_U_CONT_SERIAL (   serial,
  xx 
)    DD4HEP_DEFINE_PARSER_GRAMMAR_CONT_SERIAL(serial,xx,eval_item)

Definition at line 366 of file GrammarParsed.h.

◆ DD4HEP_PARSER_GRAMMAR_CNAME

#define DD4HEP_PARSER_GRAMMAR_CNAME (   serial,
  name 
)    namespace_dd4hep__grammar_##serial##_##name

Definition at line 293 of file GrammarParsed.h.

DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL
#define DD4HEP_DEFINE_PARSER_GRAMMAR_SERIAL(serial, ctxt, xx, func)
Definition: GrammarParsed.h:311
DD4HEP_PARSER_GRAMMAR_CNAME
#define DD4HEP_PARSER_GRAMMAR_CNAME(serial, name)
Definition: GrammarParsed.h:292
dd4hep::detail::eval_pair
int eval_pair(std::pair< T, Q > *ptr, std::string str)
Item evaluator.
Definition: GrammarParsed.h:259
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL
#define DD4HEP_DEFINE_PARSER_GRAMMAR_EVAL(xx, func)
Definition: GrammarParsed.h:294
_p
#define _p(x)
Definition: IoStreams.cpp:94