All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ParsersFactory.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
3 #define GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H 1
4 // ============================================================================
5 // Include files
6 // ============================================================================
7 // STD & STL
8 // ============================================================================
9 #include <string>
10 #include <vector>
11 #include <map>
12 // ============================================================================
13 // Boost:
14 // ============================================================================
15 #include <boost/mpl/assert.hpp>
16 #include <boost/type_traits.hpp>
17 // ============================================================================
18 // Gaudi
19 // ============================================================================
20 #include "GaudiKernel/StatusCode.h"
21 #include "GaudiKernel/GrammarsV2.h"
22 // ============================================================================
23 namespace Gaudi {
24  namespace Parsers {
25  // ========================================================================
26  typedef std::string::const_iterator IteratorT;
27  //typedef boost::spirit::ascii::space_type Skipper;
29  // ========================================================================
30  template<typename ResultT> inline StatusCode
31  parse_(ResultT& result, const std::string& input){
32  Skipper skipper;
34  IteratorT iter = input.begin(), end = input.end();
35  return qi::phrase_parse( iter, end, g, skipper , result) && (iter==end);
36  }
37  //=========================================================================
38  template<> inline StatusCode
39  parse_(std::string& result, const std::string& input){
40  Skipper skipper;
42  IteratorT iter = input.begin(), end = input.end();
43  if (!(qi::phrase_parse( iter, end, g, skipper, result) && (iter==end))){
44  result = input;
45  }
46  //@attention always
47  return true;
48  }
49  //=========================================================================
50  }/* Parsers */
51 } /* Gaudi */
52 //=============================================================================
53 #endif // GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
54 
StatusCode parse_(ResultT &result, const std::string &input)
SkipperGrammar< IteratorT > Skipper
boost::spirit::position_iterator< string::const_iterator > IteratorT
the actual type of position iterator
Definition: Parsers.icpp:64
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Skipping spaces and comments.
Definition: Grammar.h:45
tuple end
Definition: IOTest.py:101
dictionary g
Definition: gaudirun.py:364
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:15