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

`#include <ParserGrammar.h>`

Collaboration diagram for Gaudi::Parsers::UnitsFileGrammar:

[legend]
List of all members.

## Detailed Description

The valid represenation units file: `1 cm = 10 1 m = 1000` .

See also:
  Gaudi::Parsers::RealUnitsGrammar

  Gaudi::Parsers::IdentifierGrammar

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com

  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 205 of file ParserGrammar.h.

## Public Member Functions
| UnitsFileGrammar (Parser *parser)
| Constructor.
void | matchUnit () const
| Action called when matched unit definition.
void | matchLeftReal (double real) const
| Action called when number matched in left part of definition.
void | matchLeftUnit (std::string newunit) const
| Action called when new unit name matched.
void | matchRight (std::string value) const
| Action called when right part number (possible with unit) matched.
Parser * | parser () const
| Pointer to parser.
## Private Attributes
Parser * | m_parser
## Classes
struct | definition

## Constructor & Destructor Documentation

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

Constructor.

Parameters:

  | parser | Pointer to parser object

Definition at line 215 of file ParserGrammar.h.

    00216         : m_parser(parser) {}

## Member Function Documentation

void Gaudi::Parsers::UnitsFileGrammar::matchUnit | ( |  | ) | const`[inline]`

Action called when matched unit definition.

Definition at line 219 of file ParserGrammar.h.

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

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

    00220       {
    00221         file_position fpos = val().get_position();
    00222         m_parser->matchUnitEntry
    00223           (attrs().get<0>(),attrs().get<1>(),
    00224            Position(fpos.file,fpos.line,fpos.column));
    00225         attrs().get<1>() = 1;
    00226       }

void Gaudi::Parsers::UnitsFileGrammar::matchLeftReal | ( | double | real | ) | const`[inline]`

Action called when number matched in left part of definition.

Parameters:

  | real | Matched number

Definition at line 231 of file ParserGrammar.h.

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

    00232       { attrs().get<1>() = real; }

void Gaudi::Parsers::UnitsFileGrammar::matchLeftUnit | ( | std::string | newunit | ) | const`[inline]`

Action called when new unit name matched.

Parameters:

  | newunit | Matched name

Definition at line 238 of file ParserGrammar.h.

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

    00239       { attrs().get<0>() = newunit; }

void Gaudi::Parsers::UnitsFileGrammar::matchRight | ( | std::string | value | ) | const`[inline]`

Action called when right part number (possible with unit) matched.

Parameters:

  | value | String representation of number

Definition at line 245 of file ParserGrammar.h.

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

    00246       { attrs().get<1>() =
    00247           boost::lexical_cast<double>(value)/attrs().get<1>(); }

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

Pointer to parser.

Definition at line 271 of file ParserGrammar.h.

References m_parser.

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

    00271 { return m_parser;}

## Member Data Documentation

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

Definition at line 273 of file ParserGrammar.h.

Referenced by matchUnit(), and parser().

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