Gaudi Framework, version v25r2
Home
Generated: Wed Jun 4 2014
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
.cern.ch
sw
Gaudi
releases
GAUDI
GAUDI_v25r2
GaudiKernel
GaudiKernel
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;
28
typedef
SkipperGrammar<IteratorT>
Skipper
;
29
// ========================================================================
30
template
<
typename
ResultT>
inline
StatusCode
31
parse_
(ResultT& result,
const
std::string& input){
32
Skipper
skipper;
33
typename
Grammar_<IteratorT, ResultT, Skipper>::Grammar
g
;
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;
41
Grammar_<IteratorT, std::string, Skipper>::Grammar
g
;
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
Generated at Wed Jun 4 2014 14:48:57 for Gaudi Framework, version v25r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004