SUNWdoc
vgrind 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:
.
ends processing- starts processing
.
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.
In regular mode vgrind accepts input filenames, processes them, and passes them to troff for output. If no filename is given, or if the ‘-’ argument is given, vgrind reads from the standard input (default if -f is specified).
In both modes vgrind passes any lines beginning with a decimal point without conversion.
Note: The syntax of options with arguments is important. Some require a SPACE between the option name and the argument, while those that do not have a SPACE below will not tolerate one.
vgrind passes the following options to the formatter specified by the TROFF environment variable, see ENVIRONMENT below.
In regular mode vgrind feeds its intermediate output to the text formatter given by the value of the TROFF environment variable, or to troff if this variable is not defined in the environment. This mechanism allows for local variations in troff’s name.
vgrind assumes that a certain programming style is followed:
If these conventions are not followed, the indexing and marginal function name comment mechanisms will fail.
More generally, arbitrary formatting styles for programs mostly look bad. The use of SPACE characters to align source code fails miserably; if you plan to vgrind your program you should use TAB characters. This is somewhat inevitable since the fonts vgrind uses are variable width.
The mechanism of ctags(1) in recognizing functions should be used here.
The -w option is a crock, 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 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.