識別子
コード ジェネレーターでコードの構造の識別子を生成する方法を設定できます。識別子の命名規則を使用して、わかりやすい、一意の、追跡可能な識別子を生成します。
生成された識別子の最大長を制御し、名前マングリング テキストを含めて名前の競合を回避できます。トークン デコレータを使用して正規表現を使用する識別子のコンテンツを制御します。C および C++ からのキーワードなど、特定のキーワードは識別子として無効です。
トピック
- Identifier Format Control
You can customize generated identifiers by specifying the Identifier format control parameters on the Code Generation > Identifiers pane in the Configuration Parameters dialog box. For each parameter, you can enter a macro that specifies whether, and in what order, certain text is included within generated identifiers. For example, you can specify that the root model name be inserted into each identifier using the
$R
token. - 名前の競合を回避するために識別子の長さを指定する
[識別子の最大の長さ] パラメーターを使用して、関数、型定義および変数名の文字数を制限する。
- 生成される識別子の予約名を指定する
コード生成プロセスで使用しない一連の名前を指定する。
- Customize Generated Identifier Naming Rules
Customize the naming of identifiers in the generated code.
- 参照モデルとの識別子名の競合の回避
参照モデルとの識別子名の競合を回避するためのパラメーターの値を指定。
- Control Name Mangling in Generated Identifiers
Specify the position and length of name-mangling text in generated identifiers.
- Specify Boolean and Data Type Limit Identifiers
Integrate the generated code with your code by specifying the identifiers that correspond to Boolean
false
andtrue
. Also, specify the identifiers that correspond to data type limits, which the generated code uses to determine overflows. - 予約キーワード
コード ジェネレーターを使用して C または C++ コードを生成する場合、モデルには内部使用のために予約されているキーワードが含まれていてはなりません。
- Maintain Traceability for Generated Identifiers
To verify your model, you can trace back and forth between generated identifiers and corresponding entities within the model. To maintain traceability, it is important that incremental revisions to a model have minimal impact on the identifier names that appear in generated code. There are two ways to minimally impact the identifier names:
- Exceptions to Identifier Formatting Conventions
There are some exceptions to identifier formatting conventions for type names, non-
Auto
storage classes, and shared utilities. - Identifier Format Control Parameters Limitations
There are some limitations pertaining to how autogenerated identifiers comply with the setting of the Maximum identifier length parameter.