Gaudi Framework, version v22r4

Home   Generated: Fri Sep 2 2011

ParsersFactory.h

Go to the documentation of this file.
00001 // ============================================================================
00002 #ifndef GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
00003 #define GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H 1
00004 // ============================================================================
00005 // Include files
00006 // ============================================================================
00007 // STD & STL
00008 // ============================================================================
00009 #include <string>
00010 #include <vector>
00011 #include <map>
00012 // ============================================================================
00013 // Boost:
00014 // ============================================================================
00015 #include <boost/mpl/assert.hpp>
00016 #include <boost/type_traits.hpp>
00017 // ============================================================================
00018 // Gaudi
00019 // ============================================================================
00020 #include "GaudiKernel/StatusCode.h"
00021 #include "GaudiKernel/GrammarsV2.h"
00022 // ============================================================================
00023 namespace Gaudi {
00024   namespace Parsers {
00025     // ========================================================================
00026     typedef std::string::const_iterator IteratorT;
00027     //typedef boost::spirit::ascii::space_type Skipper;
00028     typedef SkipperGrammar<IteratorT> Skipper;
00029     // ========================================================================
00030     template<typename ResultT> inline StatusCode
00031     parse_(ResultT& result, const std::string& input){
00032       Skipper skipper;
00033       typename Grammar_<IteratorT, ResultT, Skipper>::Grammar g;
00034       IteratorT iter = input.begin(), end = input.end();
00035       return qi::phrase_parse( iter, end, g, skipper , result) && (iter==end);
00036     }
00037     //=========================================================================
00038     template<> inline StatusCode
00039     parse_(std::string& result, const std::string& input){
00040       Skipper skipper;
00041       Grammar_<IteratorT, std::string, Skipper>::Grammar g;
00042       IteratorT iter = input.begin(), end = input.end();
00043       if (!(qi::phrase_parse( iter, end, g, skipper, result) && (iter==end))){
00044         result = input;
00045       }
00046       //@attention always
00047       return true;
00048     }
00049     //=========================================================================
00050   }/* Parsers */
00051 } /*  Gaudi */
00052 //=============================================================================
00053 #endif // GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
00054 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Fri Sep 2 2011 16:24:34 for Gaudi Framework, version v22r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004