Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0135/07/cocos.sim
There are 4 other files named cocos.sim in the archive. Click here to see a list.
00010 OPTIONS(/C);
00020 COMMENT COCOS - Conditional Compilation in SIMULA;
00030 COMMENT =========================================;
00040 COMMENT
00050 COMMENT COCOS is a program to allow one SIMULA source program to
00060 COMMENT compile into several differing programs. A preprocessor
00070 COMMENT selects statements from the initial source program according
00080 COMMENT to selection statements. The initial source program can also
00090 COMMENT be compiled directly as one of the versions.
00100 COMMENT
00110 COMMENT In the future, some SIMULA compilers may include the
00120 COMMENT interpretation of the COCOS commands, or some other similar
00130 COMMENT scheme, so that no preprocessing is necessary.
00140 COMMENT
00150 COMMENT COCOS commands all begin with % in the first character
00160 COMMENT position of an input line. (COCOS commands can also begin
00170 COMMENT with "COMMENT%" which must be the first non-blank text on a
00180 COMMENT source program line. The source program should not contain
00190 COMMENT any such lines beginning with COMMENT% except COCOS command
00200 COMMENT lines.)
00210 COMMENT
00220 COMMENT The four COCOS commands are:
00230 COMMENT
00240 COMMENT %COCOS <variable> = <value>
00250 COMMENT %IF <variable>
00260 COMMENT %IFNOT <variable>
00270 COMMENT %IFEND <variable> (%ENDIF also allowd)
00280 COMMENT
00290 COMMENT The commands may, but must not end with semicolon. There
00300 COMMENT should be no other text on these command lines.
00310 COMMENT
00320 COMMENT <variable> can be any valid SIMULA identifier. COCOS
00330 COMMENT variables are however always global throughout the whole
00340 COMMENT program and can have the same name as other identifiers
00350 COMMENT in the program.
00360 COMMENT
00370 COMMENT <value> can only take the values TRUE or FALSE.
00380 COMMENT
00390 COMMENT Example: Output:
00400 COMMENT
00410 COMMENT BEGIN COMMENT BEGIN
00420 COMMENT %COCOS GERMAN = FALSE; COMMENT outtext("I am.");
00430 COMMENT %IF GERMAN; COMMENT outimage;
00440 COMMENT outtext("Ich bin."); COMMENT END;
00450 COMMENT %IFNOT GERMAN;
00460 COMMENT outtext("I am.");
00470 COMMENT %IFEND GERMAN;
00480 COMMENT outimage;
00490 COMMENT END;
00500 COMMENT
00510 COMMENT With %COCOS GERMAN = TRUE, the output file will include "Ich
00520 COMMENT bin." instead of "I am.". With each switch is associated
00530 COMMENT three values, the variable name (<variable>), the value
00540 COMMENT (<value>) and the condition.
00550 COMMENT
00560 COMMENT %IF gives the condition the value YES. %IFEND gives the
00570 COMMENT condition the value NEUTRAL. %IFNOT gives the condition the
00580 COMMENT value NO. No COCOS command lines are copied to the compilable
00590 COMMENT program. Other lines are copied only if for all TRUE
00600 COMMENT switches, the condition is yes or neutral, and for all FALSE
00610 COMMENT switches, the condition is no or neutral.
00620 COMMENT
00630 COMMENT There can be more than one %COCOS commands for the same
00640 COMMENT variable in a processed program. The last command is valid.
00650 COMMENT
00660 COMMENT If a %IF... command is encountered with no known value for
00670 COMMENT the switch, then COCOS will ask the conversational terminal
00680 COMMENT for a value.
00690 COMMENT
00692 COMMENT When COCOS is executed, you can give the following command
00694 COMMENT string:
00696 COMMENT <outfile>=<infile>/<variable1>:<value1>/variable2>:<value2>...
00698 COMMENT
00700 COMMENT END OF COMMENT;