S3 (programming language): Difference between revisions

Content deleted Content added
BG19bot (talk | contribs)
m Annotated Example: Remove blank line(s) between list items per WP:LISTGAP to fix an accessibility issue for users of screen readers. Do WP:GENFIXES and cleanup if needed. Discuss this at Wikipedia talk:WikiProject Accessibility#LISTGAP
m <pre> for unsupported lang
Line 59:
 
Next follow a number of "mode declarations". Mode is the Algol 68 term for a type.
<pre>
<source lang="algol68">
MODE KMT_BUFFER IS (96)BYTE;
MODE KMT_STRING IS REF()BYTE;
Line 77:
(INT INPUT_TOTAL,
OUTPUT_TOTAL);
</sourcepre>
The first type is an array of 96 bytes; the next two are references (pointers) to arrays of bytes. KMT_MTM_VALUES is a union type allowing a variety of different types to appear. Note that WORD is a 32-bit unsigned integer, INT is a 32-bit signed integer; LONG makes it 64 bits. The last option in the union is marked REF()REF()BYTE, which means it is a pointer to an array whose members are pointers to arrays of bytes.
 
Line 83:
 
The program continues by declaring external procedures on which the module depends. RESPONSE indicates a return value containing error information:
<pre>
<source lang="algol68">
EXT PROC (RESPONSE) KMT_UI;
Line 91:
PROC (INT,INT,BOOL,RESPONSE) KMT_PP_SEND_PACKET,
PROC (REF()BYTE,RESPONSE) KMT_PP_BUILD_STRING_PACKET_DATA;
</sourcepre>
and also some external variables:
<pre>
<source lang="algol68">
EXT REF () BYTE KMT_VERSION;
Line 102:
EXT REF INT MTM_TEXT_LEN;
EXT REF ()REF ()BYTE MTM_RECALL_DATA;
</sourcepre>
The rest of the program consists of a number of procedure definitions. One of these, which actually defines the entry point to the program, is reproduced here:
<pre>
<source lang="algol68">
GLOBAL STATIC (<STATUS 5;PSPACE 10001; TEMPLATE>) PROC KERMIT_THE_FROG IS
((<LIT "COMMAND">) REF()BYTE OPTION,
Line 155:
END
</sourcepre>
Features to note here include: