*DECK CSSROC USETEXT TEXTCS USETEXT TEXTSS USETEXT TXCMDCS PROC CSSROC; # TITLE CSSROC - RECOGNIZE OPERATOR COMMAND. # BEGIN # CSSROC # # ** CSSROC - RECOGNIZE OPERATOR COMMAND. * * A. LIM. 82/03/08. * * THIS PROCEDURE-S MAIN FUNCTION IS TO RECOGNIZE OPERATOR TYPEINS. * AT FIRST, AN OPERATOR TYPEIN ENTRY IS REMOVED FROM THE OPERATOR- * TYPEIN-QUEUE, THEN FORMAT THE TEXT PORTION OF THE ENTRY INTO A * COMMAND STRING, AND CALL COMMAND-RECOGNIZER TO VALIDATE THE * COMMAND. THIS PROCEDURE MAY GENERATE A MESSAGE TO THE OPERATOR * IN THE EVENT OF AN ERRONEOUS COMMAND ENTRY, OR IT MAY DISPATCH * THE RETURNED PARAMETERIZED COMMAND TO THE COMMAND PREPROCESSOR * FOR FURTHER REFINEMENT. * * PROC CSSROC * * ENTRY OPERATOR TYPEIN ENTRIES IN OPERATOR TYPEIN QUEUE(OPTQ). * * EXIT VALID COMMAND SENT TO VALID-COMMAND-QUEUE(VCQ), OR * TERMINAL TEXT SENT TO CONNECTION-TRAFFIC-QUEUE(CNQ). * * METHOD THIS PROCEDURE CONSISTS PRIMARY A LARGE LOOP, EACH * TIME THROUGH THE LOOP, AN OPERATOR TYPEIN ENTRY WILL * BE PROCESSED, AND IT TERMINATES WHEN OPTQ BECOMES EMPTY. * # # **** PROC CSSROC XREF LIST # XREF BEGIN PROC ABORT; # MACREL- ABORT TASK MACRO # PROC MESSAGE; # MACREL- MESSAGE MACRO # PROC SSRRCS; # RECOGNIZE A COMMAND STRING # PROC SSTAQE; # ACCEPT A QUEUE ENTRY # PROC SSTRQE; # REMOVE A QUEUE ENTRY # END # **** # # DEFS FOR MESSAGE LENGTH INCLUDING ZERO BYTE TERMINATOR.(X 10) # DEF LMSG20$ # 20 #; DEF LMSG30$ # 30 #; DEF LMSG40$ # 40 #; DEF DF$ # 0 #; # MESSAGE OPTION FOR DAYFILE MESSAGE # DEF CSTSIZ$ # 31 #; # CST SIZE = 29 ENTRY + 1 TERMINATE ENTRY# DEF CSSIZ$ # 14 #; # CMD STRING SIZE= 139 + 1 TERMINATE CHAR# # THIS IS THE SWITCH LIST FOR ERROR CODE RETURNING FROM *SSRRCS* # SWITCH ERRSWT # ERROR SWITCH BY ERROR CODE # LLNOERR, # 0- NO ERROR # LLPRMLNG, # 1- PARAMETER TOO LONG # LLEXPRD, # 2- EXPECTING PERIOD # LLEXPDCMA, # 3- EXPECTING PERIOD OR COMMA # LLUNRGCMD, # 4- UNRECOGNIZED COMMAND # LLINVCMPRM, # 5- INVALID COMBINATION OF PARMS # LLCMDMSPRM, # 6- COMMAND MISSING PARAMETER # LLPRMSH, # 7- PARAMETER LIST TOO SHORT # LLMSGLNG, # 8- INPUT MESSAGE TOO LONG # LLVALOUT; # 9- VALUE OUT-OF-RANGE # # * CST- COMMAND SYNTAX TABLE. * * THIS IS THE COMMAND SYNTAX TABLE FOR CS. IT IS INPUT TO * THE COMMAND RECOGNIZER TO DEFINE THE SYNTAX AND THE SEMANTICS * OF THE ALLOWABLE COMMANDS. * THE TABLE IS ORDERED(SCANNED TOP TO BOTTOM) AND CONTAINS FLAG * CHARACTERS TO DEFINE THE ORDER AND MEANING OF THE CHARACTERS * TO BE ENTERED TO SELECT THE ACTION TO BE PERFORMED. * EACH SYNTAX LINE IS TERMINATED BY AN END-OF-LINE($) TERMINATOR, * AND THE TABLE IS TERMINATED BY AN END-OF-LINE ENTRY. # ARRAY CST[00:CSTSIZ$] S(CSSIZ$); BEGIN ITEM CST$LINE C(00,00,140) = ["CO0@NOP,,\![=@NP0?^[@NPS^[@AU0^\\[ON!@ON0^[OFF@OFF^\$", "GO0@NP,GO,\![=@NP0?^[@NPS^\$", "DI0@NOP,,\![=@TR0?^[=@LL0?^[ =@LI0?^[=@TE0?^\[LD@LD0^\$", "DI0@NOP,,\![=@VC0?^\\![=@NC0?^\ $", "EN0@NOP,,\![=@TR0?^[=@LL0?^[< LINE_LI>=@LI0?^[=@TE0?^\[LD@LD0^\$", "EN0@NOP,,\![@LIS^[@TES^[@LLS^[@TRS^\\![=@NP0?^[@NPS^\$", "EN0@NOP,,\![@TES^\\![=@LIN?^\ $", "EN0@NOP,,\![=@VC0?^\\![=@NC0?^\$ ", "DU0@NOP,,\![=@NP0?^[@NPS^\\[ON!@O N0^[OFF@OFF^\$", "LO0@NOP,,\![=@NP0?^[@NPS^\\[@ON0^[@OFF^\$", "SE0@NOP,,\![=@LI0?^[=@LL0?^[=@NP0?^[=@TE0?^[@NPS^[@HO0^\\![= @MS0&\$", "RE0,,\![=@NP0?^[@NPS^\\[ON!@ON0 ^[OFF@OFF^\$", "ST0,,\![=@NP0?^[=@CP0?^[=@TR0?^[=@LL0?^[=@LI0?^[=@TE0?^[@NPS^\$", "ST0,,\![=@VC0?^\$", "ST0,,\![@CPS^[@TRS^\\![=@NP0?^[@NPS^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$", "ST0,,\![@LLS^[@LIS^\\![=@NP0?^[@NPS^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$", "ST0,,\![@TES^\\![=@NP0?^[@NPS^[=@LI0?^\\[DI@DI1^[EN@EN1^[AC@AC0^[DN@DN0^\$", "ST0,,\![@TES^\\![=@LL0?^\$", "ST0,,\![@VCS^\\![=@NP0?^[@NPS^[=@LI0?^\$", "TS0,,\![=@NP0?^\\[@RE0^[@DR0^[=@MS0&\$", "AL0@NOP,,\[CP=@CP1?^\\[BU=@BU0?^\\![=@NP0? ^[@NPS^\$", "END,END[^\@NAP?^\$", "HEL,^$", "BYE,^$", "HI0,^\ALL@ALL^\$", "IN0,^$", "(", ")", "$"]; END # * THE FOLLOWING ARE MESSAGE ARRAYS EITHER FOR OUTBOUND TERMINAL * TEXT OR DESTINED FOR SYSTEM DAYFILE. # ARRAY PLGMSG[00:00] S(3); BEGIN ITEM PLG$MSG C(00,00,19) = ["PARAMETER TOO LONG."]; ITEM PLG$ZERO U(01,54,06) = [0]; ITEM PLG$ZERO1 U(02,00,60) = [0]; END ARRAY EPDMSG[00:00] S(2); BEGIN ITEM EPD$MSG C(00,00,17) = ["EXPECTING PERIOD."]; ITEM EPD$ZERO U(01,42,18) = [0]; END ARRAY EPCMSG[00:00] S(3); BEGIN ITEM EPC$MSG C(00,00,26) = ["EXPECTING PERIOD OR COMMA."]; ITEM EPC$ZERO U(02,36,24) = [0]; END ARRAY URCMSG[00:00] S(3); BEGIN ITEM URC$MSG C(00,00,21) = ["UNRECOGNIZED COMMAND."]; ITEM URC$ZERO U(02,06,54) = [0]; END ARRAY ICPMSG[00:00] S(4); BEGIN ITEM ICP$MSG C(00,00,34) = ["INVALID COMBINATION OF PARAMETERS."]; ITEM ICP$ZERO U(03,24,36) = [0]; END ARRAY CMPMSG[00:00] S(3); BEGIN ITEM CMP$MSG C(00,00,26) = ["COMMAND MISSING PARAMETER."]; ITEM CMP$ZERO U(02,36,24) = [0]; END ARRAY IMLMSG[00:00] S(3); BEGIN ITEM IML$MSG C(00,00,23) = ["INPUT MESSAGE TOO LONG."]; ITEM IML$ZERO U(02,18,42) = [0]; END ARRAY PLSMSG[00:00] S(4); BEGIN ITEM PLS$MSG C(00,00,35) = [" CSSROC- PARAMETER LIST TOO SHORT."]; ITEM PLS$ZERO U(03,30,30) = [0]; END ARRAY VALMSG[00:00] S(3); BEGIN ITEM VAL$MSG C(00,00,19) = ["VALUE OUT-OF-RANGE."]; ITEM VAL$ZERO1 U(01,54,06) = [0]; ITEM VAL$ZERO2 U(02,00,60) = [0]; END ITEM EC U; # ERROR CODE RETURNING FROM *SSRRCS* # ITEM ET U; # ERROR TEXT RETURNING FROM *SSRRCS* # ITEM I I; # DUMMY LOOP INDUCTION VAR # ITEM MAX U; # MAX NO OF CMD PARMS IN PARAMETER LIST # ITEM PCNT U; # PARM COUNT RETURNING FROM *SSRRCS* # CONTROL EJECT; # * PROCESS ALL OPERATOR TYPEIN ENTRIES IN OPERATOR TYPEIN QUEUE. # FOR I = 0 WHILE OPQL NQ 0 DO BEGIN WCB$WORD[1] = 0; # CLEAR WC WORD 1 # HDR$WORD[1] = 0; # CLEAR HDRCMD WORD 1 # SSTRQE(P,WCBUF[0],HDRCMD[0],PARMS[0]); # GET AN ENTRY # # * IF OPERATOR TYPEIN IS HOP/BRK, SPECIAL CASE IT. * I.E. DO NOT CALL COMMAND RECOGNIZER, INSTEAD BUILD * OUR OWN ONE-WORD PARAMETER LIST, AND SEND THE VALID * COMMAND TO *VCQ*. # IF HDR$BOF[0] THEN BEGIN # BREAK OCCURRED # PAR$ELNAME[0] = "BRK"; PAR$PCODE[0] = "VEB"; PCNT = 1; HDR$OPORD[1] = HDR$OPORD[0]; GOTO LLNOERR; END MAX = MCMDL$ - (WCB$WC[0] - 2); # MAX NO OF CMD IN PARM LIST # # * CALL COMMAND RECOGNIZER WITH COMMAND SYNTAX TABLE, COMMAND * STRING, STRING LENGTH IN CHARACTERS, AND MAXIMUM NUMBER OF * COMMAND PARAMETERS ALLOWABLE IN PARAMETER LIST. IT RETURNS * THE PARAMETER LIST, PARAMETER LIST COUNT, ERROR CODE AND * ERROR TEXT IF ANY. # SSRRCS(CST,PARMS[0],HDR$TXCCNT[0],PARMS[WCB$WC[0]-2],MAX,PCNT, EC,ET); WCB$IAF[1] = TRUE; # PRESET IAF TO TRUE # WCB$SMID[1] = SMID"TTEXT"; # SET SMID TO TERMINAL TEXT # HDR$OPORD[1] = HDR$OPORD[0]; # SET OPERATOR ORDINAL # GOTO ERRSWT[EC]; # ERROR SWITCH BY EC # LLNOERR: # NO ERROR, BUILD VALID COMMAND ENTRY # WCB$IAF[1] = FALSE; # TURN IAF OFF # WCB$SMID[1] = 0; # SET SMID TO 0 # WCB$WC[1] = WCB$WC[0] + PCNT; # CALCULATE WORD COUNT # HDR$SPCNT[1] = PCNT; # SYNTAX PARAMETER COUNT # HDR$APCNT[1] = 0; # ADDR PARAMETER COUNT # HDR$TXWCNT[1] = WCB$WC[0] - 2; # TEXT WORD COUNT # HDR$VERB[1] = PAR$ELNAME[WCB$WC[0]-2]; # COMMAND VERB # HDR$TXCCNT[1] = HDR$TXCCNT[0]; # TEXT LEN IN CHARS # SSTAQE(P,WCBUF[1],HDRCMD[1],PARMS[0]); # SEND VALID CMD # GOTO ENDCASE; LLPRMLNG: # EC= "PARAMETER TOO LONG." # WCB$WC[1] = LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],PLGMSG[0]); GOTO ENDCASE; LLEXPRD: # EC= "EXPECTING PERIOD." # WCB$WC[1] = LMSG20$/10 + 2; HDR$TXCCNT[1] = LMSG20$; SSTAQE(P,WCBUF[1],HDRCMD[1],EPDMSG[0]); GOTO ENDCASE; LLEXPDCMA: # EC= "EXPECTING PERIOD OR COMMA." # WCB$WC[1] = LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],EPCMSG[0]); GOTO ENDCASE; LLUNRGCMD: # EC= "UNRECOGNIZED COMMAND." # WCB$WC[1] = LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],URCMSG[0]); GOTO ENDCASE; LLINVCMPRM: # EC= "INVALID COMBINATION OF PARAMETERS."# WCB$WC[1] = LMSG40$/10 + 2; HDR$TXCCNT[1] = LMSG40$; SSTAQE(P,WCBUF[1],HDRCMD[1],ICPMSG[0]); GOTO ENDCASE; LLCMDMSPRM: # EC= "COMMAND MISSING PARAMETER." # WCB$WC[1] =LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],CMPMSG[0]); GOTO ENDCASE; LLPRMSH: # EC= "PARAMETER LIST TOO SHORT." # $BEGIN MESSAGE(PLSMSG[0], DF$); # SEND MESSAGE TO DAYFILE # ABORT; # AND ABORT CS # $END LLVALOUT: # EC= "VALUE OUT-OF-RANGE # WCB$WC[1] = LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],VALMSG[0]); GOTO ENDCASE; LLMSGLNG: # EC= "INPUT MESSAGE TOO LONG." # WCB$WC[1] = LMSG30$/10 + 2; HDR$TXCCNT[1] = LMSG30$; SSTAQE(P,WCBUF[1],HDRCMD[1],IMLMSG[0]); ENDCASE: END # END PROCESSING OPTQ # END # CSSROC # TERM