Substitution options

Top  Previous  Next

User interface > Translation options > Substitution options

The substitution options are part of the translation options and allow to edit lists of identifiers which are used for different kinds of substitutions during the translation process.

 

 

OptionsSubstitutions

 

 

Substitutions by the preprocessor

 

The preprocessor can modify identifiers in two ways:

 

It can normalize the capitalization of selected identifiers.
It can replace identifiers with other identifiers.

 

The preprocessor runs before the Delphi parser. You must therefore ensure that its substitutions leave the Delphi source code syntactically valid.

 

Substitutions by the translator

 

By contrast, substitutions performed by the translator take place after the source code has been parsed. Because the translator has access to the parsed code structure, it can also perform certain types of refactoring.

 

Substitutions of helper names are useful for C++Builder users to synchronize numbered helper names for enumeration types in the C++ code of C++Builder on one side and of Delphi2Cpp on the other side. For example System::Sysutils.hpp contains the following definition:

 

enum DECLSPEC_DENUM System_Sysutils__85 : unsigned char { rfReplaceAll, rfIgnoreCase };

 

but when Delphi2Cpp parses System.SysUtils.pas, it generates

 

enum SysutilsEnum__0 {rfReplaceAll,  rfIgnoreCase };

 

With the option to substitute helper names, SysutilsEnum__0 automatically can be substituted by System_Sysutils__85.

.

 

Property prefixes

 

If you create C++ code for other compilers than C++Builder all properties are replaced by pairs of functions. You can change the prefixes for the function names here.

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content