Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Parsers.icpp
Go to the documentation of this file.
1 // $Id: Parsers.icpp,v 1.5 2008/10/28 14:02:18 marcocle Exp $
2 // ============================================================================
3 #ifndef GAUDIKERNEL_PARSERS_ICPP
4 #define GAUDIKERNEL_PARSERS_ICPP 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // STD&STL
9 // ============================================================================
10 #include <vector>
11 #include <map>
12 #include <string>
13 // ============================================================================
14 // Boost.Bind
15 // ============================================================================
16 #include "boost/bind.hpp"
17 // ============================================================================
18 // Boost.Spirit, Boost.Spirit.Phoenix
19 // ============================================================================
20 #include <boost/version.hpp>
21 #if BOOST_VERSION >= 103800
22 // FIXME: Move to the new boost::spirit::classic namespace
23 #if !defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
24 #define BOOST_SPIRIT_USE_OLD_NAMESPACE
25 #endif
26 #include <boost/spirit/include/classic.hpp>
27 #include <boost/spirit/include/phoenix1.hpp>
28 #else
29 #include <boost/spirit.hpp>
30 #include <boost/spirit/phoenix.hpp>
31 #endif
32 // ============================================================================
33 // GaudiKernel
34 // ============================================================================
35 #include "GaudiKernel/Parsers.h"
36 #include "GaudiKernel/Grammars.h"
37 // ============================================================================
55 // ============================================================================
56 namespace Gaudi
57 {
58  namespace Parsers
59  {
60  using namespace std;
61  using namespace boost::spirit ;
62 
64  typedef boost::spirit::position_iterator<string::const_iterator> IteratorT;
65 
67  inline IteratorT createIterator( const std::string& input)
68  { return IteratorT ( input.begin(), input.end() ) ; }
69 
70  // ========================================================================
83  // ========================================================================
84  template<typename IntegerT>
86  (IntegerT& result,const string& input)
87  {
89  return parse
90  ( createIterator(input),
91  IteratorT(),
92  g[var(result)=arg1]).full;
93  }
94  // ========================================================================
110  // ========================================================================
111  template<typename IntegerT>
113  ( std::vector<IntegerT>& result,const string& input)
114  {
116  return parse
117  ( createIterator(input),
118  IteratorT(),
119  g[var(result)=arg1],
120  SkipperGrammar()).full;
121  }
122  // ========================================================================
135  // ========================================================================
136  template<typename CharT>
137  inline StatusCode parse_char
138  ( CharT& result , const string& input )
139  {
141  return parse
142  ( createIterator(input),
143  IteratorT(),
144  g[var(result)=arg1]).full;
145  }
146  // ========================================================================
162  // ========================================================================
163  template<typename CharT>
165  (std::vector<CharT>& result,const string& input)
166  {
168  return parse
169  ( createIterator(input),
170  IteratorT(),
171  g[var(result)=arg1],
172  SkipperGrammar()).full;
173  }
174  // ========================================================================
187  template<typename RealT>
188  inline StatusCode parse_real
189  ( RealT& result , const string& input)
190  {
192  return parse
193  ( createIterator(input),
194  IteratorT(),
195  g[var(result)=arg1],
196  SkipperGrammar()).full;
197  }
198  // ========================================================================
214  // ========================================================================
215  template<typename RealT>
217  ( std::vector<RealT>& result,const string& input)
218  {
220  return parse
221  ( createIterator(input),
222  IteratorT(),
223  g[var(result)=arg1],
224  SkipperGrammar()).full;
225  }
226  } // end of namespace Gaudi::Parsers
227 } // end of namespace Gaudi
228 // ============================================================================
229 #endif
230 // ============================================================================
231 // The END
232 // ============================================================================
233 
234 

Generated at Wed Jan 30 2013 17:13:39 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004