/* File: psailr.txt - derived from psailr.h */
/* File: psailr.h, being converted 12/25/87, 10:47:40PM*/
/* PSAIL compiler, version: June 9, 1987 V.57.10(OPTIMIZED) 	*/
/*	FILE:	PSAILR.REQ */

/* 

          PSAIL - A 'Portable' SAIL to C language compiler
          ------------------------------------------------


                            Peter Lemkin 

                   Image Processing Section, DCBD
                      National Cancer Institute
                        FCRF Bld 469, Rm 150B
                         Frederick, MD 21701

	Revised April 3, 1987
	Revised March 14, 1987
	Revised January 16, 1987
	Revised December 21, 1986
	Revised November 2, 1986
	Revised September 27, 1986
	Revised April 29, 1986
	Revised December 13, 1985
	Revised February 17, 1985
	From PSAIL.SAI (V.43.50) of July 20, 1984
	From original SAITOC.SAI of January 14, 1983

	Version: 56.93

 */
/* 
	PSAIL is a 'portable' compiler program to convert a large,
commonly used, subset of the SAIL language to the C programming
language.

	The manual PSUSER.MEM describes the PSAIL program and how to
run it. Detailed implementation documentation may be found in
PSREF.MEM.

	This file is REQUIREd only by PSMAIN.SAI when it is compiled.
Different actions are taken depending on whether we are compiling it
with SAIL or PSAIL: (1) With PSAIL we conditionally compile
PSGLBV.REQ as INTERNAL declarations with PSMAIN.SAI by REQUIREing it
with PSAILR.REQ. When required by other .SAI modules PSGLBV.REQ has
EXTERNAL declarations. We DO NOT REQUIRE PSGLBV.REL as a LOAD!MODULE
with PSAIL. (2) With SAIL, we REQUIRE PSGLBV.REQ as a SOURCE!FILE
module and PSGLBV.REL as a LOAD!MODULE. The COMPILER!BANNER (a string
generated by the compiler containing the name of the compiler) is
checked to see which compiler we are using.

     COPYRIGHT NOTICE - copyright (c) 1983-1988 by Peter F. Lemkin.
                        All rights reserved.
	Permission is granted to any individual or institution to
        copy, use or modify this program, except for explicitly
        commercial purposes, provided this copyright notice is
        included in its entirety in all derived works.  No warranty
        of the software or of the accuracy of any documentation
        surrounding it is expressed or implied, and the author does
        not acknowledge any liability resulting from program or
        documentation errors.

 */

/*	------------------------------------------------------- */
/*     + + + +     R E Q U I R E D    F I L E S 	+ + + +	
/*	------------------------------------------------------- */

/*		The following modules are organized to include
procedures with similar functions. Within a module procedures are
organized alphabetically. 
*/

/*
.LABEL [<PSAILR-FUNCTION-LIST>]
*/

/*    DBUG!IT - conditionally print debug message */
/*    ERR!DEATHWISH - process deathwish trash-graphics and message */
/*    ERR!HLR - process errors, set isFRAGMENTflag if appropriate */
/*    ERR!N!P - process N.P. errors report if /REPORT */
/*    ERR!REPORT - print PSAIL compiler statistics for /REPORT */
/*    ERR!UNDF - process UNDF errors for /REPORT */
/*    ERR!WARNING - process WARNING errors for /REPORT */
/*    OUT!BOTH - print onto .C output file and/or terminal screen */
/*    PRT!NODE - print full node of new symtab if debugging */
/*    RUN!TIME - return string HH:MM:SS of the current CPU run-time */
/*    STOP!TIME - return string RUN, CPU and RUN/CPU %time statistics */
/*    TODAYS!DATE - call TOPS10 and get todays date */
/*    READFILE - read input text file and return string */
/*    READTRASH!GRAPHICS - read in trash graphic images */
/*    ADD!BUILTIN - add <symbol-spec> to hash symbol table */
/*    SET!EXTENSIONS - add PSEXTN.INI symbols to symbol table if /EXTENS */
/*    BUILD!TABLES - construct the initial hash symbol table */
/*    FIND!RC!SYMBOL - search symbol table for member symbol of class */
/*    FIND!SYMBOL - search ALL symbol tables for symbol */
/*    FIND!USER!SYMBOL - search user list symbol table for symbol */
/*    GGDW!PTYPE - get internal PSAIL data type ascii char code from DW */
/*    HASH!C - lookup symbol in hash table, 0 if does not exist */
/*    PPDW!PTYPE - pack internal PSAIL data type ascii char code in DW */
/*    PUT!HASH!C - lookup symbol in hash table, insert if not found */
/*    REM!SYMBOLS - remove range of USER defined symbols from SYMTAB */
/*    CHK!C!KEYWORD -  check if token is legal C keyword */
/*    CHK!DCODE -  check if internal decl code is in type spec */
/*    CHK!EXPR!LIST - check whether string is a SAIL expression list */
/*    CHK!ICONST - check whether string arg is INTEGER and return it */
/*    CHK!ID - check if the string is a simple identifier */
/*    CHK!INTEGER - check if the string is a INTEGER constant */
/*    CHK!LEAP!OPTIMIZE - check and optimize LEAP FOREACH Booleans */
/*    CHK!NAME!MAP - check token against name-map list with /NAMEMAP */
/*    CHK!NUMBER - check if the string is a number constant */
/*    CHK!REAL - check if the string is a REAL constant */
/*    CHK!SAIL!KEYWORD -  check if token is legal SAIL keyword */
/*    CHK!SCONST - check whether string arg is INTEGER and return it */
/*    CHK!STR!DRYROT -  check if SAIL string is legal C string */
/*    CHK!SWITCHES - check and set the PSAIL compile time switches */
/*    CHK!TYPE - return PSAIL declaration type of expression or id */
/*    CHK!32BIT!INTEGER - check if string is 32-bit integer constant */
/*    ISSAIDECLAR - check if token is a SAIL declaration keyword */
/*    ISSCALARTYPE - check if two DW's are compatible scalars */
/*    SET!PREFACE - get left white space if any else CRLF */
/*    UNIQDECLARATIONS - test for unique symbols if /UNIQUE set */
/*    CVACTUAL!TO!EXPECTED  - convert actual to expected procedure args */
/*    CVDUMMY!ARG - map dummy args for SAIL FRAGMENT Macro body */
/*    CVDWI - convert Descriptor Word to PSAIL internal decl. string */
/*    CVEVALQUOTE - evaluate quoted string and map some characters */
/*    CVIDW - convert PSAIL internal decl. string to Descriptor Word */
/*    CVLOWER - convert string to lower case, but not comments */
/*    CVLTYPEP - convert 'item Type' to 'primary type' DW */
/*    CV!PRINT!ARGLIST - R!D compute printf() format specifier & arglist */
/*    CVPTYPEL - convert 'primary Type' DW to 'item type' code */
/*    CVSTYPE - convert SAIL decl. type string to PSAIL letter code */
/*    CVT!ANY!TO!CHAR - map all break chars to specified char */
/*    CVTYPES - convert PSAIL letter code to SAIL decl. type string */
/*    CVUPCASE - convert string to upper case */
/*    CV5HASH - convert string token to 5-bit wrdMap[] hash-tbl index */
/*    CV5INT - convert string token to 5-bit 32-bit/word code */
/*    FOLD!CONST!EXPR - try to eval complex string expr to single number */
/*    INFIX!TO!PREFIX - convert infix to prefix expression */
/*    PRETTY!PRINT - pretty print a C string prior to output to file */
/*    REMOVE!WHITE!ENDS - remove white space on ends of string */
comment    INSERT!BEFORE!WHITE - insert string before trailing white space;
comment    JUSTIFY!TEXT - justify text to < 80 columns with specified preface;
comment    ADD!GC!PUSHS - emit GC_PUSHS(x) code if required for /GCcode;
comment    EMIT!CLEANUP!CODE - emit code adjusting A.S.G.C. PDL;
comment    EMIT!LOC!CODE - emit code at start of local block;
comment    EMIT!MAIN!CODE - emit code at start of main();
comment    MAK!BLK!EXIT - generate extra code to emit at block exit;
comment    FSM0 - do simple 1:1 mapping - propagate last type attribute;
comment    FSM1 - process DEFINE <statement>;
comment    FSM2 - process CASE <statement>;
comment    FSM3 - process FOR <statement>;
comment    FSM4 - process '[' array access or substring;
comment    FSM4a - process '[' array declaration;
comment    FSM5 - process WHILE <statement>;
comment    FSM6 - process DO <statement>;
comment    FSM7 - process '&' string concatenate;
comment    FSM8 - process COMMENT <statement>;
comment    FSM9 - process '"' quoted string constant;
comment   FSM10 - process 'CVxxx' as MACRO or runtime;
comment    FSM11 - process <declarations>;
comment    FSM12 - process PROCEDURE declaration;
comment    FSM13 - process LET;
comment    FSM14 - process <infixOP>;
comment    FSM15 - process LOCATION <expression>;
comment    FSM16 - process MEMORY <expression>;
comment    FSM17 - process REQUIRE <statement>;
comment    FSM18 - process BINOP <by reference>;
comment    FSM19 - process BINOP <by value>;
comment    FSM20 - <LOGIC >32-bits test>, test Logical operators <= 32-bits;
comment    FSM21 - process START!CODE, QUICK!CODE, C!CODE <statements>;
comment    FSM22 - process PRELOAD!WITH and PRESET!WITH <statements>;
comment    FSM23 - process ASH, LSH, ROT shifts;
comment    FSM24 - process BEGIN;
comment    FSM25 - process END;
comment    FSM26 - process <reference function>(...);
comment    FSM27 - process IF <statement>;
comment    FSM28 - process GO, GO TO, GOTO <statement>;
comment    FSM29 - process ARRAY <declaration>;
comment    FSM30 - process ELSE <statement>;
comment    FSM31 - process catch-all for <illegal SAIL syntax>;
comment    FSM32 - process PRINT <statement>;
comment    FSM33 - process OUTSTR <statement>;
comment    FSM34 - process REFERENCE/VALUE <declaration>;
comment    FSM35 - process assignment operator '_' or ':=';
comment    FSM36 - process exponentiation operator '^' or '**';
comment    FSM37 - process FORWARD, EXTERNAL <declarations>;
comment    FSM38 - process <complex Boolean relations>;
comment    FSM39 - process RETURN <statement>;
comment    FSM40 - process INTERNAL <declaration>;
comment    FSM41 - process RECORD!CLASS, RECORD!POINTER <declarations>;
comment    FSM42 - process NEW!RECORD <expression>;
comment    FSM43 - process COMPILER!SWITCHES (for PSAIL);
comment    FSM44 - process ':' (label or as record <member> delimiter);
comment    FSM45 - process '/' as divide operator of part of C comment;
comment    FSM46 - process IF <expresion>;
comment    FSM47 - process CASE <expression>;
comment    FSM48 - process PSAIL!FORGET;
comment    FSM49 - process PSAIL!DEFINE;
comment    FSM50 - optimizer for EQU(s1,s2);
comment    FSM51 - map C 'keyword' to '_keyword';
comment    FSM52 - process ARRTRAN <statement>;
comment    FSM53 - process ARRCLR <statement>;
comment    FSM54 - process <coerce macro arguments>;
comment    FSM55 - process PUT and REMOVE <statements>;
comment    FSM56 - process MAKE and ERASE <statements>;
comment    FSM57 - process NEW <expression>;
comment    FSM58 - process DATUM <expression>;
comment    FSM59 - process FOREACH <statement>;
comment    FSM60 - do simple 1:1 mapping - preserve type attribute;
comment    FSM61 - process IFC <conditional compilation>;
comment    FSM62 - process <...reserved for future...>;
comment    FSM63 - process <semiColon>;
comment    FSM64 - process '{' <LEAP SET operator>;
comment    FSM65 - process '(' <LEAP LIST operator>;
comment    FSM66 - process XOR arithmetic operator and LEAP operator;
comment    FSM67 - process OWN, SAFE, NOW!SAFE, NOW!UNSAFE, GENERIC;
comment    FSM68 - process CONTINUE and DONE <statements>;
comment    FSM69 - process NEXT <statement>;
comment    FSM70 - process ABS <statement>;
comment    FSM71 - process <proc-call-args>;
comment    FSM72 - process <GENERIC proc-calls>;
comment    FSM73 - process <SYMTAB type codes>;
comment    COPY!APPEND - copy to specified break string, append break string;
comment    COPY!OMIT - copy to specified break string and omit break string;
comment    COPY!EITHER - copy to any of a list of break strings;
comment    EXPAND!MACRO - do SAIL type macro expansion for preprocessing;
comment    GET!C!TOKEN - scan C token (id OR brkChar) from string;
comment    GETID - scan SAIL token (id AND brkChar) from string;
comment    GET!INPUT - get input from the .SAI file;
comment    GET!NUMBER - scan SAIL NUMBER from string;
comment    GET!TOKEN - scan SAIL token (id OR brkChar) from string;
comment    LEFT!EXPR - scan left C expression from cStatement;
comment    LEFT!ID - scan left C identifier from cStatement;
comment    RIGHTEXPR - scan right SAIL expression from saiStatement;
comment    RIGHTID - scan right SAIL identifier from saiStatement;
comment    RIGHTSTATEMENT - get input statement from saiStatement;
/*    CVT!SAIL!TO!C - main routine to cvt SAIL file to C file */
/*    MAP!BE - map (<boolean-expr>,type) ==> (be) or ((INTEGER)(be)) */
/*    MAP!BKSLASH!STR - map '\nnn' in "..." to ASCII characters */
/*    MAP!CK!ARGS - map & check  procedure call args */
/*    MAP!DECLAR - map declaration ids and enter into USER symtab */
/*    MAP!EXPR - dispatch expr evaluation by 'semX[-]' assoc/w symbol */
/*    MAP!INF - map 'inf' to 'length(<string id>)' */
/*    MAP!LEAP!TRIPLE - map 'a XOR b EQV c' to '&a,&b,&c' */
/*    MAP!QUOTES - map SAIL quoted string to C quoted string */
/*    MAP!WHITESPACE - map white space */
/*    MAP!WS!COMMENTS - map white space and comments */
/*    POP - pop string on internal PSAIL string sPDL[sPDLptr] */
/*    POP!BLOCK!NAME - pop block string name */
/*    POPNUMBER - pop integer on internal PSAIL string nPDL[nPDLptr] */
/*    PROCESS!TOKEN - evaluate saiStatement to cStatement */
/*    PUSH - push string on internal PSAIL string sPDL[sPDLptr] */
/*    PUSH!BLOCK!NAME - push block string name */
/*    PUSHNUMBER - push integer on internal PSAIL string nPDL[nPDLptr] */
/*    R!D!EXPR!MAP - push state, do recursive descent on string */
/*    REMAP - do AWK-like remapping of input and then reparse as PSAIL */
/*    SIMPLE!MAP - do 1:1 mapping of symbol if in hash symbol table */
/*    <main module> - initialization and main code */
/*    PSHELP.TXT - message printed when request /HELP */
/*    PSPRFL.TXT - profile PSAIL procedure names for PSAIL WATCH!PRINT */
/*    PSREPT.TXT - /REPORT statistics names for PSAIL ERR!REPORT */
/*    PSFSMN.TXT - /COUNTFSM FSM names for PSAIL ERR!REPORT */
/*    PSNAME.MAP - /NAMEMAP default UNIX 4.2BSD/SYS-V library name file */
/*    PSCLIB.MAP - /NAMEMAP CRAY C compiler library name file 12/85. */
/*    PSANSI.MAP - /NAMEMAP ANSI X3J11 library specification 5/85. */
/*    PSAIL.TGF  - LOGO and DEATHWISH messages */
/*    PSAIL.INI  - Symbols for BUILD!SYMTAB: normally used SAIL oprs/fcts */
/*    PSEXTN.INI - Symbols for BUILD!SYMTAB: PSAIL /EXTENSION symbols */
/*    PROFIL.COD - PSAIL emitted header code if /PROFILE. */
/*    GCCODE.COD - PSAIL emitted header code if /GCCODE */
/*    LEAPRN.COD - PSAIL emitted header code if using LEAP */
/*    MAIN.COD  - PSAIL emitted header code if MAIN() */

/*    <config.h> - PSAIL RUNTIME configuation macro header */
/*    <confg2.h> - PSAIL RUNTIME compile time secondary macro header */
/*    <psrdef.h> - PSAIL RUNTIME compile time macro header */
/*    <psrglb.h> - PSAIL RUNTIME compile time global variables header */
/*    <gogtab.h> - PSAIL RUNTIME gogtab[] entry definitions */
/*    <sairun.h> - PSAIL RUNTIME compatibility package header */
/*    <psrunG.h> - PSAIL RUNTIME string garbage collection header */
/*    <psrunL.h> - PSAIL RUNTIME LEAP function header */
/*    <psrunP.h> - PSAIL RUNTIME processes and events header */
/*    <psrunW.h> - PSAIL RUNTIME profile watch header */
/*    <psrunX.h> - optional PSAIL RUNTIME extended functions math header */
/*    <psrglb.c> - PSAIL RUNTIME compile time global variables */
/*    <sairun.c> - PSAIL RUNTIME compatibility package */
/*    <psrun1.c> - PSAIL RUNTIME storage allocation package */
/*    <psrun2.c> - PSAIL RUNTIME program control package */
/*    <psrun3.c> - PSAIL RUNTIME string control package */
/*    <psrun4.c> - PSAIL RUNTIME string conversion package */
/*    <psrun5.c> - PSAIL RUNTIME string scanning package */
/*    <psrun6.c> - PSAIL RUNTIME special numeric functions package */
/*    <psrun7.c> - PSAIL RUNTIME I/O procedures package */
/*    <psrun8.c> - PSAIL RUNTIME numeric functions package */
/*    <psrun9.c> - optional PSAIL RUNTIME portable trig package */
/*    <psrunG.c> - PSAIL RUNTIME string garbage collection package /GC */
/*    <psrunL.c> - opt. PSAIL RUNTIME LEAP function package /LEAP */
/*    <psrunP.c> - opt. PSAIL RUNTIME processes & events package /PROCES */
/*    <psrunW.c> - opt. PSAIL RUNTIME profile watch package /PROFILE */
/*    <psrunX.c> - opt. PSAIL RUNTIME extended functions math pkg /MATH */
/*    <psail.mak> - 'makefile' for building PSAIL and runtimes */
