lestes::lang::cplus::lex::taboo_macros Class Reference

Set of taboo macros. More...

#include <taboo_macros.hh>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

ucn_string names_get (void) const
bool contains (const ptr< macro > &a_macro) const
 Tests macro membership.
ptr< taboo_macrosextend (const ptr< macro > &a_macro) const
 Returns new set with added macro.

Static Public Member Functions

static ptr< taboo_macroscreate (void)
 Returns empty set.

Protected Member Functions

 taboo_macros (void)
 Creates empty set.
virtual void gc_mark (void)
 Marks the object.

Private Types

typedef ::lestes::std::set<
srp< macro > > 
taboo_type
 Type of set of macros.
typedef ::lestes::std::map<
srp< macro >, srp< taboo_macros > > 
shared_type
 Type of auxiliary map for sharing newly created instances.

Private Member Functions

 taboo_macros (const ptr< taboo_macros > &copy, const ptr< macro > &a_macro)
 Creates a copy of the object with added macro.

Private Attributes

srp< taboo_typetaboo
 Set of taboo macros.
srp< shared_typeshared
 Internal map to remember objects created by extend.

Static Private Attributes

static ptr< taboo_macrosempty_instance
 Internal shared empty instance.

Detailed Description

Set of taboo macros.

Represents a set of macros, which shall not be expanded. The set is constant and extending it creates a new set.


Member Typedef Documentation

typedef ::lestes::std::set< srp<macro> > lestes::lang::cplus::lex::taboo_macros::taboo_type [private]

Type of set of macros.

typedef ::lestes::std::map< srp<macro>, srp<taboo_macros> > lestes::lang::cplus::lex::taboo_macros::shared_type [private]

Type of auxiliary map for sharing newly created instances.


Constructor & Destructor Documentation

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

Creates empty set.

Creates new empty set.

Postcondition:
taboo->length() == 0

shared->length() == 0

lestes::lang::cplus::lex::taboo_macros::taboo_macros ( const ptr< taboo_macros > &  source,
const ptr< macro > &  a_macro 
) [private]

Creates a copy of the object with added macro.

Creates copy of set, adding a new macro.

Precondition:
source != NULL
Postcondition:
taboo->length() == source->taboo->length() + (source->contains(a_macro) ? 0 : 1)

shared->length() == 0

Parameters:
source The source object to copy.
a_macro The macro to insert into new object's set.


Member Function Documentation

ucn_string lestes::lang::cplus::lex::taboo_macros::names_get ( void   )  const

bool lestes::lang::cplus::lex::taboo_macros::contains ( const ptr< macro > &  a_macro  )  const

Tests macro membership.

Tests whether the taboo set contains a macro.

Parameters:
a_macro The macro to test.
Returns:
true If the macro is contained in the set.

ptr< taboo_macros > lestes::lang::cplus::lex::taboo_macros::extend ( const ptr< macro > &  a_macro  )  const

Returns new set with added macro.

Returns new taboo set with added macro.

Precondition:
a_macro != NULL
Parameters:
a_macro The macro to be added to the new taboo.
Returns:
New object with set extended by a_macro.

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

Returns empty set.

Returns empty taboo set.

Postcondition:
taboo->length() == 0
Returns:
Instance containing no macros.

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

Marks the object.

Marks the object.

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


Member Data Documentation

srp<taboo_type> lestes::lang::cplus::lex::taboo_macros::taboo [private]

Set of taboo macros.

srp<shared_type> lestes::lang::cplus::lex::taboo_macros::shared [mutable, private]

Internal map to remember objects created by extend.

ptr< taboo_macros > lestes::lang::cplus::lex::taboo_macros::empty_instance [static, private]

Internal shared empty instance.

The shared empty instance of taboo macros. Used for fast initialization of tokens.


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