Identifier_

Represents an identifier as defined in the D specs.

$(BNF /Identifier := IdStart IdChar* / IdStart := "_" | Letter / IdChar := IdStart | "0"-"9" / Letter := UniAlpha /)

Constructors

this
this(string str, TOK kind, IDK idKind = IDK.init)

Constructs an Identifier.

Members

Functions

startsWith
bool startsWith(string prefix)

Returns true if this id starts with prefix.

toHash
hash_t toHash()

Calculates a hash for this id.

toString
string toString()

Returns the string of this id.

Variables

idKind
IDK idKind;

Only for predefined identifiers.

kind
TOK kind;

The token kind. Can be TOK.{KEYWORD, SpecialID, Identifier}.

str
string str;

The UTF-8 string of the identifier.

See Also

Unicode alphas as defined in Unicode 5.0.0.

Meta