[ Home Page ] [ Eiffel Archive ] [ Tools for Eiffel Developers ]

Arc de Triomphe clipart (2486 bytes)

TRAF, a trivial Eiffel pretty printer


Written by Franck Arnaud

traf199609.zip (4859 bytes)


Traf

Traf is a free Eiffel pretty printer. It takes Eiffel source code on the standard input and delivers formatted text on the standard output.

It should be easily portable to most Eiffel compilers. The brute force approach to parsing implies that it should display any Eiffel-like code correctly, even if it wouldn't go through a proper parser, which is convenient for code extracts for instance.

The root class is TRAF with the creation procedure make. EIFFEL_PRINT is a deferred class which does the actual analysis, effective heirs like EIFFEL_HTML simply need to effect a few deferred features to do the actual output.

Two formats are provided EIFFEL_HTML, for basic HTML and EIFFEL_LOUT for Basser Lout format. The corresponding options on the command line are -html and -lout, the former being the default. New formats can be added in the root class' creation procedure.

The output style is the recommended style from ETL.

HTML output is displayed with a monospaced font using <pre> because there is no standard way to do indentation in standard HTML 2.0. The output is for inclusion into a complete page and not a stand alone document, as there is no structure markup (<head>, <body>, etc).

This source code is in the public domain, it may be copied, modified and sold without restriction. It comes with no support, no guarantee, etc.

(Originally written by F Arnaud, franck@altsoft.demon.co.uk)


[ Home Page ] [ Eiffel Archive ] [ Tools for Eiffel Developers ]