TokenId

Generates the token type identifier for the given symbol.

There are two special cases:

  • If symbol is "", then the token identifier will be 0
  • If symbol is "\0", then the token identifier will be the maximum valid token type identifier

In all cases this template will alias itself to a constant of type IdType. This template will fail at compile time if symbol is not one of the staticTokens, dynamicTokens, or possibleDefaultTokens.

Members

Aliases

TokenId
alias TokenId = id
Undocumented in source.
TokenId
alias TokenId = id
Undocumented in source.
TokenId
alias TokenId = id
Undocumented in source.

Manifest constants

i
enum i;
Undocumented in source.
id
enum id;
Undocumented in source.
id
enum id;
Undocumented in source.
id
enum id;
Undocumented in source.
tokens
enum tokens;
Undocumented in source.

Examples

template tok(string symbol)
{
	 alias tok = TokenId!(IdType, staticTokens, dynamicTokens,
		 possibleDefaultTokens, symbol);
}
// num and plus are of type ubyte.
IdType plus = tok!"+";
IdType num = tok!"numberLiteral";

Meta