vgrind - grind nice program listings
vgrind [-2fntwx] [-d defs-file] [-h header] [-l language] [-s n] [-o pagelist] [-P printer] [-T output-device] filename...
The vgrind utility formats the program sources named by the filename arguments in a nice style using troff(1). Comments are placed in italics, keywords in bold face, and as each function is encountered its name is listed on the page margin.
vgrind runs in two basic modes, filter mode or regular mode. In filter mode, vgrind acts as a filter in a manner similar to tbl(1). The standard input is passed directly to the standard output except for lines bracketed by the troff-like macros:
.vS
.vE
These lines are formatted as described above. The output from this filter can be passed to troff for output. There need be no particular ordering with eqn(1) or tbl(1).
In regular mode, vgrind accepts input filenames, processes them, and passes them to troff for output. Use a hyphen (`-') to specify standard input; otherwise, vgrind will exit without attempting to read from the standard input. Filenames must be specified after all other option arguments.
In regular mode, if the -t or -P option is specified, the output is:
Otherwise, the output is:
In both modes, vgrind passes any lines beginning with a decimal point without conversion.
The following options are supported:
-2
-f
-n
-w
-x
-d defs-file
-h header
-l language
-P printer
-s n
vgrind passes the following options to the formatter specified by the TROFF environment variable. See ENVIRONMENT VARIABLES.
-t
-o pagelist
-T output-device
The following operand is supported:
filename
In regular mode, vgrind feeds its intermediate output to the text formatter given by the value of the TROFF environment variable, or to /usr/bin/troff if this variable is not defined in the environment. This mechanism allows for local variations in troff's name.
index
/usr/lib/vgrindefs
/usr/lib/vfontedpr
/usr/share/lib/tmac/tmac.vgrind
See attributes(5) for descriptions of the following attributes:
|
csh(1), ctags(1), eqn(1), tbl(1), troff(1), attributes(5), vgrindefs(5)
vgrind assumes that a certain programming style is followed:
C
FORTRAN
MLisp
Model
Pascal
If these conventions are not followed, the indexing and marginal function name comment mechanisms will fail.
More generally, arbitrary formatting styles for programs usually give unsightly results. To prepare a program for vgrind output, use TAB rather than SPACE characters to align source code properly, since vgrind uses variable width fonts.
The mechanism of ctags(1) in recognizing functions should be used here.
The -w option is annoying, but there is no other way to achieve the desired effect.
The macros defined in tmac.vgrind do not coexist gracefully with those of other macro packages, making filter mode difficult to use effectively.
vgrind does not process certain special characters in csh(1) scripts correctly.
The tmac.vgrind formatting macros wire in the page height and width used in two-column mode, effectively making two column output useless for paper sizes other than the standard American size of 8.5 inches by 11 inches. For other paper sizes, it is necessary to edit the size values given in tmac.vgrind. A better solution would be to create a troff output device specification intended specifically for landscape output and record size information there.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |