Ada Structured Library (ASL) - Current Version 1.4 SourceForge Logo


The 1.4 release added the calendar package, refcounting pointers, and reworked the string tokenizer.

The 1.3 release added the abstract I/O, telnet processor, security interface, string tokenizer, and command processor.

The 1.2 release fixes a minor reported bug, but has no functional changes to the components over 1.1.

In the 1.1 release I have included some preliminary work on a set of widgets that can be used under Tk or in a JVM and work the same. All the asl-tcl and asl-tk files are associated with this. It is far from complete and needs a lot of work. If anyone wants to take this over, I'd be happy to send it to a good home. Note that this stuff uses the cargv from tash, so that license is included, too. No Java work has been done besides studying the Java widgets and making sure they can be compatible. I'm waiting for ACT to release their Ada-Java compiler :-). Actually, ACT already has, but I'm not working these now.


I have a long-term dream to build a nice set of general containers, utilities, mathematical libraries, and even a generic graphical interface for Ada95. That's quite a big job, but I have a pretty good set of container classes (lists, queues, stacks, heaps, trees, btrees, hash tables, sets, bags, etc.) with a lot of different modes. I also have some semaphores and a leak detection storage manager. You can read the overview of the containers here. The sources for the containers containers themselves are available on the SourceForge project page. These containers are licensed under the same license as GNAT, the GPL with some modifications to allow inclusion into a program without bringing the whole program under the GPL.

These containers compile under gnat versions 3.11p, 3.12p, and 3.13p and Rational Apex (tested by Gene Ouye at Rational). They may or may not compile with other compilers, although several compiler vendors have worked with me to make the containers more portable. They will not compile with gnat-3.10p. The containers should be fully conformant to the RM. I make use of some pretty esoteric stuff (generic children with inheritance, inherited discriminants, and others) so some compilers may have trouble. If someone wants to use the containers and has trouble, I'll be glad to work with them.

A GNAT krunched (short filename) for those of you using weak operating systems can be built, but I'm not providing one here :-).

A Short Overview of AdaSL

The Containers

The container classes consist of the main container types: Containers come in three flavors: All containers come in all flavors, except a few do not have dynamic flavors because it doesn't make sense and Btrees are only dynamic. Actually, some other combinations don't seem to make much sense, but someone might use them so they are provided.

All containers come in versions that use the default storage management or allow the user to specify the storage management.

The containers are quite functional, each has a rich set of functions. Tests and example programs are provided as well as some reasonable documentation.

Telnet Protocol Handler

This package implements the Telnet protocol, client or server. It allows you to build a client or server easily, tie in new options. It also provides an Ada stream that front-ends another Ada stream and does the telnet protocol.

Abstract I/O

In my opinion, Ada lacks greatly in the flexibility of I/O. I wanted to implement a command processor, but I didn't want to tie it to a specified I/O type (like telnet, or a serial port, or whatever). But I wanted the flexibility of all the Ada.Text_IO packages for doing I/O. So I implemented it. It's not complete, but it is usable.

A version of this for the telnet protocol exists.

Something like this would be a very nice addition to the Ada language.

String Tokenizer

This takes a string and lets the user break the string into chunks using a user-specified criteria.

Debug Output

Applications often need some way to optionally generate debug output upon command, a framework is provided to do this. The user creates and registers debug levels with a debug processor. Through command, the levels may be enabled and disabled. The user checks a Boolean in the level, if it is on they should generate debug output.

Command Processor

Many applications need little debug frameworks that can be used on serial ports, telnet ports, or things like that. This provides a little framework for that. It allows the user to bind in commands, and listens for commands and calls the command handlers. It has bindable security. It uses the abstract I/O and string tokenizer.

A package that implements this over a standard telnet server that allows the user to log in with telnet is part of this package. It makes it quite easy to provide a telnet login, and it include the ability to do some security and debug logging.


Want to know what time it is in Algiers? Need handling of leap seconds? No problem. This calendar package handles just about everything you could imaging for a Gregorian calendar. If you work with multi-timezone data or deal with time in general, you need this.

Reference Counting Pointer

This package provides a way to make a pointer count references to itself automatically. When you copy it, it automatically detects this. When you are done with it, it frees the data. Note that this won't work for cyclic data structures.

A string version of the package is provided.


The ASL contains several semaphore objects implemented using protected types:

Leak Detection Storage Manager

A storage manager that tracks all the allocated data and lets the user iterate over it. Useful for finding memory leaks. It has found a few for me :-).