| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# Gaudi::Parsers::RealUnitsGrammar Class Reference

The valid represenation of reals with units are

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

More...

`#include <ParserGrammar.h>`

List of all members.

## 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

## 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 137 of file ParserGrammar.h.

## Member Typedef Documentation

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

Definition at line 142 of file ParserGrammar.h.

## Constructor & Destructor Documentation

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

Definition at line 143 of file ParserGrammar.h.

    00143 :m_parser(NULL){}

## Member Function Documentation

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

Definition at line 168 of file ParserGrammar.h.

    00169       {
    00170         val() = Gaudi::Utils::toString ( attrs().get<1>() );
    00171       }

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

Definition at line 174 of file ParserGrammar.h.

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

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

Definition at line 178 of file ParserGrammar.h.

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

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

Definition at line 182 of file ParserGrammar.h.

    00183       {
    00184         if (NULL == m_parser) return;
    00185         file_position fpos = attrs().get<0>().get_position();
    00186         Position pos(fpos.file,fpos.line,fpos.column);
    00187
    00188         attrs().get<1>() *= m_parser->matchUnit(unit,pos);
    00189       }

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

Set up pointer to Parser.

Parameters:

  | parser | Pouinter to parser

Definition at line 194 of file ParserGrammar.h.

    00194 {m_parser = parser;}

## Member Data Documentation

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

Definition at line 196 of file ParserGrammar.h.

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

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