IdTable

A table for hoarding and retrieving identifiers.

Constructors

this
this()

Constructs an IdTable object.

Members

Functions

genAnonClassID
Identifier* genAnonClassID()

Generates an identifier for an anonymous class.

genAnonEnumID
Identifier* genAnonEnumID()

Generates an identifier for an anonymous enum.

genAnonStructID
Identifier* genAnonStructID()

Generates an identifier for an anonymous struct.

genAnonUnionID
Identifier* genAnonUnionID()

Generates an identifier for an anonymous union.

genAnonymousID
Identifier* genAnonymousID(cstring prefix)

Generates an anonymous identifier.

genModuleID
Identifier* genModuleID()

Generates an identifier for a module which has got no valid name.

inStatic
Identifier* inStatic(hash_t idHash)

Looks up the hash of an id in the static table.

inStatic
Identifier* inStatic(cstring idString)

Looks up idString in the static table.

isReservedIdentifier
bool isReservedIdentifier(cstring str)

Returns true if str is a keyword or a special token (__FILE__, __LINE__ etc.)

isThreadsafe
bool isThreadsafe()

Returns true if access to the growing table is thread-safe.

isValidUnreservedIdentifier
bool isValidUnreservedIdentifier(cstring str)

Returns true if this is a valid identifier and if it's not reserved.

lookup
Identifier* lookup(cstring idString)

Looks up idString in both tables.

setThreadsafe
void setThreadsafe(bool safe)

Sets the thread safety mode of the growing table.

Static functions

isIdentifierString
bool isIdentifierString(cstring str)

Returns true if str is a valid D identifier.

Static variables

anonCount
uint anonCount;

Counter for anonymous identifiers.

staticTable
Identifier*[hash_t] staticTable;

A set of common, predefined identifiers for fast lookups.

Variables

growingTable
Identifier*[hash_t] growingTable;

A table that grows with every newly found, unique identifier.

inGrowing
LookupMethod inGrowing;

Looks up idString in the growing table.

Meta