Command Line Processing |
A command line tool for creating and building Understand for Ada databases is undada. It is a command line program that parses your Ada 83 or Ada 95 source code to populate the database with information that can be browsed or reported on.
The "undada" command line takes this form:
undada -db database [-create_83|-create_95] [files] [options]Create a new database with the -create_83 or -create_95 option and then load the files into the database with the -add option. To parse all files, specify -rebuild. Once the database is initially populated, subsequent parsing can be incremental, meaning that a file only needs to be re-parsed when it has changed, or something it depends on changes. For this incremental parsing, specify -refresh.
The command line options for undada are:
The following sections show example uses of undada.
This example creates a database populated with the Standard library for Ada 95:
undada -create_95 -db myprojectThe resulting database, myproject.uda, can then be used in the analysis of Ada 95 source code.
Use -create_83 instead of -create_95 if you have entirely Ada 83 source code. Use -create_95 if you have a mixed Ada 93/Ada 95 project.
Tip: To save space, specify the Ada 83 option if you have only Ada 83 code. The Ada 95 library is six times larger.If you have a small amount of source files then it may be easiest to just supply their names to the analyzer using the wildcarding abilities of your operating system shell. In this example we will process all Ada specification files (.ads) and Ada body files (.adb):
undada -db myproject -add *.ads *.adbNote that in some cases there maybe too many files to use the -files technique. A common command line limitation is 255 characters. A directory with hundreds or thousands of files may easily exceed this limit. In this case, or when you want more fine-grained/repeatable control over what files are processed, then you should create a "process list file". This file, the format of which is one filename per line:
myproject.ads
myproject.adb
mainpackage.adb
is processed via the -add command line option:
undada -db myproject -add @myproject_files.lstNote that there is no limit on the number of files listed in the list file.
On Unix here are a couple ways to create such a file:
- use the `ls' command, as inIn a Windows NT/95 command shell:
- use the dir command with the /b option:Alternatively, you can create and add files to the database all in one command. For example:
undada -db myproject.uda -create_83 -add *.ads *.adbWhatever way you choose to create your project database, you are now ready to analyze that project.
When analyzing a project, you have two options to choose from. You may re-analyze all files with the -rebuild option, or only those files that have changed with the -refresh option.
If you are doing your first analysis after creating a new project, it doesn't matter which option you choose as it will parse all files regardless. However, if you are performing this function on a regular basis, you may prefer to do an incremental analysis where only the modified files and any other files dependent on those files are re-analyzed.
For example. parse all files in the project with the following command:
undada -db myproject.uda -rebuildOr, to perform an incremental analysis, re-parsing only those files that have changed or other dependent files, use the command:
undada -db myproject.uda -refreshOnce you have successfully parsed your code for the first time, keeping the database up to date is simple:
undada -db myproject.uda -refreshwill check each file previously parsed into the repository to see if it has changed. If it has changed then it will re-parse it, and any files that depend on it (and so on) until the database is fully refreshed.
Use this feature to keep your database up to date while keeping your parsing to a minimum.
Suppose you have 3 separate areas in my project:
- RadarIdeally you would like to create a repository matching the structure of your software, thus permitting you to have reports of your whole system, or of each individual system.
An example way to accomplish this is to create a database, and to use undada three times - once for each partition. For instance:
undada -create_83 -db myprojectThis creates a database that has 4 library partitions in it, Standard (there when you started), Radar, Avionics, and Test_Support. These libraries can then be browsed separately, or in combination. Reports can also be constrained as well.
Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com |