|
This page briefly introduces qsg, QEF's primary script generator. |
|
| Note: | The default input to qsg is the contents of the directory's qeffile following the Begin line. |
| The Components of the QSG System |
| The qsg system consists of an interpreter (qsg), a compiler (qsgcomp), a utility to view an object file (qsgdump), an x_db database describing qsg (x-qsg), a library of standard scripts (std.qsl). qsg is usually applied to a source file. That source is compiled internally and interpreted. The input will usually invoke scripts from a qsg library, such as std.qsl or another similar archive library of qsg scripts. Such libraries are constructed using compiler to create qsg object files which are then archived using arupdate. qsgdump can be used to view the compiled code of qsg script or library member. The following is the source code for one of the standard library scripts, presented as an illustration of some of qsg's capabilities.
summary [-p] [-] file OR shell-command
return list read from argument file or pipeline
-p read from a pipeline
arguments ... file or pipe-line to be read
This routine opens the argument file or pipe-line (if -p) for
reading, reads the contained words and returns the result as
the value of the call.
endsummary
if @argv~v
fatal @(script): no argument file specified
elif @argv~l != 1 && !@pFlag
fatal @(script): multiple files specified
fi
if @pFlag
open Fin r| @argv
else
open Fin r @argv
fi
while @[word @(readword Fin)]~n
append list @word
endwhile
close Fin
returnval @list
The following describes some of the features of the above:
For your information, the source files for this Cook's Tour are actually qsg scripts, which when interpreted produce html pages. There is a general purpose html qsg library that provides the normal html tags, although in more convenient ways than offered by raw html. There is also a Cook's Tour specific qsg library that provides the page epilogue and its prologue, an example of which immediately follows this statement. |
| cook75.qh - 1.13 - 03/10/24 |
|