Go to the documentation of this file.00001
00002 #ifndef GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
00003 #define GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H 1
00004
00005
00006
00007
00008
00009 #include <string>
00010 #include <vector>
00011 #include <map>
00012
00013
00014
00015 #include <boost/mpl/assert.hpp>
00016 #include <boost/type_traits.hpp>
00017
00018
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
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
00047 return true;
00048 }
00049
00050 }
00051 }
00052
00053 #endif // GAUDIPROPERTYPARSERS_PARSERSGENERATOR_H
00054