Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]

Arc de Triomphe clipart (2486 bytes)EIFAN - Eiffel Analyzer


Written by Bill O'Keefe (bokeefe@shore.net)

eifan-10.tar.zip (40,843 bytes)


Introduction

EIFAN is a tool used to reverse-engineer Eiffel source code into Booch object-oriented class diagrams. It provides a way to analyze the overall structure of a set of Eiffel classes without having to purchase an expensive CASE tool.

EIFAN depends upon several other public domain packages. Details are provided below.

If you find this program useful, or have any questions/problems with it, please let me know.

Contents

EIFAN is delivered in a tar archive. To unpack this file, use:

zcat eifan-1.0.tar.Z | tar xvf -

After unpacking the EIFAN distribution, you will find the following files:

README Release notes
COPYING Copy of GNU General Public License, version 2
Makefile top-level makefile
eifgraph/ Contains EIFGRAPH source files
eifdiag/ Contains diagram generating tools

License

Copyright (C) 1995 Bill O'Keefe.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

This program is based in part on TROOPER (Truly Reusable OO Compiler Compiler) written by Jon Avotins and Glenn Maughan and associated source classes and files, which is distributed free of charge by Monash University, Software Development Department, 900 Dandenong Road, Caulfield East, Victoria 3145 Australia, which may be obtained by anonymous ftp from the WWW site http://insect.sd.monash.edu.au/~trooper/

Dependencies

1. TROOPER

The main component of EIFAN is the EIFGRAPH tool. This tool is implemented using the Truly Reusable Object Oriented Compiler Compiler (TROOPER), written by Jon Avotins and Glenn Maughan. You need to install TROOPER before you can install EIFGRAPH.It is available via anonymous FTP at:

ftp://hornet.sd.monash.edu.au/pub/trooper/trooper.tar.Z

There is also a TROOPER home page at:

http://insect.sd.monash.edu.au/~jona/trooper.html

TROOPER is based upon the ISE v3.2.8, and should work with later versions of ISE Eiffel as well. In fact, I got it to work with an earlier version (ISE v3.2.3b). However, I had to manually apply the 'extended_parse_patch' to my copy of the ISE 'parse' library. Refer to the TROOPER README files for installation instructions. It runs much faster if you 'finalize' it.

After installing TROOPER, it's probably a good idea to run a few Eiffel source files through it, to verify the installation. You don't need the TROOPER objects or executable to build EIFGRAPH, since EIFGRAPH simply references the required TROOPER source files from its Ace file. Thus, if you're low on disk space, delete the TROOPER 'EIFGEN' directory after you verify its installation.

2. Graphplace

The 'graphplace' program is a wonderful tool developed by Jos van Eijndhoven, and is used to layout the nodes of the generated class diagrams. It can be downloaded from a number of sites, including:

ftp://ftp.funet.fi/pub/sci/math/misc/programs/graphplace/graphplace.tar.gz

Refer to the 'graphplace' README for installation instructions.

The EIFAN distribution contains a slightly-modified version of the 'graphplace' PostScript prologue (graphpro.ps), which it installs in the 'lib' installation directory. The change limits the maximum size of node labels to 10 point text. You can make other changes to this file as described in the 'graphplace' man page.

3. PostScript Previewer

In order to preview the generated PostScript object-oriented class diagrams, you will need a PostScript previewer. By default, EIFAN is configured to use GNU GhostScript. If you don't already have GhostScript, you can get it from:

ftp://ftp.cs.wisc.edu:/pub/ghost/gnu/ghostscript*NNNN*

where NNNN is the latest version number. If you have a different previewer, then simply edit the 'graph2ps' script (described below) to use it.

4. Object Domain

Object Domain is a shareware CASE tool, written by Dirk Veemeersch, that runs on a PC under Windows. It produces nice looking Booch diagrams, and supports reverse-engineering of C++ source code. This is accomplished through its 'C++ Analyzer', which generates Object Domain Analyzer (.oda) files. These files can then be imported into Object Domain.

The EIFAN tool can also generate '.oda' files from Eiffel source code. If you have a Windows/PC, you might want to give it a try. The diagrams are more aesthetically pleasing than the PostScript class diagrams, although they both contain the same information.

You can get Object Domain at a number of sites, including:

http://www.acs.oakland.edu/oak/SimTel/win3/pgmtools.html

Select 'dom107.zip' (or a later version).

Installation

Once all the dependencies have been obtained and installed, you are ready to install EIFAN. EIFAN consists of two major components, which are stored in separate subdirectories:

eifgraph/  -- Contains EIFGRAPH source files (Eiffel)

Makefile  
Ace  
eifgraph.1 man page
Tool/ main cluster
constructs/ Parsing constructs
semantics/ Parsing semantics
emisc/ Miscellaneous Eiffel classes

    eifdiag/  -- Contains diagram-generating tools (C and shell scripts)

Makefile  
eifan Eiffel Analyzer script
graph2ps Generate & preview PostScript class diagrams
graph2oda.c Generate Object Domain Analyzer class diagrams
list.c linked list module source
list.h linked list header file
eifan.1 man pages
graph2ps.1  
graph2oda.1  

Check the 'Ace' file to make sure it reflects your Eiffel configuration. I didn't use any precompiled libraries, so you might want to change it to use your pre-compiled EiffelBase library. Note that the 'Ace' file excludes a number of TROOPER classes, and replaces them with modified versions. Also, the 'TROOPER' environment variable, which is defined as part of the TROOPER installation, is used by the 'Ace' file.

Before starting the build, review the makefiles, and make any changes to suit your environment. I can't vouch for the portability of the makefiles. However, they are pretty simply, so you shouldn't have a problem getting them work on your system. If your version of 'make' supports the '-n' switch, it might be a good idea to use it to see exactly what actions will be performed.

You should edit the top-level makefile to reflect the desired installation directory. The default is '/usr/local'. This setting is passed down to the sub-makefiles, so you don't have to edit them.

As mentioned above, the 'graph2ps' script uses GNU GhostScript to preview the PostScript class diagrams. If you have a different previewer, or don't have one at all, you'll need to edit the following lines in 'graph2ps':

# PostScript Viewer
#
# Uncomment the one you use, or add your own
#
#PSVIEW="psview"
PSVIEW="gs -q"

If everything looks okay, type:

make all

from the top-level directory. If everything was configured properly, this will produce a 'finalized' version of EIFGRAPH in the 'EIFGEN/F_code/eifgraph' directory, with a symbolic link to it in the 'eifgraph' directory. It should also produce the 'graph2oda' executable in 'eifdiag'.

The first time the EIFGRAPH tool is run, it will generate an Eiffel lexical analyzer, and save it to disk under the name 'eiffel_analyzer'. This takes some time. On subsequent runs, 'eiffel_analyzer' will be retrieved from disk. Generate 'eiffel_analyzer' by running EIFGRAPH on one of the delivered Eiffel source files, e.g.:

cd eifgraph
eifgraph -v Tool/eifgraph.e

The 'EIFLEXER' environment variable should be set to the directory where 'eiffel_analyzer' is stored, which is normally '/usr/local/lib' (unless you changed the installation directory in the top-level makefile).

If everything seems okay, then type:

make install

from the top-level directory to copy the executables, man pages, and other supporting files to the installation directories. Again, make sure you install a 'finalized' version of EIFGRAPH for the best performance.

There are other targets in the makefiles which you might find useful. Take a look and see.

Examples

To generate a PostScript class diagram:

eifan [-P] file.e

This will create 'file.graph' and 'file.ps', then preview the PostScript graph via GhostScript (or your configured viewer)

If you want a pretty Booch diagram, you'll have to get and install Object Domain on a Windows 3.x PC. Then,

eifan -O file.e

and bring 'file.oda' to your PC, and import into Object Domain.

There are various options to 'eifan', which you might find useful. Also, 'eifan' uses a couple of tools which you can run directly as well. For details:

Futures


Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]