lestes::lang::cplus::lex::macro_storage Class Reference

Storage of defined macros. More...

#include <macro_storage.hh>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

void define (const ptr< macro > &a_macro)
 Defines new macro.
void undef (const ptr< pp_token > &tok)
 Undefines macro.
bool defined (const ptr< pp_token > &tok)
 Tests whether a macro is defined.
ptr< macrolookup (const ptr< token_value > &a_name)
 Searches for a macro of given name.
void clear (void)
 Discards user defined macros.

Static Public Member Functions

static ptr< macro_storagecreate (void)
 Returns new storage.

Protected Member Functions

 macro_storage (void)
 Constructs empty object.
virtual void gc_mark (void)
 Marks the object.

Private Types

typedef map< srp< token_value >,
srp< macro > > 
storage_type
 Type of storage for macros.

Private Attributes

srp< storage_typestorage
 Storage for macros.

Detailed Description

Storage of defined macros.

Represents storage of defined macros. Handles definition, removal and lookup.


Member Typedef Documentation

typedef map< srp<token_value>, srp<macro> > lestes::lang::cplus::lex::macro_storage::storage_type [private]

Type of storage for macros.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::macro_storage::macro_storage ( void   )  [protected]

Constructs empty object.

Constructs empty object.


Member Function Documentation

void lestes::lang::cplus::lex::macro_storage::define ( const ptr< macro > &  a_macro  ) 

Defines new macro.

Defines new macro, checks for redefinition.

Precondition:
a_macro != NULL
Parameters:
a_macro The macro to be defined.

void lestes::lang::cplus::lex::macro_storage::undef ( const ptr< pp_token > &  tok  ) 

Undefines macro.

Undefines macro, checks whether was defined.

Precondition:
tok != NULL
Parameters:
tok The token with name of macro to undefine.

bool lestes::lang::cplus::lex::macro_storage::defined ( const ptr< pp_token > &  tok  ) 

Tests whether a macro is defined.

Tests whether macro of the given name is currently defined.

Precondition:
tok != NULL
Parameters:
tok The token containing macro name to test.
Returns:
true If the macro of this name is defined.

ptr< macro > lestes::lang::cplus::lex::macro_storage::lookup ( const ptr< token_value > &  name  ) 

Searches for a macro of given name.

Searches for macro of given name.

Todo:
pt return special values for __LINE__ etc
Precondition:
name != NULL
Parameters:
name The name of the searched macro.
Returns:
The macro of the given name, or NULL if such macro is not defined.

void lestes::lang::cplus::lex::macro_storage::clear ( void   ) 

Discards user defined macros.

ptr< macro_storage > lestes::lang::cplus::lex::macro_storage::create ( void   )  [static]

Returns new storage.

Returns new instance of the class.

Returns:
The new storage.

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

Marks the object.

Marks the object.

Reimplemented from lestes::std::mem::keystone.


Member Data Documentation

srp<storage_type> lestes::lang::cplus::lex::macro_storage::storage [private]

Storage for macros.


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