26 Helper Script for the AldorDoc LATEX Style File

 26.1 The Special Cases
 26.2 The Top-level Translation Functions
 26.3 Translation of aldordoc Interface-Only Commands
 26.4 Translation of aldordoc Active Commands
 26.5 Split on Opening and Closing Regular Expression
 26.6 Translate adname and addefinename Parameters
 26.7 Escape String for Hyperref
 26.8 Escape String for Makeindex
 26.9 Escape String for LATEX
 26.10 Putting Everything Together

The interface of aldordoc is not identical to its implementation in aldordoc.sty.nw, see Section 25.4. This script is intended to translate the aldordoc interface to LATEX commands that are directly understandable by LATEX with included style file aldordoc.sty.nw.

The program assumes a file as input. The file can either be in Noweb format or a LATEX file. Noweb code chunks are left completely untouched.

The program is run as a filter and produces an output file that has exactly the same number of lines as the input file.

Each line is treated as one unit. For that reason LATEX commands that are to be translated must appear completely on one line.

Convention 18 The commands adname, adtype, addefinename, addefinetype, adparameter, and adcode including their arguments must appear on one line; they cannot be split over several lines.

After handling several special cases, the following while loop calls the main function adtranslateLine.

293* 21+   247  327
#------------------------------------------------------------------
#---
#--- ALLPROSE
#--- Copyright (C) Ralf Hemmecke (ralf@hemmecke.de)
#--- http://www.hemmecke.de/aldor
#---
#------------------------------------------------------------------

global variables 294a
while(<>) {
    output code chunks lines without modification 294b
    output lines in verbatim environments without modification 295b
    output translated lines of code snippet environments 297
    chomp; #remove trailing newline;
    print &adtranslateLine($_), "\n";
}
translation functions 326

Uses adtranslateLine 300.