Alibrowse - Ada Source Library Browser


Abstract

This submission was developed to solve a problem that I faced all the time ie browsing the predefined Ada library supplied with GNAT. Since I was using several packages like gnat.spitbol.patterns, gnat.os_lib, gnat.directory_operations not to mention ada.strings.unbounded etc, I had to read the specs often. Since the gnat libraries follow the 8+3 convention for file naming I often had to guess what the filename orresponding to a package name would be. In some cases eg a-strunb.ads for Ada.Strings.Unbounded it was straightforward whereas there are cases like g-spipat.ads for gnat.Spitbol.Patterns it was not quite so obvious. It becomes considerably more complicated if you are in the habit of downloading gnat source code.

In addition, I was attempting to learn a GUI development environment that is somewhat platform independant. This was a good opportunity to build a browser for the ada source code libaries.

Several choices presented themselves with jgnat being at the top of my list with gtkada a close second. Some roadblocks i ran into with the first choice drove me to the second one. Since then I have grown to love Gtk++. I still intend to reengineer this with jgnat so it can be used under a JVM. That however will have to wait for a while.
 

Using the Package

There are two programs that comprise this package. They work in conjunction to ease the perusal of large Source Libraries :

aliscan

Given a folder, this program recurses and scans each source file it encounters. It identifies the Ada Unit contained in the file and thus builds up a table of Unit names and file names. The results are written to a text file.

Download

Goto the sourceforge project page. 

 
aliscan [options] top_level_folder
Option Implication
-output=filename Name of text file to generate. TOC.alb is the default. The file is created in the top_level_folder
-norecurse Do not recurse into subfolders. Recursing into subfolders is the default behaviour
-entries=num_entries By default, aliscan is able to store upto 1024 entries. It is overridden using this switch. An entry is a unitname, filename combination.
-select=regexp File selection applying the regular expression supplied
-help, -verbose Usual meanings
alibrowse
With the text file generated by aliscan as the input, this gui application presents the source files based on the users selection.
 
 
alibrowse toc_file

Screen Shot

Platforms

My primary platforms are Windows NT 4.0 and RedHat Linux 6.2. Other platforms may well work. I use gnat 3.13p. You may be able to download the compiler system for your platform or contact the folks at Ada Compiler Technology.

The gui platform is GtkAda 1.2.10 (though it is called 1.3.10 for Win32) or later (under Linux I use GtkAda 1.2.8 still) which can be downloaded from gtkada.eu.org

This is rumoured to have been built successfully under Solaris as well.

I obtained aflex and ayacc or a pointer to them from adapower.

Releases

Version 1.7b                                                                January 5, 2001

aliscan

In addition to a simple text file (.alb) that lists the unitnames and filenames, we now generate an additional XML file. This is enabled only if the -gnata is used while building the program. This is because currently there is no support to drive the display using this xml file but it is coming down the pike.
The output files are attempted to be created in the "root" directory where the search begins. If that fails then the current default directory is used.
alibrowse
There is a toolbar now for quick access to some features.

Some graphics experimentation - in the "about" dialog and toolbars added.

There is a new menu item "Find In Files".

Internally we now teardown and rebuild the text widget used to display the source file. This is to avoid the frequent "freeze"s experienced on Win32 systems. With this new technique, there are no freezes.

website
Added a screenshot

Downloads

Go to the sourceforge project page
SourceForge Logo
Last Modified December 2000
 Contact Author