メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

RTW.reservedIdentifiers

Get reserved identifiers for code generation

R2023b 以降

説明

[c, cpp] = RTW.reservedIdentifiers() returns structures that contain lists of reserved keywords. If your model uses a reserved keyword as an identifier, then the code generator attempts to replace that keyword when it generates identifiers in the code. Use the RTW.reservedIdentifiers() function to retrieve the list of keywords that the code generator attempts to replace.

すべて折りたたむ

Retrieve reserved identifiers that the code generator attempts to replace.

[c, cpp] = RTW.reservedIdentifiers()
c = 

  struct with fields:

       reservedWords: {103×1 cell}
           fileNames: {29×1 cell}
    namesInLibraries: {1112×1 cell}


cpp = 

  struct with fields:

       reservedWords: {42×1 cell}
           fileNames: {85×1 cell}
    namesInLibraries: {1112×1 cell}

Output Arguments

すべて折りたたむ

C reserved identifiers, returned as a struct.

The struct contains these fields.

Field NameDescription
reservedWordsKeywords that the code generator reserves because the C language specification reserves them, returned as a cell array. The code generator attempts to replace these if the model uses them as identifiers.
fileNamesKeywords that the code generator reserves because they match the names of C standard library files, returned as a cell array. The MATLAB® Coder™ code generator attempts to rename generated files that match these keywords. You can use keywords that appear in only this field as identifiers. The Simulink® Coder and Embedded Coder® code generators do not perform this check.
namesInLibrariesKeywords that the code generator reserves because they are used in commonly used libraries, returned as a cell array. The code generator attempts to replace these if the model uses them as identifiers. This list is shared between C and C++ and is returned in full in each struct.

C++ reserved identifiers, returned as a struct.

The struct contains these fields.

Field NameDescription
reservedWordsKeywords that the C++ code generator reserves because the C++ language specification reserves them, returned as a cell array. The code generator attempts to replace these if the model uses them as identifiers. This list does not include keywords that the C language specification reserves, but the C++ code generator attempts to replace those keywords as well.
fileNamesKeywords that the code generator reserves because they match the names of C++ standard library files, returned as a cell array. The MATLAB Coder code generator attempts to rename generated files that match these keywords. You can use keywords that appear in only this field as identifiers. The Simulink Coder and Embedded Coder code generators do not perform this check. This list does not include filenames from the C standard library, but the C++ code generator attempts to replace those filenames as well.
namesInLibrariesKeywords that the code generator reserves because they are used in commonly used libraries, returned as a cell array. The code generator attempts to replace these if the model uses them as identifiers. This list is shared between C and C++ and is returned in full in each struct.

バージョン履歴

R2023b で導入

参考