QDI, XEDIT Macro to Color Program Syntax Elements

QDI is an XEDIT macro written by John Hartmann, of IBM Danmark. It can be used to find unbalanced syntax elements in REXX and C programs. QDI uses color to distinguish C and REXX comments, quoted strings, etc., with different colors for different levels of nesting. It can be very useful in spotting problems like missing end-of-comment indicators or unbalanced parentheses. ("QDI" stands for "Quote DIsplay".)

QDI requires good 3270 emulation; in particular, character attributes must be supported. QDI will run with any level of CMS Pipelines from 1.0105 on (including the last two levels of the CMS Pipelines PRPQ and all levels that have been released as a component of VM/ESA).

To invoke QDI, just XEDIT a C or REXX program file (or a PATTERN file) and enter "QDI". QDI displays the syntax elements according to the syntax of REXX or C or the CMS Pipelines "pattern" stage. One can force QDI to use the syntax rules appropriate to a particular filetype by adding %<ftype> to the QDI command. (By default, files with a filetype of PATTERN are considered to contain CMS Pipelines patterns; files with a filetype of C or H, are considered to contain C code; and all other filetypes are considered to contain REXX code.

As of 2010-02-12, QDI also colours C++ style line comments (beginning //); and file types C++, CPP, H++, or HPP are also considered to contain C code.

The option DEBUG (i.e., QDI DEBUG) captures the data stream sent to the terminal. This may help to identify trouble with particular terminal emulators or with QDI itself.

Use PF1 to display the actions of the other program function keys. Note that the screen you see is painted with the "fullscreen" stage, not by XEDIT. PF keys 1, 4, 5, 7, 8, 10, 11, 19, 20 do something; all other attentions cause QDI to terminate and return to XEDIT.

QDI's behavior when displaying a REXX program can be tailored by setting two global variables.

Bugs

QDI ignores the VERIFY settings. In particular, it truncates lines at the screen width even when XEDIT has extended the line to the following line(s) of the screen.

QDI ignores selection levels and SET DISPLAY; all lines of the file are displayed.


Melinda Varian / Office of Computing and Information Technology / Princeton University / melinda.varian@me.com
November 11, 1998
Revised 2010-12-13 by John P. Hartmann.