From: Eric S. Raymond Date: Tue, 30 Jul 2002 18:10:16 +0000 (+0000) Subject: This is a man page. X-Git-Tag: 1-4~9 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=e7f5c0424dbcaaa665844f5c22e083d8e30a3cbf;p=cupl.git This is a man page. --- diff --git a/cupl.xml b/cupl.xml index 72ce01c..a127cb1 100644 --- a/cupl.xml +++ b/cupl.xml @@ -1,8 +1,42 @@ - -
-Introduction + + +cupl +1 +Nov 31 1994 + + +cupl +interpreter for the CORC and CUPL languages + + + + + cupl + -f fieldwidth + -v nnn[y] + -w linewidth + + + + +Options + +The -w options sets the line width (default 80). + +The -f option sets the field width (default 20). + +The -v option enables debugging output. At level 1, the parse tree is +prettyprinted. At level 2, definition/reference counts for each +variable and label are printed after each run. At level 3, an +execution trace is displayed as the parse tree is printed. At level +4, each token intern and cons-cell allocation during parsing is also +dumped. A suffix of y enables parser debugging messages. + + +Description CUPL was an early (1966) teaching language implemented as a batch compiler on the IBM/360 at Cornell University. It was descended @@ -10,14 +44,14 @@ from an earlier (1962) experimental language called CORC (CORnell Compiler), which was in turn derived from PL/1. Statements made without qualification about CUPL below also apply to CORC. -CUPL is documented in "CUPL: The Cornell University Programming -Language", by R.J. Walker, a manual first printed in November 1966. -This implementation, and the discussion in this paper, are based on -the July 1967 second printing. +CUPL is documented in CUPL: The Cornell University +Programming Language, by R.J. Walker, a manual first +printed in November 1966. This implementation is based on the July +1967 second printing. -CORC is documented in "An Instruction Manual For CORC", by -R.W. Conway, W.L. Maxwell, R.J. Walker. This implementation tracks -the 2nd edition of September 1963. +CORC is documented in An Instruction Manual For +CORC, by R.W. Conway, W.L. Maxwell, R.J. Walker. This +implementation tracks the 2nd edition of September 1963. The purpose of this implementation, and this paper, is to preserve a CUPL/CORC implementation for the edification of historians @@ -26,9 +60,9 @@ representative of a significant class of teaching languages in its period, and study of their design casts a clear light on the preoccupations of their time. - + -The CUPL and CORC Languages +The CUPL and CORC Languages This distribution includes, in the file cupl.doc, a transcription of all the relevant @@ -45,9 +79,10 @@ calculations. There is no function abstraction and all variables are global; program chunking is achieved through BLOCK or BEGIN blocks which resemble parameterless subroutines. -CUPL rather resembles early BASICs, minus BASIC's string facility. It is -oriented towards scientific calculation and linear algebra, and would be nearly -impossible (or, at any rate, extremely painful) to use for anything else. +CUPL rather resembles early BASICs, minus BASIC's string +facility. It is oriented towards scientific calculation and linear +algebra, and would be nearly impossible (or, at any rate, extremely +painful) to use for anything else. The programming-support features of CUPL and CORC resembled those of the better-known WATFOR and WATFIV compilers, incorporating elaborate @@ -63,9 +98,9 @@ CORC-specific word (such as NOTE) during lexing. The CORC statement TITLE and the triple iteration construct have no counterparts in CUPL. - + -Differences from the original CUPL +Differences from the original CUPL The most obvious differences are also the most trivial. CUPL was first implemented on an IBM/360 Model 30; CORC on Burroughs 1604 and @@ -130,27 +165,12 @@ printf(3)'s %f and %e at field-width precision. as to fit on an 80-column line. Command-line options to change the line and field widths are available. - - -Command-line options - -The -w options sets the line width (default 80). - -The -f option sets the field width (default 20). - -The -v option enables debugging output. At level 1, the parse tree is -prettyprinted. At level 2, definition/reference counts for each -variable and label are printed after each run. At level 3, an -execution trace is displayed as the parse tree is printed. At level -4, each token intern and cons-cell allocation during parsing is also -dumped. - - + -Unix Implementation Notes. +Unix Implementation Notes. The CUPL/CORC implementation is built around YACC and LEX. The rest is -ANSI and POSIX-conformant C. +ANSI C. The YACC grammar just builds a parse tree, which is passed to interpret() for interpretation. This method requires that all @@ -194,6 +214,6 @@ The interpreter sets a flag when it sees any of the appropriate CORC-specific keywords (NOTE, BEGIN, DEC, DECREASE, EQL, GEQ, GTR, INC, INCREASE, INT, LEQ, LSS, NEQ, REPEAT, TITLE, UNTIL, $) during lexing, and execute() modifies its behavior appropriately. - -
+ +