All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Parsers::StringGrammar< Iterator, Skipper > Class Template Reference

The valid represenation of string values are: More...

#include <src/JobOptionsSvc/Grammar.h>

Inheritance diagram for Gaudi::Parsers::StringGrammar< Iterator, Skipper >:
Collaboration diagram for Gaudi::Parsers::StringGrammar< Iterator, Skipper >:

Classes

struct  definition
 

Public Types

typedef std::string ResultT
 
typedef std::string ResultT
 
typedef std::string ResultT
 

Public Member Functions

 StringGrammar ()
 
void matchString () const
 remove CR/LF symbols form the parsed strings More...
 
 StringGrammar ()
 

Public Attributes

qi::rule< Iterator,
std::string(), qi::locals
< char >, Skipper
str
 
qi::rule< Iterator, char()> begin_quote
 
qi::rule< Iterator, void(char)> quote
 

Detailed Description

template<typename Iterator, typename Skipper>
class Gaudi::Parsers::StringGrammar< Iterator, Skipper >

The valid represenation of string values are:

  • "abc" , "\"abc""
  • 'abs' , '\'abc\''
Todo:
implement not ASCII chars in strings
Author
Alexander MAZUROV Alexa.nosp@m.nder.nosp@m..Mazu.nosp@m.rov@.nosp@m.gmail.nosp@m..com
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-05-14

Definition at line 55 of file Grammar.h.

Member Typedef Documentation

template<typename Iterator, typename Skipper>
typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 58 of file Grammar.h.

template<typename Iterator, typename Skipper>
typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 91 of file GrammarsV2.h.

template<typename Iterator, typename Skipper>
typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 252 of file Grammars.h.

Constructor & Destructor Documentation

template<typename Iterator, typename Skipper>
Gaudi::Parsers::StringGrammar< Iterator, Skipper >::StringGrammar ( )
inline

Definition at line 60 of file Grammar.h.

60  : StringGrammar::base_type(str) {
61  begin_quote = enc::char_("\"'");
62  quote = enc::char_(qi::_r1);
63 
64  str = qi::lexeme[begin_quote[qi::_a = qi::_1] >> *((enc::char_('\\')
65  >> quote(qi::_a))[qi::_val += qi::_a]
66  | (enc::char_[qi::_val += qi::_1] - quote(qi::_a)))
67  >> quote(qi::_a)];
68  }
qi::rule< Iterator, void(char)> quote
Definition: Grammar.h:72
qi::rule< Iterator, std::string(), qi::locals< char >, Skipper > str
Definition: Grammar.h:70
qi::rule< Iterator, char()> begin_quote
Definition: Grammar.h:71
template<typename Iterator, typename Skipper>
Gaudi::Parsers::StringGrammar< Iterator, Skipper >::StringGrammar ( )
inline

Definition at line 93 of file GrammarsV2.h.

93  : StringGrammar::base_type( str ) {
94  begin_quote = enc::char_("\"'");
95  quote = enc::char_(qi::_r1);
96 
97  str = qi::lexeme[begin_quote[qi::_a = qi::_1]
98  > *( (enc::char_('\\') >> quote(qi::_a))[qi::_val += qi::_a]
99  | (enc::char_[qi::_val += qi::_1] - quote(qi::_a))) >
100  quote(qi::_a)]
101  ;
102  }
qi::rule< Iterator, void(char)> quote
Definition: Grammar.h:72
qi::rule< Iterator, std::string(), qi::locals< char >, Skipper > str
Definition: Grammar.h:70
qi::rule< Iterator, char()> begin_quote
Definition: Grammar.h:71

Member Function Documentation

template<typename Iterator, typename Skipper>
void Gaudi::Parsers::StringGrammar< Iterator, Skipper >::matchString ( ) const
inline

remove CR/LF symbols form the parsed strings

Attention
it is a bit dangerous operation The operation allows to write "very long" input strings for opts-files (it is actual e.g. for DataOnDemandSvc configuration) by splitting the strings into few lines All new-line symbols (as well as '
', '', CR/LF etc are substituted by ordinary blanks.

Definition at line 261 of file Grammars.h.

262  {
263  for ( std::string::iterator cur=this->val().begin();
264  cur!=this->val().end();cur++)
265  { if(std::isspace(*cur) ) { *cur = ' '; } }
266  }

Member Data Documentation

template<typename Iterator, typename Skipper>
qi::rule< Iterator, char()> Gaudi::Parsers::StringGrammar< Iterator, Skipper >::begin_quote

Definition at line 71 of file Grammar.h.

template<typename Iterator, typename Skipper>
qi::rule< Iterator, void(char)> Gaudi::Parsers::StringGrammar< Iterator, Skipper >::quote

Definition at line 72 of file Grammar.h.

template<typename Iterator, typename Skipper>
qi::rule< Iterator, std::string(), qi::locals< char >, Skipper > Gaudi::Parsers::StringGrammar< Iterator, Skipper >::str

Definition at line 70 of file Grammar.h.


The documentation for this class was generated from the following files: