Reverse engineering options 3 page (C Code Reverser)
This page allows you to specify folder to package mappings, which determine where the code files selected for reverse engineering are created in the Model. In addition, this page is used to specify compiler search paths and #include paths for dependent code files, such as external libraries.
If you selected a dsp, vcproj or batch file (created through your make utility) on the Select Model page, the list will be populated with the search paths are specified in the selected file.
For information about reverse engineering C code, see Overview of reverse engineering legacy C code (C code)
Specifying mappings for reverse engineering code files
Having specified code files to reverse engineer, you must now map those files to target packages in the Model. You do this by mapping a folder that contains the files selected for reverse engineering (either directly or through any of the folder's subfolders) to a Package in the Model. By default, the Root Directory you specified for your project is mapped to the Root Object you specified in the Model, even though this mapping is not listed:
If the Root Directory owns all of the code files selected for reverse engineering (either directly or through any of the Root Directory's subfolders), all the code files will be reverse engineered because of the default Root Directory to Root Object mapping.
If you have selected files for reverse engineering that are not owned by the root directory or any of its sub folders, you must map folders to Packages in the Model so that each code file selected for reverse engineering is a descendent of a folder that is mapped to a Package.
* 
You cannot map any parent or subfolders of the root directory to the Model or a Package.
Each code file you select for reverse engineering is reverse engineered only if their owning folder or one of the owning folder's parent folders is mapped to a Package (either the Model itself or a Package in the Model).
Specifying search paths that contain dependent files
The code files you have selected for reverse engineering may be dependent on other code files, such as the MFC library. The Reverser parser needs to know the paths in which dependent code files reside to correctly parse the code files selected for reverse engineering.
You must specify the compiler search paths and optionally map those paths to Packages in the Model:
If you do not want to reverse engineer any code files used in a search path, do not map the search path to a Package in the Model.
If you want to reverse engineer any code files used in a search path, map the search path to a Package in the Model.
* 
You must ensure that the #INCLUDE path check box is selected for each path. If the #INCLUDE path check box is cleared and the path is not mapped to a package, the path is ignored.
You can quickly add Visual Studio paths, Modeler language paths and INCLUDE environment variable paths through the following buttons:
VC Include Dirs button.
RtS Language Dir button.
Add Include Dirs button.
* 
The Add VC Include Dirs button adds Microsoft Visual Studio.Net paths in Preference to Microsoft Visual Studio version 6.0 paths, and Microsoft Visual Studio version 6.0 paths in preference to Microsoft Visual Studio version 5.0 paths.
Order of the mappings and search paths
The Reverser parser searches the paths in the order they appear in the list, so ensure that the order is correct.
To map a path to a package:
1. Click the Add Mapping button.
2. Select the required folder.
3. Clear the #INCLUDE check box.
4. Select the Map to Package check box, and then select the required Model or Package.
5. Click Insert.
To add a compiler search path without reverse engineering used files from that path:
1. Click the Add Mapping button.
2. Select the required folder.
3. Select the #INCLUDE check box.
4. Clear the Map to Package check box.
5. Click Insert
To add a compiler search path and reverse engineer used files from that path:
1. Click the Add Mapping button.
2. Select the required folder.
3. Select the #INCLUDE check box.
4. Select the Map to Package check box, and then select the required Model or Package.
5. Click Insert
To move a mapping or search path up or down the list
1. Select the mapping you want to move.
2. Use the and buttons to move the mapping to the required position.
To change a mapping or search path
1. Select the mapping or search path you want to change.
2. Click the Edit Mapping button.
3. Make the required changes, and then click Update Alternatively, you can double-click a mapping or search path in the list to change it.
To delete a mapping or search path
1. Select the mapping or search path you want to delete.
2. Click the Delete Mapping button.
Was this helpful?