Annotation of researchv10no/cmd/spitbol/4.3/makemsg.spt, revision 1.1.1.1

1.1       root        1: -IN80
                      2: -TITLE MAKEMSG - PRODUCE SPITMSG.MSG FOR VAX/VMS SPITBOL SYSTEM
                      3: -STITL PREAMBLE
                      4: *      This is a Macro Spitbol program which generates the
                      5: *      error message module (SPITMSG.MSG) for the VAX/VMS Spitbol
                      6: *      interpreter.
                      7: *
                      8: *      Inputs to this program are:
                      9: *
                     10: *      1. filename.ERR - The list of error numbers and associated
                     11: *              text from the Minimal translation.  Each record
                     12: *              in this file consists of a three digit error message
                     13: *              number and the remainder of the record contains the
                     14: *              text of the message.  This file need not be sorted.
                     15: *              It is produced automatically by the XFER program.
                     16: *      2. Standard INPUT channel - The 'template' for SPITMSG.MSG
                     17: *              is read using INPUT, and so must immediately follow
                     18: *              the END statement of the program.  This template is
                     19: *              copied to SPITMSG.MSG intact, except that lines beginning
                     20: *              with "[[[" followed by a command are used to signal
                     21: *              this program to invoke some special action to substitute
                     22: *              something at that point. (E.g. Error messages).  The
                     23: *              appendages in this program which perform these special
                     24: *              actions all begin with "REP_" followed by the command
                     25: *              used in the template to invoke them.
                     26: *
                     27: *      This program creates filename.MSG automatically.
                     28: *
                     29: *      Steve Duff for VAX/VMS Spitbol Project April 1980.
                     30: *
                     31: -STITL INITIALIZATION
                     32: *
                     33: *      Set Keywords
                     34: *
                     35:        &STLIMIT = 1000000; &TRIM = 1; &ANCHOR = 1
                     36:        UC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                     37:        LC = 'abcdefghijklmnopqrstuvwxyz'
                     38: *
                     39: *      Create File Bindings
                     40: *
                     41:        TERMINAL = 'Enter name of .ERR file (no extension).'
                     42:        TERMINAL = '    Output will be file.MSG.'
                     43:        FILENAME = TERMINAL
                     44:        INPUT(.INMESS,1,FILENAME '.ERR')                :F(NOFILE)
                     45:        OUTPUT(.MESG,2,FILENAME '.MSG')
                     46: *
                     47: *      Create the Error Message Array
                     48: *
                     49:        MESSARY = ARRAY(499)
                     50: *
                     51: *      Special names in upper case
                     52: *
                     53:        NMS     = '-NOFAIL ABORT CONTINUE ANY BREAK BREAKX LEN NOTANY '
                     54: +      'POS RTAB RPOS SPAN TAB APPLY ARBNO ARRAY CLEAR COLLECT '
                     55: +      'CTI ITC BUFFER APPEND INSERT PROFILE SET '
                     56: +      'CONVERT DATA DEFINE DETACH DUMP DUPL EJECT ENDFILE EQ '
                     57: +      'EVAL EXIT FENCE GE GT HOST '
                     58: +      'INPUT LE LEQ LGE LGT LLE LNE LLT LOAD LPAD LT NE NOTANY OPSYN '
                     59: +      'OUTPUT PROTOTYPE REMDR REPLACE REVERSE RPAD '
                     60: +      'RTAB TAB RPOS SETEXIT SORT/RSORT '
                     61: +      'SPAN SIZE STOPTR SUBSTR TABLE TRACE '
                     62: +      'TRIM UNLOAD MAXLNGTH ERRTEXT END STLIMIT NRETURN '
                     63:        NMT     = TABLE(101)
                     64: NMS    NMS BREAK(' ') $ T *?(NMT<T> = '!') ' ' =       :S(NMS)
                     65: *
                     66: -STITL CVRT(MSG) - Convert message to mixed case
                     67: *
                     68:        P       = BREAK(' ') $ WD ' ' | REM $ WD
                     69: *
                     70:        DEFINE('CVRT(MSG)CMS')                  :(CVRTE)
                     71: *
                     72: *   This converts MSG to lower case except for the first word, if any,
                     73: *   found in NMT which is left in Upper case.
                     74: *   First char and first char after a fullstop are left in UC.
                     75: *   Occurrences of 'ARRAY, DUMP, TABLE' after error message no. 200
                     76: *   are not capitalised.
                     77: *
                     78: CVRT   MSG P =                                 :F(ER)
                     79:        CMS     = (DIFFER(CMS) CMS ' ',)
                     80: +              (DIFFER(RP = NMT<WD>) WD,REPLACE(WD,UC,LC))
                     81:        CMS     = DIFFER(RP) CMS ' ' REPLACE(MSG,UC,LC) :S(CMS)
                     82:        IDENT(MSG)                              :F(CVRT)
                     83: CMS    CMS LEN(1) $ T = REPLACE(T,LC,UC)
                     84:        CMS (BREAK('.') '. ') $ L LEN(1) $ T = L REPLACE(T,LC,UC)
                     85:        NMT<'ARRAY'> = NMT<'DUMP'> = NMT<'TABLE'> = EQ(I,200)
                     86:        CVRT    = CMS                           :(RETURN)
                     87: CVRTE
                     88: *
                     89: -STITL PROCESS THE ERROR MESSAGE FILE
                     90: *
                     91: *      This initial piece of code reads the input error message file
                     92: *      into the array MESSARY, indexing each message by its number.
                     93: *
                     94: READ_MSGS
                     95:        MESS    = INMESS                        :F(MAKE_MSG)
                     96:        MESS    LEN(3) . MESSID  REM . MESSTEXT :F(FORMATBAD)
                     97:        MAX_MESSID = GT(MESSID,MAX_MESSID) MESSID
                     98:        MESSARY[MESSID] = CVRT(MESSTEXT)        :(READ_MSGS)
                     99: *
                    100: *      Now we generate SPITMSG.MSG using the template.
                    101: *
                    102: MAKE_MSG
                    103:        EMLINE  = INPUT                         :F(EXIT)
                    104:        EMLINE  '[[['  REM . CMD                :S($('REP_' CMD))
                    105:        MESG    = EMLINE                        :(MAKE_MSG)
                    106: *
                    107: *      Here when finished
                    108: *
                    109: EXIT   :(END)
                    110: -STITL SUBSTITUTION APPENDAGES
                    111: *
                    112: *      Substitute error messages
                    113: *
                    114: REP_DOERRS
                    115:        MESSID  = 0
                    116: RDE.LOOP
                    117:        MESSID  = LT(MESSID,MAX_MESSID) MESSID + 1      :F(MAKE_MSG)
                    118:        MESG    = ' ERR' LPAD(MESSID,3,0) ' <' MESSARY[MESSID] '>/WARNING'
                    119:        :(RDE.LOOP)
                    120: *
                    121: *      Emit definition for maximum error message number
                    122: *
                    123: REP_MAXMSG
                    124:        MESG    = '     .LITERAL SPITBOL_MAXMSG = ' MAX_MESSID  :(MAKE_MSG)
                    125: END
                    126:  .TITLE        SPITMSG - MACRO SPITBOL Error Message Definitions
                    127:  .FACILITY     SPITBOL,1000
                    128:  .SEVERITY     SEVERE
                    129:  EXIT          <EXIT Module Saved - !AD>/INFORMATIONAL/FAO=2
                    130:  EXSUP         <>/INFORMATIONAL
                    131:  INSVIRMEM     <Insufficient Virtual Memory>
                    132:  LINETRUNC     <>/WARNING
                    133:  LOADCRC       <Load Incompatible, Please Retranslate Source>
                    134:  LOADMEM       <Insufficient Virtual Memory For LOAD>
                    135:  LOADOPEN      <Can't Open LOAD File - !AD>/FAO=2
                    136:  LOADMAP       <Error Mapping LOAD File - !AD>/FAO=2
                    137:  LOADUNEXCOND  <Loaded Function Failed To Handle Condition At PC=!XL>/FAO=1/ERROR
                    138:  LOADUNEXTRY   <Will Attempt to Recover By Forcing Failure>/WARN
                    139:  LOADVERS      <Load Versions Incompatible, Please Retranslate Source>
                    140:  NOSYSOUT      <>
                    141:  NOTEXITMOD    <File is Not a Saved EXIT File - !AD>/FAO=2
                    142:  OPENOUT       <>
                    143:  OPENIN                <>
                    144:  PAUSE         <Paused at Statement !ZL>/FAO=1/INFORMATIONAL
                    145:  STACKOVFL     <Virtual Stack Space Exhausted>
                    146:  SYNTAX                <Syntax Error In Command Line>
                    147: !
                    148: ! New in V3.5(BCAB-1131)
                    149: !
                    150:  BADLINK       <>
                    151:  LOADBADINT    <Loaded function returned invalid INTEGER result pointer>/WARN
                    152:  LOADBADREAL   <Loaded function returned invalid REAL number result ptr>/WARN
                    153:  LOADBADSTRING <Loaded function returned invalid STRING descriptor>/WARN
                    154:  LOADBADUNCONV <Loaded function returned bad block for unconverted result>/WARN
                    155: !
                    156: ! New in V4.3
                    157: !
                    158:  ENCROACH      <Cannot RELOAD - virtual space encroachment>
                    159:  HOST_NOTSUP   <HOST called with unknown operands>
                    160:  ILLIORESPEC   <Illegal I/O respecification>
                    161:  ILLIOSPEC     <Illegal combination of I/O specifications>
                    162:  LOADBADBUF    <Loaded function returned bad BUFFER string descriptor>/WARN
                    163:  LOAD_ERR      <Error while attempting to LOAD function>
                    164:  NOSTACK       <No room for SPITBOL stack - external functions extend too far>
                    165:  OPEN          <Error opening file !AD>/FAO=2
                    166:  SET2DT                <SET second arg not convertible to proper datatype>
                    167:  SET3NZ                <SET third arg must be zero for this file>
                    168:  SET3DT                <SET third arg not convertible to proper datatype>
                    169:  SETNOTSUP     <SET function not yet supported for indexed files>
                    170:  SYSERR                <Internal system error - submit SPR>
                    171:        .PAGE
                    172:  ERR000 <Internal Spitbol System Error - Please Submit SPR>/SEVERE
                    173: [[[DOERRS
                    174: [[[MAXMSG
                    175:        .END

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.