英語版
このページの英語版を見る
dmd.identifier
識別子を定義する。識別子とは、Dsymbol の名前である。
Authors:
License:
ソースidentifier.d
対象範囲 https://codecov.io/gh/dlang/dmd/src/master/src/dmd/identifier.d
- class
Identifier
: dmd.rootobject.RootObject; -
- nothrow this(const(char)*
name
); - 与えられた名前から識別子を構築する。
- nothrow this(const(char)*
name
, size_tlength
, intvalue
);
nothrow @safe this(const(char)[]name
, intvalue
); - 与えられた名前から識別子を生成する。Parameters: 識別子名。xml-ph-0000@deepl.internal がある。
const(char)* name
識別子名。'\0' がなければならない。 name
[length
]。size_t length
長さは name
。終端文字は除く'\0'int value
識別子値(例:Id.unitTest )またはTOK.identifier - static nothrow Identifier
generateId
(const(char)[]prefix
); - 新しい識別子を生成する。Parameters: このプレフィックスが識別子の名前となる。デバッグ目的。
const(char)[] prefix
これは識別子の名前の接頭辞となる。デバッグ 目的。 - static nothrow Identifier
generateAnonymousId
(const(char)[]name
); - 新しい匿名識別子を生成する。Parameters:
const(char)[] name
これは識別子の名前の一部となる。デバッグ 目的。 - static nothrow Identifier
generateId
(const(char)[]prefix
, size_tsuffix
);
static nothrow IdentifiergenerateId
(const(char)*prefix
, size_tlength
, size_tsuffix
); - 新しい識別子を生成する。Parameters:
const(char)[] prefix
これは識別子の名前の接頭辞となる。デバッグ 目的で size_t suffix
これは識別子の名前の接尾辞となる。これが 識別子を一意のものにする - static nothrow Identifier
generateIdWithLoc
(stringprefix
, const ref Locloc
); - ソースの場所に基づいて決定論的な名前の識別子を生成し、 複数のコンパイルにわたって名前の一貫性を確保する。 新しい一意の名前が生成される。接頭辞+場所がすでに文字列テーブルにある場合は、 余分な接尾辞が追加される(カウントは「1」から開始)。Parameters:
string prefix
識別子名の最初の部分。 Loc loc
識別子名で使用するソースの場所。 Returns: 識別子(Identifier.idPool内)で、ソースロケーションに基づく決定論的な名前がソースロケーションに基づいて決定論的な名前を持つ識別子(Identifier.idPool内) - static nothrow Identifier
idPool
(scope const(char)*s
, uintlen
); - 文字列テーブルに識別子を作成する。
- static nothrow void
idPool
(scope const(char)[]s
, TOKvalue
); - 文字列テーブルにキーワードを挿入するために使用する。Parameters:
const(char)[] s
キーワード用の文字列 TOK value
TOK.xxxx キーワード - static nothrow bool
isValidIdentifier
(const(char)*str
);
static nothrow @trusted boolisValidIdentifier
(const(char)[]str
); - 文字列が有効な識別子であるかどうかを判断する。Parameters:
const(char)* str
確認する文字列 Returns: 無効な場合は falsefalsefalse無効な場合は falseExamples:falsefalseassert(Identifier.isValidIdentifier("tes123_t".ptr)); assert(!Identifier.isValidIdentifier("tes123_^t".ptr)); assert(Identifier.isValidIdentifier("te123s_ğt".ptr)); assert(!Identifier.isValidIdentifier("t^e123s_ğt".ptr));
Copyright © 1999-2024 by the D Language Foundation
DEEPL APIにより翻訳、ところどころ修正。
このページの最新版(英語)
このページの原文(英語)
翻訳時のdmdのバージョン: 2.109.1
ドキュメントのdmdのバージョン: 2.109.1
翻訳日付 :
HTML生成日時:
編集者: dokutoku