Gaudi Framework, version v22r2

Home   Generated: Tue May 10 2011
Classes | Public Member Functions | Private Attributes

Gaudi::Parsers::UnitsFileGrammar Class Reference

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

#include <ParserGrammar.h>

Collaboration diagram for Gaudi::Parsers::UnitsFileGrammar:
Collaboration graph
[legend]

List of all members.

Classes

struct  definition

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.
Parserparser () const
 Pointer to parser.

Private Attributes

Parserm_parser

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


Constructor & Destructor Documentation

Gaudi::Parsers::UnitsFileGrammar::UnitsFileGrammar ( Parser parser ) [inline]

Constructor.

Parameters:
parserPointer to parser object

Definition at line 224 of file ParserGrammar.h.


Member Function Documentation

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

Action called when number matched in left part of definition.

Parameters:
realMatched number

Definition at line 240 of file ParserGrammar.h.

      { attrs().get<1>() = real; }
void Gaudi::Parsers::UnitsFileGrammar::matchLeftUnit ( std::string  newunit ) const [inline]

Action called when new unit name matched.

Parameters:
newunitMatched name

Definition at line 247 of file ParserGrammar.h.

      { 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:
valueString representation of number

Definition at line 254 of file ParserGrammar.h.

      { attrs().get<1>() =
          boost::lexical_cast<double>(value)/attrs().get<1>(); }
void Gaudi::Parsers::UnitsFileGrammar::matchUnit (  ) const [inline]

Action called when matched unit definition.

Definition at line 228 of file ParserGrammar.h.

      {
        file_position fpos = val().get_position();
        m_parser->matchUnitEntry
          (attrs().get<0>(),attrs().get<1>(),
           Position(fpos.file,fpos.line,fpos.column));
        attrs().get<1>() = 1;
      }
Parser* Gaudi::Parsers::UnitsFileGrammar::parser (  ) const [inline]

Pointer to parser.

Definition at line 280 of file ParserGrammar.h.

{ return m_parser;}

Member Data Documentation

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

Definition at line 282 of file ParserGrammar.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Tue May 10 2011 18:55:28 for Gaudi Framework, version v22r2 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004