src2fm: Source code to FrameMaker
Last change: 24 Nov 1995
Description:
These programs take source code as input, and produce nicely formatted listings
in FrameMaker. They do not indent source code. They do use typefaces, colors,
etc. to make a listing easier to read. src2fm
is a script that applies an appropriate filter (ada2mif, c2mif, csh2mif)
for Ada83, Ada95, or Ansi C source code or C-shell scripts. All aspects
of listing style are customizable by editing style sheets in a FrameMaker
template document.
See also src2www for producing web documents,
and alternatives
- a list of FrameMaker filters maintained by Ed W.A. van Leeuwen.
Purpose:
src2fm can be used to prepare small portions of source code for inclusion
in presentations, manuals, or technical papers, or it can be used to prepare
listings of whole programs, with indices.
Index
Features:
- Declarations are tagged with markers, so you can build a hypertext
index
- Block comments are conditional regions (can be hidden from view)
- All formatting is done with paragraph and character tags, so it is
completely customizable.
- Several multi-character symbols (e.g., >=) are printed as single
characters.
Status:
Fairly stable, but with inadequate documentation. The Ada front end recognizes
more constructs (e.g., type definitions) than the C front end. src2fm now
accepts some restricted C++ code, but templates and other C++ features will
confuse it. Comments on the output (for Ada) have been quite favorable.
It is reasonably easy to add patterns for language extensions and local
conventions, if you are familiar with (f)lex. Extending from Ada83 to Ada95
took about an hour, mainly for testing. On the other hand, syntactically
messy languages like C take much longer.
See also known problems.
Requirements:
ada2fm and c2fm run on the Unix operating system; they have been tested
on Sun Sparcstations under SunOS (a BSDoid) and Solaris (a SysVoid), and
should run under other Unix operating systems. I do not have resources to
port src2fm to Mac, Windows/Dos, or other non-Unix platforms at this time.
It is most convenient if you have the Unix version of FrameMaker. The provided
scripts use the fmbatch utility to apply formatting templates automatically.
If you do have a Unix machine, but you have only the Mac or Windows version
of FrameMaker, you can still use src2fm (rather clumsily). You can generate
MIF files on your Unix box and then transfer them to your personal computer.
Hypertext index generation depends on features of FrameMaker version 4 (FrameMaker
5 also works), but other features will work with version 3 as well. The
template I distribute is for FrameMaker 4; you'll need a MIF version for
FrameMaker 3.
Availability
Full source code is available, optionally compiled for a Sun SparcStation.
The current version is 0.9e, last changed 24 November 1995.
Source only,
approximately 125k.
Note: These are compressed tar files. On a Unix system, the decompression
is usually performed by your browser (Mosaic or Netscape); otherwise you
can use Unix "uncompress" or FSF's "gunzip" utility.
After decompression, you still have to untar them. This source code has
not been prepared for dos/windows or mac environments, and I do
not have resources to port to those platforms in the near future. (I will
be happy to help if someone else wants to do the port.)
Send mail to request a different version or configuration,
or to request help.
Bugs and problems
- Configuring the shell scripts is still a pain, albeit better than
earlier versions.
- The pattern for recognizing block comments in C was broken; this now
appears to be fixed. If it happens to you, please send me a sample file
for my regression tests.
Plans and wish list
- Linking from reference to definition of identifiers, across source
files, using cross-reference information from compilers. Plans for pulling
this out of Gnat xrefs have been postponed pending some architectural decisions
about how to support a variety of xref tools in a general, interoperable
manner.
- Support for figures. We often draw little diagrams when designing
code, why not have those diagrams appear in the program listing? This
is now working for src2www, and will probably make its way to src2fm in
the near future.
- Graphic views of module interconnection. This will happen first with
imagemaps in src2www and then be ported to src2fm. Status: There is
an internal version working, but it is too fragile and crufty for distribution
yet.
- Insert templates directly in MIF for users who have only the Macintosh
or Windows version of FrameMaker, and provide alternate shell scripts. In
FM5, it may be possible to use AppleScript to automate most steps on the
mac. This is looking less and less likely, unless Adobe/Frame get more
serious about supporting third-party developers.
- Add input readers for other languages. But see the next point
..
- Replace the hand-written flex front-ends with a higher level lexical
specification, in the spirit of vgrind and tgrind. It has become abundantly
clear that hand-written flex front ends are not adequate to support parallel
evolution of multiple language recognizers.
Contact me
If you find this software useful, please drop me a note. If you try it and
don't find it useful, please drop me a note to explain why. Please send
email to michal@cs.uoregon.edu
Thanks to the following people for making src2fm better through their
constructive criticism, suggestions, bug reports, and fixes:
- Sjoerd Zwart, Phillips Semiconductors B.V.
- Ken Anderson, UC Irvine
- Greg Bolcer, UC Irvine
- Peri Tarr, U Mass Amherst
- Umeed Kothavala, Purdue
- Cyrille Comar, NYU
- Scott Dorman, Martin Marietta and U Central Florida
Michal
Young