| # 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::RealUnitsGrammar Class Reference

`#include <ParserGrammar.h>`

Collaboration diagram for Gaudi::Parsers::RealUnitsGrammar:

[legend]
List of all members.

## Detailed Description

The valid represenation of reals with units are

- 1, 1.0, 1.0e+2, 1e-2, 0.5mm, 0.5 mm, 0.5*mm.

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 128 of file ParserGrammar.h.

## Public Types
typedef long double | ResultT
## Public Member Functions
| RealUnitsGrammar ()
void | matchRealUnits () const
void | matchReal (ResultT value) const
void | matchPosition (IteratorT value) const
void | matchUnit (const std::string &unit) const
void | setParser (Parser *parser)
| Set up pointer to Parser.
## Private Attributes
Parser * | m_parser
## Classes
struct | definition

## Member Typedef Documentation

typedef long double Gaudi::Parsers::RealUnitsGrammar::ResultT

Definition at line 133 of file ParserGrammar.h.

## Constructor & Destructor Documentation

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

Definition at line 134 of file ParserGrammar.h.

    00134 :m_parser(NULL){}

## Member Function Documentation

void Gaudi::Parsers::RealUnitsGrammar::matchRealUnits | ( |  | ) | const`[inline]`

Definition at line 159 of file ParserGrammar.h.

References Gaudi::Utils::toString().

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

    00160       {
    00161         val() = Gaudi::Utils::toString ( attrs().get<1>() );
    00162       }

void Gaudi::Parsers::RealUnitsGrammar::matchReal | ( | ResultT | value | ) | const`[inline]`

Definition at line 165 of file ParserGrammar.h.

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

    00166       { attrs().get<1>()=value; }

void Gaudi::Parsers::RealUnitsGrammar::matchPosition | ( | IteratorT | value | ) | const`[inline]`

Definition at line 169 of file ParserGrammar.h.

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

    00170       { attrs().get<0>()=value; }

void Gaudi::Parsers::RealUnitsGrammar::matchUnit | ( | const std::string & | unit | ) | const`[inline]`

Definition at line 173 of file ParserGrammar.h.

References m_parser, and Gaudi::Parsers::Parser::matchUnit().

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

    00174       {
    00175         if (NULL == m_parser) return;
    00176         file_position fpos = attrs().get<0>().get_position();
    00177         Position pos(fpos.file,fpos.line,fpos.column);
    00178
    00179         attrs().get<1>() *= m_parser->matchUnit(unit,pos);
    00180       }

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

Set up pointer to Parser.

Parameters:

  | parser | Pouinter to parser

Definition at line 185 of file ParserGrammar.h.

References m_parser.

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

    00185 {m_parser = parser;}

## Member Data Documentation

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

Definition at line 187 of file ParserGrammar.h.

Referenced by matchUnit(), 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