The Gaudi Framework  master (37c0b60a)
Gaudi::Parsers::FileGrammar< Iterator, Skipper > Struct Template Reference

#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/JobOptionsSvc/Grammar.h>

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

Public Member Functions

 FileGrammar ()
 

Public Attributes

qi::rule< Iterator, Node(), Skipperfile
 
qi::rule< Iterator, Node(), Skipperinclude
 
qi::rule< Iterator, Node(), Skipperassign
 
qi::rule< Iterator, Node(), Skipperproperty
 
qi::rule< Iterator, Node(), Skipperproperty_ref
 
qi::rule< Iterator, Node(), Skipperoper
 
qi::rule< Iterator, Node(), Skippermap_value
 
qi::rule< Iterator, Node(), Skipperpair_value
 
qi::rule< Iterator, Node(), Skippersimple_value
 
qi::rule< Iterator, Node(), Skipperpair
 
qi::rule< Iterator, Node(), Skipperunits
 
qi::rule< Iterator, Node(), Skipperprint_options
 
qi::rule< Iterator, Node(), Skipperpragma
 
qi::rule< Iterator, Node(), Skipperpragma_print
 
qi::rule< Iterator, Node(), Skipperpragma_tree
 
qi::rule< Iterator, Node(), Skipperpragma_dump_file
 
qi::rule< Iterator, Node(), qi::locals< std::string > > shell
 
qi::rule< Iterator, Node(), qi::locals< Iterator >, Skipperstatement
 
qi::rule< Iterator, Node(), qi::locals< Iterator >, Skippervalue
 
qi::rule< Iterator, Node(), qi::locals< char >, Skippervector_value
 
qi::rule< Iterator, Node(), qi::locals< Node, Node >, Skippercondition
 
qi::rule< Iterator, char()> begin_vector
 
qi::rule< Iterator, void(char)> end_vector
 
StringGrammar< Iterator, Skippergstring
 
BoolGrammar< Iterator, Skippergbool
 
RealGrammar< Iterator, Skippergreal
 
IdentifierGrammar< Iterator, Skippergidentifier
 
ph::function< NodeOperationsop
 

Detailed Description

template<typename Iterator, typename Skipper>
struct Gaudi::Parsers::FileGrammar< Iterator, Skipper >

Definition at line 144 of file Grammar.h.

Constructor & Destructor Documentation

◆ FileGrammar()

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

Definition at line 145 of file Grammar.h.

145  : FileGrammar::base_type( file ) {
146  file = -shell[op( qi::_val, qi::_1 )] >> *( statement[op( qi::_val, qi::_1 )] )[op( qi::_val, Node::kRoot )];
147  shell = rep::confix(
148  "#!",
149  qi::eol )[*( qi::char_[qi::_a += qi::_1] - qi::eol )][op( qi::_val, Node::kShell )][op( qi::_val, qi::_a )];
150  statement = rep::qi::iter_pos[qi::_a = qi::_1] >> ( include | assign | units | print_options | pragma |
151  condition )[qi::_val = qi::_1][op( qi::_val, qi::_a )];
152  condition =
153  ( qi::lit( "#ifdef" )[op( qi::_a, Node::kIfdef )] | qi::lit( "#ifndef" )[op( qi::_a, Node::kIfndef )] ) >>
154  property[op( qi::_val, qi::_1 )] >> ( *statement[op( qi::_a, qi::_1 )] )[op( qi::_val, qi::_a )] >>
155  -( qi::lit( "#else" )[op( qi::_b, Node::kElse )] >>
156  *statement[op( qi::_b, qi::_1 )] )[op( qi::_val, qi::_b )] >>
157  qi::lit( "#endif" )[op( qi::_val, Node::kCondition )];
158  include = qi::lit( "#include" ) >> gstring[op( qi::_val, qi::_1 )][op( qi::_val, Node::kInclude )];
159  units = qi::lit( "#units" ) >> gstring[op( qi::_val, qi::_1 )][op( qi::_val, Node::kUnits )];
160  print_options = qi::lit( "#printOptions" ) >> qi::lit( "full" )[op( qi::_val, Node::kPrintOptions )];
161  pragma = qi::lit( "#pragma" ) >> ( pragma_print | pragma_tree | pragma_dump_file );
162  pragma_print = qi::lit( "print" ) >> enc::no_case[qi::lit( "on" )[op( qi::_val, Node::kPrintOn )] |
163  qi::lit( "off" )[op( qi::_val, Node::kPrintOff )]];
164  pragma_tree = enc::no_case[qi::lit( "printtree" )[op( qi::_val, Node::kPrintTree )]];
165  pragma_dump_file = qi::lit( "dumpfile" ) >> gstring[op( qi::_val, qi::_1 )][op( qi::_val, Node::kDumpFile )];
166  assign = property[op( qi::_val, qi::_1 )][op( qi::_val, Node::kAssign )] >> oper[op( qi::_val, qi::_1 )] >>
167  value[op( qi::_val, qi::_1 )] >> ';';
168  property = rep::qi::iter_pos[op( qi::_val, qi::_1 )] >>
169  ( gidentifier[op( qi::_val, qi::_1 )] % '.' )[op( qi::_val, Node::kProperty )];
170  property_ref %= -qi::lit( '@' ) >> property[op( qi::_val, Node::kPropertyRef )];
171  oper = rep::qi::iter_pos[op( qi::_val, qi::_1 )] >>
172  ( qi::lit( "=" )[op( qi::_val, Node::kEqual )] | qi::lit( "+=" )[op( qi::_val, Node::kPlusEqual )] |
173  qi::lit( "-=" )[op( qi::_val, Node::kMinusEqual )] );
174  value = rep::qi::iter_pos[qi::_a = qi::_1] >> ( map_value | vector_value | simple_value | property |
175  property_ref )[qi::_val = qi::_1][op( qi::_val, qi::_a )];
176  begin_vector =
177  enc::char_( '(' )[qi::_val = ')'] | enc::char_( '[' )[qi::_val = ']'] | enc::char_( '{' )[qi::_val = '}'];
178  end_vector = qi::char_( qi::_r1 );
179  vector_value = ( begin_vector[qi::_a = qi::_1] >> -( value[op( qi::_val, qi::_1 )] % ',' ) >>
180  end_vector( qi::_a ) )[op( qi::_val, Node::kVector )];
181  map_value = ( enc::char_( '{' ) >> -( pair[op( qi::_val, qi::_1 )] % ',' ) >>
182  enc::char_( '}' ) )[op( qi::_val, Node::kMap )];
183  pair =
184  simple_value[op( qi::_val, qi::_1 )] >> ':' >> value[op( qi::_val, qi::_1 )][op( qi::_val, Node::kPair )];
185  simple_value = ( gstring[op( qi::_val, qi::_1 )][op( qi::_val, Node::kString )] ) |
186  ( gbool[op( qi::_val, qi::_1 )][op( qi::_val, Node::kBool )] ) | ( greal[qi::_val = qi::_1] );
187  }

Member Data Documentation

◆ assign

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::assign

Definition at line 188 of file Grammar.h.

◆ begin_vector

template<typename Iterator , typename Skipper >
qi::rule<Iterator, char()> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::begin_vector

Definition at line 194 of file Grammar.h.

◆ condition

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), qi::locals<Node, Node>, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::condition

Definition at line 193 of file Grammar.h.

◆ end_vector

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

Definition at line 195 of file Grammar.h.

◆ file

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::file

Definition at line 188 of file Grammar.h.

◆ gbool

template<typename Iterator , typename Skipper >
BoolGrammar<Iterator, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::gbool

Definition at line 197 of file Grammar.h.

◆ gidentifier

template<typename Iterator , typename Skipper >
IdentifierGrammar<Iterator, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::gidentifier

Definition at line 199 of file Grammar.h.

◆ greal

template<typename Iterator , typename Skipper >
RealGrammar<Iterator, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::greal

Definition at line 198 of file Grammar.h.

◆ gstring

template<typename Iterator , typename Skipper >
StringGrammar<Iterator, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::gstring

Definition at line 196 of file Grammar.h.

◆ include

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::include

Definition at line 188 of file Grammar.h.

◆ map_value

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::map_value

Definition at line 188 of file Grammar.h.

◆ op

template<typename Iterator , typename Skipper >
ph::function<NodeOperations> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::op

Definition at line 200 of file Grammar.h.

◆ oper

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::oper

Definition at line 188 of file Grammar.h.

◆ pair

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pair

Definition at line 189 of file Grammar.h.

◆ pair_value

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pair_value

Definition at line 188 of file Grammar.h.

◆ pragma

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pragma

Definition at line 189 of file Grammar.h.

◆ pragma_dump_file

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pragma_dump_file

Definition at line 189 of file Grammar.h.

◆ pragma_print

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pragma_print

Definition at line 189 of file Grammar.h.

◆ pragma_tree

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::pragma_tree

Definition at line 189 of file Grammar.h.

◆ print_options

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::print_options

Definition at line 189 of file Grammar.h.

◆ property

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::property

Definition at line 188 of file Grammar.h.

◆ property_ref

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::property_ref

Definition at line 188 of file Grammar.h.

◆ shell

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), qi::locals<std::string> > Gaudi::Parsers::FileGrammar< Iterator, Skipper >::shell

Definition at line 190 of file Grammar.h.

◆ simple_value

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::simple_value

Definition at line 189 of file Grammar.h.

◆ statement

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), qi::locals<Iterator>, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::statement

Definition at line 191 of file Grammar.h.

◆ units

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::units

Definition at line 189 of file Grammar.h.

◆ value

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), qi::locals<Iterator>, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::value

Definition at line 191 of file Grammar.h.

◆ vector_value

template<typename Iterator , typename Skipper >
qi::rule<Iterator, Node(), qi::locals<char>, Skipper> Gaudi::Parsers::FileGrammar< Iterator, Skipper >::vector_value

Definition at line 192 of file Grammar.h.


The documentation for this struct was generated from the following file:
Gaudi::Parsers::Node::kPrintOptions
@ kPrintOptions
Definition: Node.h:60
Gaudi::Parsers::Node::kBool
@ kBool
Definition: Node.h:53
Gaudi::Parsers::FileGrammar::oper
qi::rule< Iterator, Node(), Skipper > oper
Definition: Grammar.h:188
Gaudi::Parsers::Node::kEqual
@ kEqual
Definition: Node.h:44
Gaudi::Parsers::FileGrammar::file
qi::rule< Iterator, Node(), Skipper > file
Definition: Grammar.h:188
Gaudi::Parsers::Node::kInclude
@ kInclude
Definition: Node.h:38
Gaudi::Parsers::Node::kMinusEqual
@ kMinusEqual
Definition: Node.h:46
Gaudi::Parsers::Node::kCondition
@ kCondition
Definition: Node.h:56
Gaudi::Parsers::FileGrammar::simple_value
qi::rule< Iterator, Node(), Skipper > simple_value
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::end_vector
qi::rule< Iterator, void(char)> end_vector
Definition: Grammar.h:195
Gaudi::Parsers::FileGrammar::gidentifier
IdentifierGrammar< Iterator, Skipper > gidentifier
Definition: Grammar.h:199
Gaudi::Parsers::Node::kAssign
@ kAssign
Definition: Node.h:43
Gaudi::Parsers::FileGrammar::pair
qi::rule< Iterator, Node(), Skipper > pair
Definition: Grammar.h:189
Gaudi::Parsers::Node::kPropertyRef
@ kPropertyRef
Definition: Node.h:66
Gaudi::Parsers::Node::kProperty
@ kProperty
Definition: Node.h:40
Gaudi::Parsers::FileGrammar::greal
RealGrammar< Iterator, Skipper > greal
Definition: Grammar.h:198
Gaudi::Parsers::Node::kPrintOn
@ kPrintOn
Definition: Node.h:61
Gaudi::Parsers::Node::kIfdef
@ kIfdef
Definition: Node.h:57
Gaudi::Parsers::Node::kString
@ kString
Definition: Node.h:51
Gaudi::Parsers::FileGrammar::property_ref
qi::rule< Iterator, Node(), Skipper > property_ref
Definition: Grammar.h:188
Gaudi::Parsers::Node::kShell
@ kShell
Definition: Node.h:63
Gaudi::Parsers::FileGrammar::pragma_dump_file
qi::rule< Iterator, Node(), Skipper > pragma_dump_file
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::statement
qi::rule< Iterator, Node(), qi::locals< Iterator >, Skipper > statement
Definition: Grammar.h:191
Gaudi::Parsers::Node::kPlusEqual
@ kPlusEqual
Definition: Node.h:45
Gaudi::Parsers::FileGrammar::assign
qi::rule< Iterator, Node(), Skipper > assign
Definition: Grammar.h:188
Gaudi::Parsers::FileGrammar::pragma_tree
qi::rule< Iterator, Node(), Skipper > pragma_tree
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::map_value
qi::rule< Iterator, Node(), Skipper > map_value
Definition: Grammar.h:188
Gaudi::Parsers::FileGrammar::condition
qi::rule< Iterator, Node(), qi::locals< Node, Node >, Skipper > condition
Definition: Grammar.h:193
Gaudi::Parsers::FileGrammar::vector_value
qi::rule< Iterator, Node(), qi::locals< char >, Skipper > vector_value
Definition: Grammar.h:192
Gaudi::Parsers::FileGrammar::begin_vector
qi::rule< Iterator, char()> begin_vector
Definition: Grammar.h:194
Gaudi::Parsers::FileGrammar::op
ph::function< NodeOperations > op
Definition: Grammar.h:200
Gaudi::Parsers::FileGrammar::units
qi::rule< Iterator, Node(), Skipper > units
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::property
qi::rule< Iterator, Node(), Skipper > property
Definition: Grammar.h:188
Gaudi::Parsers::Node::kDumpFile
@ kDumpFile
Definition: Node.h:65
Gaudi::Parsers::FileGrammar::include
qi::rule< Iterator, Node(), Skipper > include
Definition: Grammar.h:188
Gaudi::Parsers::Node::kVector
@ kVector
Definition: Node.h:47
Gaudi::Parsers::Node::kRoot
@ kRoot
Definition: Node.h:37
Gaudi::Parsers::Node::kElse
@ kElse
Definition: Node.h:59
Gaudi::Parsers::Node::kUnits
@ kUnits
Definition: Node.h:54
Gaudi::Parsers::Node::kPrintTree
@ kPrintTree
Definition: Node.h:64
Gaudi::Parsers::FileGrammar::print_options
qi::rule< Iterator, Node(), Skipper > print_options
Definition: Grammar.h:189
Gaudi::Parsers::Node::kPair
@ kPair
Definition: Node.h:49
Gaudi::Parsers::FileGrammar::gstring
StringGrammar< Iterator, Skipper > gstring
Definition: Grammar.h:196
Gaudi::Parsers::Node::kIfndef
@ kIfndef
Definition: Node.h:58
Gaudi::Parsers::Node::kMap
@ kMap
Definition: Node.h:48
Gaudi::Parsers::FileGrammar::pragma_print
qi::rule< Iterator, Node(), Skipper > pragma_print
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::gbool
BoolGrammar< Iterator, Skipper > gbool
Definition: Grammar.h:197
Gaudi::Parsers::FileGrammar::pragma
qi::rule< Iterator, Node(), Skipper > pragma
Definition: Grammar.h:189
Gaudi::Parsers::FileGrammar::shell
qi::rule< Iterator, Node(), qi::locals< std::string > > shell
Definition: Grammar.h:190
Gaudi::Parsers::Node::kPrintOff
@ kPrintOff
Definition: Node.h:62
Gaudi::Parsers::FileGrammar::value
qi::rule< Iterator, Node(), qi::locals< Iterator >, Skipper > value
Definition: Grammar.h:191