| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Gaudi::Parsers::ValueGrammar Class Reference

`#include <ParserGrammar.h>`

Collaboration diagram for Gaudi::Parsers::ValueGrammar:

[legend]
List of all members.

## Detailed Description

Grammar recognize value that can appear in right side of '=' operator in job options file.

Grammar's EBNF `value ::= vectorvalue | vector_type | property_link. vectorvalue ::= pairvalue | literalvalue | mapvalue. literalvalue ::= realunits_grammar | boolean_grammar | string_grammar. mapvalue ::= literalvalue ('=' | ':') value. pairvalue ::= '(' vectorvalue ',' vectorvalue ')'. vector_type ::= ('{' vectorvalue_list '}') | ('[' vectorvalue_list ']'). vectorvalue_list ::= (vector_value (',' vector_value)*)?. property_link = '@' identifier_grammar ('.' identifier_grammar)+.`

Grammar has two attributes

- boost::tuple<std::string,std::vector<std::string> 0 element contains string representation of top value 1 element contains vector representation of value (if it's vector)
- boost::tuple<int> nested level of vector

See also:
  Gaudi::Parsers::RealUnitsGrammar for realunits_grammar

  Gaudi::Parsers::BoolGrammar for boolean_grammar

  Gaudi::Parsers::StringGrammar for string_grammar

  Gaudi::Parsers::IdentifierGrammar for identifier_grammar

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 312 of file ParserGrammar.h.

## Public Member Functions
| ValueGrammar ()
void | matchBrace (bool isopen) const
| Action called when brace is matched.
void | matchVectorValue (std::string value) const
| Action called when vector value matched.
void | matchValue (std::string value) const
| Action called when right side of '=' top value is matched.
Parser * | parser () const
| Pointer to parser.
void | setParser (Parser *parser)
| Set poinet to parser.
## Private Attributes
Parser * | m_parser
## Classes
struct | definition

## Constructor & Destructor Documentation

Gaudi::Parsers::ValueGrammar::ValueGrammar | ( |  | ) | `[inline]`

Definition at line 316 of file ParserGrammar.h.

    00316 : m_parser(NULL){}

## Member Function Documentation

void Gaudi::Parsers::ValueGrammar::matchBrace | ( | bool | isopen | ) | const`[inline]`

Action called when brace is matched.

Parameters:

  | isopen | true - if this is '{' or '[' brase, false - '}' or ']'

Definition at line 322 of file ParserGrammar.h.

Referenced by Gaudi::Parsers::ValueGrammar::definition< ScannerT >::definition().

    00323       {
    00324         if ( isopen ){ attrs().get<0>()++; }
    00325         else         { attrs().get<0>()--; }
    00326       }

void Gaudi::Parsers::ValueGrammar::matchVectorValue | ( | std::string | value | ) | const`[inline]`

Action called when vector value matched.

Parameters:

  | value | string representation of value

Definition at line 331 of file ParserGrammar.h.

Referenced by Gaudi::Parsers::ValueGrammar::definition< ScannerT >::definition().

    00332       { if(attrs().get<0>()==1){val().get<1>().push_back(value); } }

void Gaudi::Parsers::ValueGrammar::matchValue | ( | std::string | value | ) | const`[inline]`

Action called when right side of '=' top value is matched.

Parameters:

  | value | string representation of value

Definition at line 338 of file ParserGrammar.h.

Referenced by Gaudi::Parsers::ValueGrammar::definition< ScannerT >::definition().

    00338 { val().get<0>() = value; }

Parser* Gaudi::Parsers::ValueGrammar::parser | ( |  | ) | const`[inline]`

Pointer to parser.

Definition at line 341 of file ParserGrammar.h.

References m_parser.

Referenced by Gaudi::Parsers::ValueGrammar::definition< ScannerT >::definition(), and setParser().

    00341 { return m_parser;}

void Gaudi::Parsers::ValueGrammar::setParser | ( | Parser * | parser | ) | `[inline]`

Set poinet to parser.

Definition at line 344 of file ParserGrammar.h.

References m_parser, and parser().

Referenced by Gaudi::Parsers::ParserGrammar::definition< ScannerT >::definition().

    00344 { m_parser = parser; }

## Member Data Documentation

Parser* Gaudi::Parsers::ValueGrammar::m_parser`[private]`

Definition at line 428 of file ParserGrammar.h.

Referenced by parser(), and setParser().

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiSvc/v17r1/src/JobOptionsSvc/ParserGrammar.h