lestes::lang::cplus::lex::token_value Class Reference

Token value. More...

#include <token_value.hh>

Inheritance diagram for lestes::lang::cplus::lex::token_value:

Inheritance graph
[legend]
List of all members.

Public Types

typedef ucn_string content_type
 Type of content.

Public Member Functions

ucn_string content_get (void) const
 Returns content.
bool equals (const ptr< token_value > &other) const
 Tests equality.
bool less_than (const ptr< token_value > &other) const
 Tests inequality.
ulint hash (void) const
 returns hash of the content

Static Public Member Functions

static ptr< token_valuecreate (const content_type &a_content)
 Returns object initialized with content.

Private Types

typedef ::lestes::std::map<
content_type, srp< token_value >,
compare_content
shared_type
 Type of structure for sharing instances.

Private Member Functions

 token_value (const content_type &a_content)
 Creates object with content.

Private Attributes

content_type content
 The representation of the value.

Static Private Attributes

static ptr< shared_typeshared = token_value::shared_type::create()
 Structure for sharing instances.

Classes

struct  compare_content
 Less than comparator. More...
struct  compare_less
 Less than comparator for token_value. More...

Detailed Description

Token value.

Represents token value, wrapping ucn_string. The object is constant and shared.


Member Typedef Documentation

typedef ucn_string lestes::lang::cplus::lex::token_value::content_type

Type of content.

typedef ::lestes::std::map<content_type,srp<token_value>,compare_content> lestes::lang::cplus::lex::token_value::shared_type [private]

Type of structure for sharing instances.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::token_value::token_value ( const content_type a_content  )  [private]

Creates object with content.

Constructs object, initializes with a_content.

Postcondition:
is_equal(content,a_content)
Parameters:
a_content The initialization value.


Member Function Documentation

ptr< token_value > lestes::lang::cplus::lex::token_value::create ( const content_type a_content  )  [static]

Returns object initialized with content.

Returns new token value, initializes with a_content.

Parameters:
a_content The initialization value.

token_value::content_type lestes::lang::cplus::lex::token_value::content_get ( void   )  const

Returns content.

Returns content of value object.

Returns:
The content of the object.

bool lestes::lang::cplus::lex::token_value::equals ( const ptr< token_value > &  other  )  const

Tests equality.

Tests equality. Because of sharing instances, only pointers are compared.

Parameters:
other The token value to compare to.
Returns:
true If both contents are equal.

bool lestes::lang::cplus::lex::token_value::less_than ( const ptr< token_value > &  other  )  const

Tests inequality.

Compares to other token value. The content is compared with < operator.

Parameters:
other The token value to compare.
Returns:
true If the other is not null and the content compares less.

ulint lestes::lang::cplus::lex::token_value::hash ( void   )  const

returns hash of the content

Returns hash value of content.

Returns:
The hash value.


Member Data Documentation

content_type lestes::lang::cplus::lex::token_value::content [private]

The representation of the value.

ptr< token_value::shared_type > lestes::lang::cplus::lex::token_value::shared = token_value::shared_type::create() [static, private]

Structure for sharing instances.

Structure for sharing instances of token value having the same content.


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:43:53 2007 for lestes by doxygen 1.5.1-20070107