3 Introduction to the IDE's

 

  <--Last Chapter Table of Contents Next Chapter-->  

 

There are two IDE's, or Integrated Development Environments, available for gnat and Linux. PegaSoft's TIA (Tiny IDE for Ada) is a text-based IDE, while GRASP is an X-Windows IDE. Both have similar basic features.

On the other hand, if you are looking just for text editors with Ada syntax hilighting, many exist for Linux including elvis, emacs/xemacs and nedit.

3.1 TIA: The Console IDE

TIA, Tiny IDE for Ada, is a console IDE for Gnat. Besides being my own program, it was written using Gnat runs using the GPL texttools packages described later in this document. The screen layout is similar to pico's, with the menu options displayed along the bottom of the screen. If you are running on the Linux console or a xterm window, you can choose the menu items with alt key combinations or using your mouse.


This IDE is designed for rapid Ada development.To meet this goal, it uses a number of interesting features:

If you are interested in an X Windows IDE, you should read the next section on GRASP.

3.1.1 Quick Start

Before you compile a program, you have to set up the project parameters under Proj. For simple, single file programs, put the name of the program in the main line and select your CPU type. TIA will save this information when you quit in a ".adp" file (Ada Project).

You can check the current file with Check. If there are errors, use Err to move to the place where an error occurred and the error message will appear on the bottom of the screen. Repeatedly use Err to fix all errors. Note that as you edit the program, such as adding or deleting lines, Err may not take you to the exact line because the lines have moved.

Build your project with Build and you're ready to run your program.

3.1.2 TIA Keyboard Legend:

These are the key functions in TIA. If you are running TIA under X Windows, the X window manager may use some of these key combinations for its own purposes.

Control Keys

Control-6 - Mark/Unmark
Control-A - Execute macro (follow with the key for the macro)
Control-B - Copy (single line or to the mark)
Control-E - End
Control-L - Redraw screen
Control-N - Page Down
Control-P - Page Up
Control-T - Backtab, back one item on screen
Control-V - Paste
Control-X - Cut (single line or to the mark)
Control-Y - Home

Navigating The TIA Screen

End - last line of text
Home - first line of text
Page Up - Up One Page
Page Down - Down One Page
Esc/F1 - TextTools' Accessories Menu
Tab - Next Item On Screen
Backtab - Previous Item On Screen (note: Linux console doesn't support the back tab key--use control-t)
Alt-Char - Jump to the item with hot key Char (Linux Console/xterm)

Scroll Bars Keys

Down Arrow - 10% Forward in Document End - Bottom of Document
Home - Top of Document
Left Arrow - Back one line
Right Arrow- Forward one line
Up Arrow - 10% Back in Document

In TIA, the width of the text is limited to size of the edit area. Any lines that are longer that the edit area are denoted with an ellipsis at the end. The edit area does not scroll left or right as it does in pico.

3.1.3 The File Menu

New Source

Start a new source file.

Open Source

Open a new source code window, or an existing one. Type in the name of the source file and choose open to open it. (.adb is assumed if you don't specify an ending.) Choose browse to walk through the directories using a open dialog box. Or you can chose one of the recently opened files that appear at the bottom. On the Linux console, use alt-# to open these files. Chose new and TIA will create an empty package body for you to fill in--just delete what you don't want.

Save

Saves the file. TIA automatically saves whenever you check or build.

Save As

Save As. Save the file under a different name.

Revert

Reloads the current file, discarding any changes that haven't been saved by you or TIA. (TIA automatically saves a file when a new one is loaded.)

Diff

Displays the differences between the current file and when it was last saved using the diff command.

Print

Pipes the file, with a header, to the lpr command, printing it on the default line printer.

Stats

Display information about the current file and memory usage.

Stub

Creates an empty package body for the current file. The current file must be a package spec.

Check

Checks the current file for syntax errors.

Xref

Displays a crossreference of all identifiers in the current file.

Quit

Stops the program.

3.1.4 The Edit Menu

Cut

Deletes the selected text and puts it in the clipboard. Same as ctrl-x.

Copy

Copies the selected text to the clipboard without deleting it. Same as ctrl-b.

Paste

Inserts the text on the clipboard. Same as ctrl-v.

Append

Moves the cursor to the right end of the current line. This is useful for adding comments at the ends of lines.

3.1.5 The Find Menu

Find/Replace

Find brings up the find dialog to search for text. Fill in the top line and select find to find the next occurrence of the text in your document. Select backwards to search towards the top of the document instead of towards the bottom. Fill in the replace line and select replace to replace the text you are searching for with new text. Select cancel to erase the find text.

Next

Next finds (or finds and replaces) the next occurrence of the text in the source code.

If the text is not found, TIA beeps.

Next Err

Moves the cursor to the location of the next error and displays the error message at the bottom of the screen.

Goto

Moves the cursor to a specific line.

3.1.6 The Misc Menu

Edit Macros

Brings up the macro edit screen. Macros are keyboard short cuts you define. Each macro must fit on a line.The first character on the line is the trigger, and the remaining characters are the keyboard keys the trigger represents. For example, a line "pprocedure" defines a macro "p" that represents the keystrokes "p","r","o","c","e","d","u","r" and "e".

To use a macro in TIA, press control-A and then the letter of the macro.

Options

Opens the options window. The first option is to allow background updates. Turn this option off on slow machines. The second option sets the background colour to blue or black on colour displays.

Debugger

Runs TIA's ddd-style debugger.

[Expand--KB]

GDB

This item runs the gdb debugger.

3.1.7 The Project Menu

Project Params

The project parameters window. Choose the debugging level, CPU type and optimization level and TIA will pass the information to gnat accordingly. You can specify additional gnatmake options (like -n for no main program in Ada when you want to call Ada subprograms from another language), linking options (such as Linux libraries you need to link to), and the name of the main program. Static binding turns static binding on and off.

CPU Options: 486, Pentium, Pentium II, Other

Optimize Options: None, Basic, Size, Speed

Debugging Options:

Project Type:

Builder:

Specify the name of the program to build the project with, usually gnatmake:

Static Linking: select this to link in all the libraries used into a self-contained executable

Egcs: select this to run egcs instead of gcc [untested]

ALT: select this to compile on a system using the ALT version of gnat

Build

TIA attempts to build the project and create a working executable file.

People

To be finished

3.1.8 The ? Menu

This is the About window. It shows information about the current version of TIA, including the version and copyright notice.

3.2 GRASP: The X Windows IDE

GRASP is a free X-Windows IDE that supports Ada 95. It's based on Motif and provides similar basic features to TIA. The main difference is that GRASP is a multi-language IDE and that it supports source code analysis, annotating your source code with Control Structure Diagrams (CSD's) and showing code complexity with graphs called CGP's.


 

Besides Ada 95, GRASP supports C, C++, Java and VHML source files. It supports operating systems other than Linux and can also work with Ada compilers other than gnat.

GRASP is available for download from that GRASP home page at http://www.eng.auburn.edu/grasp.

3.2.1 Installation

  1. Download a version of GRASP from the GRASP web site. GRASP uses the Motif widget library. The static version has a copy of Motif included with it: download this version of you don't have a Motif compatible library (such as LessTif).

    If you have a Motif compatible library, download the dynamic version to save disk space. If you are using LessTif, make sure that the libXm and related files are properly linked in /lib and run ldconfig to ensure Linux sees the changes.

  2. Move the tar archive to the location you want to install GRASP in. For example, "/usr/local" would be a good choice.
  3. Unpack the grasp archive with "tar xfvz".
  4. GRASP requires an environment variable called "GRASP_HOME" to be set so GRASP knows where it was installed. To define GRASP_HOME every time for any user, add the following line to the end of your /etc/profile file:
    export GRASP_HOME=graspdir/graspada
    export PATH="$PATH:$GRASP_HOME/bin"
    
    where graspdir is the directory where you installed grasp (eg./usr/local").
Login in again to make the changes take effect and type "grasp&" to start GRASP.

GRASP provides online help. Extensive documentation is provided in HTML format, but it's not lynx browser friendly. You'll have to use a GUI browser like Netscape.

3.2.2 Quick Start

  1. Open a new source window using "File / Ada 95...".
  2. Type in your program.
  3. Save the source file as "test1.adb".
  4. Add "test1.adb" to your project by chosing "File / Add to Project"
  5. If you are using ALT gnat, change the compiler configuration under "Compiler / Command Setup":
    1. Select Compiler / Command Setup. You'll see the list of commands Grasp uses to invoke gnat.
    2. Change the Compile and Check commands from "gcc" to "gnatgcc", the name used by ALT.
  6. Compile the program by chosing "Compiler / Compile and Link". If there were no errors, the message window will appear with the message "Grasp: operation completed" and no error messages above it.

3.2.3 The Project Window

The first window that appears is the GRASP project window. It contains the word "GRASP", but as you add source files to your project, they will be added to this window.

The File Menu

Ada 95 et al. - opens a new source file window. Choose a language: Ada 95, C, C++, Java or VHDL.

Save all files - saves all open files.

Exit GRASP - quits GRASP, closes all open windows.

The Project Menu

New - start a new project

Open - open an exisiting project

Close - close current project

Save - save current project

Create / Save as - save current project under a new name, creating a new project.

Open Selected File- opens hilighted source file in the project window

Remove Selected Files - deletes these files from the project window

Add Files to Project - add source files to the project window

The Search Menu - search for files to add to the project

The Preferences Menu

Colour/Font - change the appearance of the source code window

Tab Size - change the number of spaces to indent when the tab key is pressed

Generate .gml files - NQS--KB

The Window Menu

Message Window - opens the GRASP error message window.

Search Window - opens the file searching window

3.2.4 Source File Window

This is the window where you type up your Ada programs and packages.

The File Menu

Clear - erase the entire source file

Open - open a new source file

Save - save the source file

Save as - save the source file under a new name

Print - prints the source file to a postscript printer, or to a file to be printed with ghostscript

Language - change the source file language. This doesn't translate the file to a new language, but tells GRASP how the file should be hilighted.

Exit- closes the source file window

The Edit Menu

Undo - undoes last edit change

Cut, Copy, Paste - standard cut, copy and pasting text

Paste Primary - NQS--KB

Search / Replace - standard search /replace

Comment - turns hilighted text into a comment

Uncomment - removes comment marks from hilighted text

Convert Keywords to Upper/Lowercase - changes the case of all keywords in the document.

Goto Line - goto a particular line

Insert File - insert a source file into this one.

The View Menu

Show Unit Symbols - toggles module symbols in CSD diagram

Show Data Symbols - toggles data symbols in CSD diagram

Show Boxes - toggles boxes around multiline statements in CSD diagram

Intrastatement Align - If on, for statements longer than one line, the second line and onward will be indented to the position of the first open paranthesis.

Force Newlines - If on, divides up statements so they will be on separate lines.

Auto Line Numbers - toggles line number display in CSD diagram

Auto Indent - toggles indentation in CSD diagram

Line Numbers - adds line number to CSD diagram corresponding to lines in source code

Generate CSD - creates a Control Structure Diagram for source code

Remove CSD - removes CSD diagram from source code

Show Controls - toggles button bar at top of edit area

Show message Bar - toggles message bar at bottom of window

The Templates Menu - insert source code for typical Ada multiline statements. The source code must be edited to fit the current program.

The Window Menu - opens various grasp windows

The Compiler Menu

Make - builds the project using the make command defined in command setup (typically make)

Compile and Link - builds the project using gnatmake

Compile - compiles the source file without building the project

Semantic Check - checks the source code for errors

Flag Setup - configures the switches for compiling, linking, etc.

Command Setup - configures the commands to compile, link, etc.

The Run Menu

Run - runs the program using popen

Run Previous - runs the last file that was run

Run File - runs a particular file

Cleanup Session - kills any hung processes.Doesn't affect daemons.

The CPG Menu

Generate CPG - create a Compilexity Profile Graph

Weights - configure the CPG weights

3.2.5 The Button Bar

Auto - automatically rebuild the CSD whenever a major change occurs, such as inserting a template or loading a new file.

Generate CSD - same as choosing View/ Generate CSD

Font Size - changes the font size

3.3 Other Tools and IDEs

3.3.1 VAD-Visual Ada Developer

VAD is an Ada code generator written in the TCL/TK graphics scripting language. Besides gnat, there are about 10 additional packages you must install before VAD will run. You type in a TCL/TK description of a VAD widget in a text file and VAD will produce all the necessary source code to use the widget. Most graphics formats are supported. VAD is available from http://www.websamba.com/ldulman/vad.htm.

 
[VAD screenshot]  

3.3.2 Jessie

Jessie is an X Windows IDE, primarily written in Java, for building large projects and designing multiple executables at once. It's an open source project of Silicon Graphics (http://www.sgi.com) and works with multiple languages. ACT has announced that Gnat will provide Jessie support in the future. Jessie is downloadable from http://oss.sgi.com/projects/jessie.

 
[VAD screenshot]  

3.3.3 Rapid

RAPID is an X Windows GUI Builder that works with TASH (the Ada TCL/TK package). You can draw TCL/TK windows containing Labels, Text Buttons, Radio Buttons, Check Boxes, and other widgets. When you select "Compile", RAPID saves the Ada source code necessary to display using TASH the window you drew. RAPID is available from ALT.

3.3.4 VIDE

VIDE is a C/C++/Java IDE, but it will work with Gnat if configured correctly. However, it doesn't support Ada keyword hilighting.
 
[VIDE screenshot]

3.3.5 GLIDE

Not complete

3.3.6 AdaGIDE

AdaGIDE (the Ada GUI Integrated Development Environment) is an Ada IDE for Microsoft Windows. It includes debugger support, a text editor and a code formatter. It supports Ada .Net.

For information on AdaGIDE, visit http://www.usafa.af.mil/dfcs/bios/mcc_html/adagide.html.

3.3.7 AdaBrowse

AdaBrowse is a HTML documentation generator for Ada 95 library unit specs, similar to what javadoc does for Java. It's based on ASIS. For information, see http://home.tiscalinet.ch/t_wolf/tw/ada95/adabrowse/.

3.3.8 KDevelop - KDE's IDE (and it supports Ada)

Kdevelop, standard with most versions of Linux, supports Ada.

When you start a new project, select Ada and the simple Hello World project for a demonstration.

[KDevelop with Ada]

3.3.9 Ada on Eclipse IDE

ACT sells a commerical product called GNATbench for the Eclipse IDE.

3.4 BUSH (AdaScript Business Shell)

BUSH is PegaSoft's Business Shell. BUSH is a powerful shell and scripting language designed around the POSIX standard and a scripting extension of Ada called AdaScript. BUSH contains many built-in subprograms including database access and network sockets and is very compatible with Gnat. Combined with Gnat, BUSH is part of the ABEE scalable enterprise initiative providing an end-to-end Ada solution for business.

The BUSH home page is located at http://www.pegasoft.ca/bush.html  


  <--Last Chapter Table of Contents Next Chapter-->