lestes::lang::cplus::lex::cpp_token Class Reference

C++ token. More...

#include <cpp_token.hh>

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

Inheritance graph
[legend]
List of all members.

Public Types

typedef ptr< lex_literalliteral_type
 The type of literal properties.

Public Member Functions

bool equals (const ptr< cpp_token > &rhs) const
 Tests equality.
ptr< lex_literalliteral_get (void) const
 Returns lex literal properties.
lstring description_get (void) const
 Returns token description.
virtual ptr< reflection_listreflection_get (void) const
 Returns list of reflection info.
virtual ptr< field_list_listfield_values_get (void) const
 Returns list of field values.

Static Public Member Functions

static ptr< cpp_tokencreate (const location_type &a_location, const type_type &a_type)
 Returns new token, initializes with token type.
static ptr< cpp_tokencreate (const location_type &a_location, const type_type &a_type, const value_type &a_value)
 Returns new token, initializes with token type and value.
static ptr< cpp_tokencreate_literal (const location_type &a_location, const literal_type &a_literal, const value_type &a_value)
 Returns new literal token, initializes with literal properties and value.

Protected Member Functions

 cpp_token (const location_type &a_location, const type_type &a_type, const value_type &a_value, const literal_type &a_literal)
 Creates the object.
virtual void gc_mark (void)
 Marks the object.

Private Types

typedef map< type_type, lstring > descriptions_type
 Type of descriptions map.

Private Member Functions

 cpp_token (const cpp_token &)
 Hides copy constructor.
cpp_tokenoperator= (const cpp_token &)
 Hides assignment operator.

Private Attributes

srp< lex_literalliteral
 Literal information for semantic analysis.

Static Private Attributes

static ptr< descriptions_typedescriptions = descriptions
 Token descriptions.
static ptr< reflection_listreflection = reflection
 The reflection information.

Detailed Description

C++ token.

Represents C++ token, which is passed to syntactical analysis.


Member Typedef Documentation

typedef ptr<lex_literal> lestes::lang::cplus::lex::cpp_token::literal_type

The type of literal properties.

typedef map<type_type,lstring> lestes::lang::cplus::lex::cpp_token::descriptions_type [private]

Type of descriptions map.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::cpp_token::cpp_token ( const location_type a_location,
const type_type a_type,
const value_type a_value,
const literal_type a_literal 
) [protected]

Creates the object.

lestes::lang::cplus::lex::cpp_token::cpp_token ( const cpp_token  )  [private]

Hides copy constructor.


Member Function Documentation

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

Tests equality.

Tests equality to other token. Does not test literal, only token value.

Precondition:
other != NULL
Parameters:
other The token to compare to.
Returns:
true If both token represent the same entity.

ptr< lex_literal > lestes::lang::cplus::lex::cpp_token::literal_get ( void   )  const

Returns lex literal properties.

Returns literal properties.

Returns:
The information about literal token.

lstring lestes::lang::cplus::lex::cpp_token::description_get ( void   )  const

Returns token description.

Returns the internal description of the token.

Returns:
The string representation of the token type.

ptr< cpp_token > lestes::lang::cplus::lex::cpp_token::create ( const location_type a_location,
const type_type a_type 
) [static]

Returns new token, initializes with token type.

Returns new token, initializes with token type.

Precondition:
a_type != TOK_LITERAL
Parameters:
a_location The location of the token.
a_type The type of token (syntactic class).
Returns:
New C++ token.

ptr< cpp_token > lestes::lang::cplus::lex::cpp_token::create ( const location_type a_location,
const type_type a_type,
const value_type a_value 
) [static]

Returns new token, initializes with token type and value.

Returns new token, initializes with token type and value.

Precondition:
a_type != TOK_LITERAL
Parameters:
a_type The type of token (syntactic class).
a_location The location of the token.
Returns:
New C++ token.

static ptr<cpp_token> lestes::lang::cplus::lex::cpp_token::create_literal ( const location_type a_location,
const literal_type a_literal,
const value_type a_value 
) [static]

Returns new literal token, initializes with literal properties and value.

ptr< object::reflection_list > lestes::lang::cplus::lex::cpp_token::reflection_get ( void   )  const [virtual]

Returns list of reflection info.

Returns reflection list for cpp_token.

Returns:
The reflection list.

Reimplemented from lestes::std::object.

ptr< object::field_list_list > lestes::lang::cplus::lex::cpp_token::field_values_get ( void   )  const [virtual]

Returns list of field values.

Returns values of the fields.

Returns:
List of field values.

Reimplemented from lestes::std::object.

void lestes::lang::cplus::lex::cpp_token::gc_mark ( void   )  [protected, virtual]

Marks the object.

Marks the object.

Reimplemented from lestes::lang::cplus::lex::basic_token< int, ptr< source_location >, ptr< token_value > >.

cpp_token& lestes::lang::cplus::lex::cpp_token::operator= ( const cpp_token  )  [private]

Hides assignment operator.


Member Data Documentation

srp<lex_literal> lestes::lang::cplus::lex::cpp_token::literal [private]

Literal information for semantic analysis.

ptr< cpp_token::descriptions_type > lestes::lang::cplus::lex::cpp_token::descriptions = descriptions [static, private]

Token descriptions.

Descriptions of tokens.

ptr< object::reflection_list > lestes::lang::cplus::lex::cpp_token::reflection = reflection [static, private]

The reflection information.

Reflection list for token.

Reimplemented from lestes::std::object.


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