Format Programs for FrameMaker

See the download page to obtain this program

Description

fgrind formats program sources in a nice style using FrameMaker. Comments are placed in roman, keywords in bold face, variables in italics, and strings in typewriter font (though all of these may be changed). Source file line numbers may be placed in the left margin at requested line intervals.

fgrind may read from standard input and send its results to standard output. Alternatively fgrind may be given the names of a number of input files; in this case, the output is written to file1.mml (where file1 is the name of the first file less any suffix).

Options

The options are:

-
read from standard input
-c
format specially delimited program code in comments (default no such formatting); support for this is very dubious
-d
give the directory for the language definitions (default is /usr/local/lib/fgrind)
-g
define gap for line numbering (default 0 means no numbers, 1 means every line, etc.)
-l
specify the language to use (default C), such as: 68000 assembler (-la68), asm68 (-lasm68), assembler (-lasm), Bourne Shell (-lsh) C (-lc), C++ (-lc++ or -lCC), CSH (-lcsh), Fortran (-lf), Icon (-lI), ISP (-lisp), Kimwitu (-lk), LDL (-lldl), Linda (-llinda), LOTOS (-llotos), Metafont (-lmf), Miranda (-lmira), MLisp (-lmlisp), MODEL (-lm), Modula-2 (-lm2), PASCAL (-lp), Perl (-lperl), PostScript (-lps), Prolog (-lprolog), RATFOR (-lr), Russell (-lrussell). SH (-lsh), SSL (-lssl), TeX (-ltex), VMS assembler (-lvmsasm), Yacc (-ly)
-n
do not treat keywords specially (e.g. do not make them bold; default is special treatment)
-s
define point size for output

Note that an option value must immediately follow the option letter without a space.

Usage

For example, to include a C file named foo.c in a FrameMaker document, give the command:
fgrind -lc foo.c
This will generate foo.mml, which will have the pretty-printed version of foo.c with a lot of MML commands. Then Open or Import the file in FrameMaker. For 12-point text and line numbers every five lines do:
fgrind -lc -s12 -g5 foo.c
The language definitions are given in fgrindefs, documented in fgrindefs (5). The file fgrind.mml gives the MML font and paragraph definitions. Edit this for different effects (e.g. keywords in Courier Bold).

History

First public version by Ken Turner, 941215

Second public version by Ken Turner, 970923:


Up one level to FrameMaker Utilities

Web Ken Turner Home   Email    Search Search Web Pages

Last Update: 15th July 2006
URL: https://www.cs.stir.ac.uk/~kjt/software/framemaker/fgrind.html