Substitutions of the translator

Top  Previous  Next

User interface > Translation options > Substitution options > Substitutions of the translator

 

Similar to the substitution table for the preprocessor there is a second substitution table for the translator.

 

 

OptionsSubstitutionsTranslator

 

 

There are two differences to the substitutions, which are carried out by the preprocessor:

 

1.While the preprocessor cannot distinguish identifiers, which are keywords from other identifiers, the translator does. Only the latter are substituted by the translator, i.e. the names for variables, functions etc. Therefore, the translator can substitute such names, which are keywords in C++. Without this substitution, there would be errors in the translated code. E.g.

 

double float;  -> double float_value; .

 

2.The identifier is already recognized by the translator before the substitution takes place. Therefore it can be substituted by something completely different, without affecting the translation process. E.g.

 

StringOfChar -> AnsiString::StringOfChar

 

 

Helper names

 

 

There is an additional map for the substitution of helper names which are created for the definition of implicitly defined types, For example in System.SyUutils.hpp the following enum type is defined:

 

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

 

 

When Delphi2Cpp II parses System.SysUtils.pas, initially it cannot know this name and gives another name to this type: SysutilsEnum__0.

The mapping between these two names can be defined in the helper substitution dialog as shown below:

 

 

 

OptionsSubstitutionHelpers

 

 

 

 

 



This page belongs to the DelphiXE2Cpp11 Documentation

DelphiXE2Cpp11 home  Content