Sample scripts

This pages gives acces to sample RainCode scripts, that can be used as reference material and as source for inspiration for other scripts. These scripts are provided in a literate programming form (using Norman Ramsey's excellent tool noweb).

Literate programming is a technique that merges the code with its related comments in a single source file, thereby enhancing our ability to communicate code, which is a notoriously difficult task.

The sample scripts are also provided in normal source form, without most of the attached explanation.

  • html produces a HTML version of a COBOL source file, where the user can click on identifiers to navigate in declarations, labels, etc.. This script also performs minor pretty-printing tasks, such as using a specific color for comments and for labels that are never referenced. This script also produces auxiliary indexes, that can be used inventory. In this example, we produce an inventory of CICS statements, but the same technique can be applied for an inventory of any other kind of structure. Click here for the normal source form, without the literate programming information. You can also see the output of this script, as a number of HTML pages (The source file that has been used for this example has been provided by the courtesy of Leif Svalgaard, ETK) Please allow for several seconds to download, specially if you use a slow connection.
  • tree manages tree-structure based on paragraphs calling each others. This tree-based structure can be visualized in HTML, or reuse for other analysis such as dependency or some kind of metrics. This is not a script as such; it is a module which is meant to be used by other scripts, such as html described above. Click here for the normal source form, without the literate programming information.
  • alter takes a COBOL program, and replaces ALTER statements by more maintainable structures, based on conditional GOTO's. Click here for the normal source form of this script, without the literate programming information.