Introduction

## Analyzing Your Source Code

### Analyzing Your Code

The easiest way to analyze your code is to use Understand for Ada's GUI to build and parse a project. You can also use command line tools for batch processing of source files and generation of information reports.

### The Understand for Ada Repository

The Understand for Ada repository is a binary format that uses a proprietary network/object format optimized for storing the sort of information Understand for Ada offers. It permits multiple simultaneous read access but doesn't (yet) have multi-user write access.

The repository is divided into libraries, which can be used to partition analysis so that results can be browsed and/or reported on separately. Note that libraries do not affect semantic analysis/name resolution when parsing source code and are not useful for storing separate implementations of Ada specifications as is sometime done with compiler library sub-partitions.

By default a library named "Standard" is created. If a library name is not specfied, the default library name is "Application". The user could report on information (including use of Standard) on just their code, or on a given combination of CSCIs or VxWorks binding.

### Creating New Projects

The easiest way to analyze your source is to use Understand for Ada's GUI to specify what source files to parse. The GUI then parses the code and creates an Understand for Ada database that it then browses. This repository can be refreshed incrementally from within the GUI, or updated using command line tools.

To create a new project select File->New Project , you are then prompted to specify a database name (by convention Understand for Ada databases end with .uda):

### Ada 83, 95, or both?

You are then asked what kind of source code. Understand for Ada supports Ada 83, or Ada 95, or a source code containing both. So that it knows which standard library to use it asks when creating a new project:

### Adding Source Code with the GUI

The Project Configuration dialog then pops up. Use it to add entire directories of source code with one click of the button. You can also turn parsing on/off for specific files or entire directories.

### Project Options

Choosing the options tab reveals options related to comment grabbing while parsing:

Understand for Ada then begins parsing the code.

No parse order is needed,Understand for Ada figures out the parsing order automatically. It also detects if needed source files are missing and reports this. You can optionally stop at errors, or continue ignoring errors.

After parsing, you then are dropped back into the main GUI of Understand for Ada, only with lots of data to browse...

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com