Adding a Sample Source File

When you add a sample source file to Architecture Modeler, you define the entity type for the source file in the extended metamodel, and make available the code you will use to generate regular expressions. To add support for Objective C, for example, you would define an entity type that represents an Objective C source file, then add one or more Objective C source files to Architecture Modeler.

Choose a sample that contains the kinds of entities and relationships you want the parser to extract. If you want the parser to model calls to Objective C functions, make sure your sample contains a function call!

Note: Architecture Modeler supplies default values for the properties and attributes of the source file type you are adding. Except for the value of the Description property, which holds the entity type name displayed to the end user, the default values usually are sufficient. You can change the Description (and any other property or attribute values) when you edit the source file type.
  1. Click the Files button in Architecture Modeler and choose Add New in the drop-down menu. The Add New File window opens.
  2. In the Name field, enter the name of the entity type for the source file. For an Objective C source file, you might choose the name "OBJC" for the entity type.
    Note: If you are extending support for an already supported source file, the name you specify cannot be the same as the name of the already supported source file. No entity type is created for the specified name. The extension is simply a mechanism for naming the universal parser configuration file that contains the search patterns with which you are extending support.
  3. In the Type drop-down, select the type of the source file you are adding, XML or Text. If you select Text, click the Format button to view formatting options.
    Note: Think of Text as any kind of file other than XML.
  4. Select as an extension to if you are extending support for an already supported source file, then choose the source file type in the adjacent combo box.
    Note: The Metrics and Name Pattern areas are disabled in entity extension mode.
  5. In the Metrics group box, select each metric you want CA to calculate for the source file.
  6. In the Source samples group box, click Add new. An Open dialog is displayed, where you can browse for the sample source file. Click Open to add the file. Repeat this procedure for each sample you want to add. To delete a file, select it and click Delete.
  7. In the Name Patterns group box, click Add new. An editable text field is displayed. Click inside the field and enter the extension, including the dot (.), for the source file type. You can use wildcard patterns allowed in LIKE statements by Visual Basic for Applications (VBA). Click outside the field to add the extension. Repeat this procedure for each extension you want to add. To delete an extension, select it and click Delete.
  8. When you are satisfied with your choices, click OK.
Architecture Modeler displays the new source file type in the Name area in the central pane of the window, and the text of the sample source file in the righthand pane. If more than one source file type is listed, click the name of the type to display the corresponding sample.
Note: Select a source file type and click Files > Edit to modify its file characteristics. Select a source file type and click Files > Delete to delete the type.