PowerAda The Source Browser
The Source Browser is a powerful tool that allows you to examine units compiled into the current library. Operations include:
- Editing A Local Copy of Code
- Local Uses
- Ada95 Type Derivations
- Subprogram and Variable Definitions
- Searching Through Code
- Viewing an Outline of Your Code
Opening a Browser
Selecting Ada Constructs
To select Ada constructs, click the middle mouse-button, or hold down shift and left-click on the mouse. This will highlight the Ada construct nearest the mouse pointer.
Holding down the right mouse button while the pointer is on the Ada source will bring up a small menu of common actions. These actions operate on the currently selected Ada construct.
Subprogram and Variable Definitions
The most common query is definition. This brings you to the "right" construct in relation to the currently highlighted construct. For instance, the definition of a variable will be its declaration, and the declaration's definition will be its type declaration. The definition of a package body is its specification, and vice-versa.
Often, after making a query, you may wish to go back to the window in which the query was made (or to the window before it, and so on). For instance, the definition of a subprogram body may bring you to a different file, which you only wish to glance at. You can return to the body using the previous view button. Just click Previous under the View pulldown, or press Ctrl-P.
Cloning a window creates an identical copy of the window. This is useful if you want to perform queries on a unit while still looking at the unit itself. To clone a window, select Clone Window from the File pulldown.
Editing A Local Copy of Code
Clicking Edit File under the File pulldown will open the editor (See Setting Your Preferences) on the current file. If the file cannot be found, you will be asked if you want to extract the source from the library. Doing so will give you an exact version of the source which is compiled into the library.
Clicking Local Uses under the Source menu will highlight all the local appearances of the selected construct. It will also open a list at the top of the browser that allows you to jump to each usage.
Searching Through Code
Clicking Find under the Source pulldown will allow you to search the current unit for a text string, or a number of Ada constructs. See Find Dialog for more information.
Viewing an Outline of Your Code
Clicking the Outline button under the View pulldown will open a list containing an outline view of the current unit. This outline contains all the subprograms in the unit. Clicking on a line in the outline list will move the source display to that line.
You can also use the Find All feature of the Find Dialog to make customized outlines.
See also: CHAPTER 6, "Unit Browser" in the PowerAda User's Guide.