User Tools

Site Tools


cdc:nos2.source:nam5871:ssrrcs

SSRRCS

Table Of Contents

  • [00002] PROC SSRRCS(CST, CSTRING, (LEN), OUTPARM, (MAX), OUTCNT, EC, ET)
  • [00003] SSRRCS - RECOGNIZE COMMAND STRING.
  • [00007] RECOGNIZE COMMAND STRING.
  • [00195] PROC SSBEBF
  • [00196] PROC SSBSBF
  • [00197] PROC SSRGNT
  • [00256] CST - COMMAND SYNTAX/SEMANTIC TABLE
  • [00269] CSTRING - COMMAND STRING.
  • [00282] OUTPARM - OUTPUT PARAMETER LIST.
  • [00303] PARMLST - PARAMETER LIST.

Source Code

SSRRCS.txt
  1. *DECK SSRRCS
  2. PROC SSRRCS(CST, CSTRING, (LEN), OUTPARM, (MAX), OUTCNT, EC, ET);
  3. # TITLE SSRRCS - RECOGNIZE COMMAND STRING. #
  4.  
  5. BEGIN # SSRRCS #
  6. #
  7. ** SSRRCS - RECOGNIZE COMMAND STRING.
  8. *
  9. * A. LIM. 82/02/17.
  10. *
  11. * THIS PROCEDURE-S MAIN FUNCTION IS TO RECOGNIZE AN INPUT COMMAND
  12. * STRING *CSTRING* (OPERATOR TYPEINS), GIVEN THE LENGTH *LEN* OF
  13. * THE STRING, AND THE COMMAND-SYNTAX/SEMANTIC-TABLE *CST* THAT
  14. * THIS STRING IS GOING TO CHECK AGAINST.
  15. * IF THE STRING PASS BOTH THE SYNTAX AND SEMANTIC CHECKING,
  16. * ON RETURNING TO THE CALLER, *OUTPARM* CONTAINS THE OUTPUT-
  17. * PARAMETER-LIST RESULTING FROM THE CHECKINGS, AND *OUTCNT*
  18. * REFLECTS THE COUNT OF NUMBER OF ENTRIES IN *OUTPARM*.
  19. * ELSE, IF THE STRING FAIL IN EITHER CHECKING, AN ERROR
  20. * CODE IN *EC* OR WITH ERROR TEXT IN *ET* WILL BE RETURNED.
  21. * THIS PROCEDURE IS CALLED INTO EXECUTION BY:
  22. * *CSSROC* *NVFOROC*
  23. *
  24. * PROC SSRRCS(CST, CSTRING, (LEN), OUTPARM, (MAX), OUTCNT, EC, ET)
  25. *
  26. * ENTRY CST = COMMAND SYNTAX/SEMANTIC TABLE THE CURRENT
  27. * INPUT STRING IS GOING TO CHECK AGAINST.
  28. * EACH COMMAND SYNTAX LINE IS TERMINATED BY AN
  29. * END-OF-LINE (EOL$) TERMINATOR, AND THE TABLE
  30. * IS TERMINATED BY A LAST ENTRY CONTAINING ONLY
  31. * THE EOL$ AS THE FIRST CHARACTER.
  32. * CSTRING = COMMAND STRING TO BE RECOGNIZED.
  33. * LEN = LENGTH IN CHARACTERS OF COMMAND STRING.
  34. * OUTPARM = ADDRESS OF OUTPUT-PARAMETER-LIST.
  35. * MAX = MAX NO. OF ENTRIES ALLOWABLE IN OUTPARM.
  36. *
  37. * EXIT CST = UNCHANGED.
  38. * CSTRING = UNCHANGED.
  39. * LEN = UNCHANGED.
  40. * OUTPARM = OUTPUT-PARAMETER-LIST.
  41. * (MEANINGLESS IF EC NQ 0)
  42. * MAX = UNCHANGED.
  43. * OUTCNT = COUNT OF ACTUAL NO. OF ENTRIES IN OUTPARM.
  44. * (MEANINGLESS IF EC NQ 0)
  45. * EC = ERROR CODE:
  46. * 0 = NO ERROR.
  47. * 1 = PARAMETER TOO LONG.
  48. * 2 = EXPECTING PERIOD.
  49. * 3 = EXPECTING PERIOD OR COMMA.
  50. * 4 = UNRECOGNIZED COMMAND.
  51. * 5 = INVALID COMBINATION OF PARAMETERS.
  52. * 6 = COMMAND MISSING PARAMETER.
  53. * 7 = OUTPUT PARAMETER LIST TOO SHORT.
  54. * 8 = INPUT MESSAGE TOO LONG.
  55. * ET = ERROR TEXT(UP TO 10 CHARACTERS), CONTAINS THAT
  56. * PART OF THE COMMAND STRING THAT IS IN ERROR.
  57. *
  58. * NOTE THIS PROCEDURE MIGHT END UP IN AN INFINITE LOOP, OR
  59. * RESULT MIGHT BE UNPREDICTABLE IF CST WERE NOT BUILT
  60. * CORRECTLY.
  61. *
  62. * METHOD:
  63. *
  64. * THE COMMAND SYNTAX TABLE *CST* IS INPUT TO THE COMMAND
  65. * RECOGNIZER TO DEFINE THE SYNTAX AND THE SEMANTICS OF
  66. * THE ALLOWABLE COMMANDS.
  67. *
  68. * THE TABLE IS ORDERED(SCANNED TOP TO BOTTOM) AND CONTAINS
  69. * FLAG CHARACTERS TO DEFINE THE ORDER AND MEANING OF THE
  70. * CHARACTERS TO BE ENTERED TO SELECT THE ACTION TO BE PERFORMED.
  71. * THE TABLE IS DESIGNED TO BE BOTH HUMAN AND COMPUTER READABLE,
  72. * AND CONCISE. INFORMATION ABOUT AN INDIVIDUAL COMMAND IS TO BE
  73. * COLLECTED TOGETHER.
  74. *
  75. * THE SYNTAX TABLE CONTAINS THE SEMANTIC TABLE WITHIN IT. DURING
  76. * THE SYNTAX SCAN, THE SEMANTICS (AND THEIR FLAG CHARACTERS) ARE
  77. * IGNORED. DURING THE SEMANTIC SCAN, MOST OF THE SYNTAX TABLE IS
  78. * IGNORED AND THE SEMANTIC FLAG CHARACTERS ARE USED FOR FURTHER
  79. * CHECKING OF PROPERNESS OF THE INPUT LINE. SOME CHARACTERS ARE
  80. * USED DURING BOTH SCANS, THUS THE REASON TO MERGE THE TWO TABLES
  81. * AND KEEP THE INFORMATION ABOUT A COMMAND TOGETHER.
  82. *
  83. * DURING THE COMMAND RECOGNIZING PROCESS, BOTH THE INPUT LINE AND
  84. * THE CURRENT LINE OF SYNTAX ARE BROKEN INTO TOKENS FOR COMPARISION.
  85. * THIS BREAKING UP INTO TOKENS TAKES PLACE WHENEVER A TOKEN IS
  86. * REQUIRED.
  87. *
  88. * STARTING WITH THE FIRST TOKEN OF THE FIRST LINE OF SYNTAX, THE
  89. * SYNTAX TOKEN IS EXAMINED FOR ACTION TO PERFORM SUCH AS COMPARING
  90. * THE TOKEN WITH THE NEXT INPUT TOKEN, STORING A PARAMETER CODE
  91. * IN THE OUTPUT PARAMETER LIST, OR OTHER ACTION.
  92. *
  93. * AS TOKENS ARE READ FROM SYNTAX, POSSIBILITIES ARE CHECKED FOR
  94. * MATCHING WITH WHAT WAS TYPED IN. AS LONG AS WHAT WAS TYPED IN
  95. * IS ALLOWABLE WITHIN THE CURRENT SYNTAX LINE, THE PROCESS
  96. * CONTINUES TO THE END OF THE INPUT LINE. IF AT ANY POINT AN
  97. * INPUT TOKEN IS NOT PERMITTED ACCORDING TO THE SYNTAX LINE, ALL
  98. * INFORMATION THAT MAY HAVE BEEN DETERMINED UP TO THIS POINT IS
  99. * DISCARDED AND A FRESH START IS MADE USING THE NEXT SYNTAX LINE.
  100. * WHEN THE LAST SYNTAX LINE DID NOT MATCH, THE TYPE-IN IS DECLARED
  101. * INVALID AND REJECTED AS UNRECOGNIZED. WHEN THE END OF THE INPUT
  102. * LINE IS REACHED AND THE SYNTAX HAS PASSED ALL TESTS THEN A
  103. * SEMANTIC PASS IS DONE USING THE OUTPUT PARAMETER LIST AND THE
  104. * SYNTAX LINE THAT WAS JUST USED TO PASS THE INPUT LINE. AT THIS
  105. * TIME ANY DUPLICATE KEYWORDS, MISSING PARAMETERS AND DEFAULTS TO
  106. * BE INSERTED ARE RECOGNIZED AND ADDED TO THE OUTPUT OR THE ENTIRE
  107. * COMMAND REJECTED IF WHAT WAS ENTERED WAS INCORRECT.
  108. *
  109. * SYNTAX FLAG CHARACTERS:
  110. *
  111. * <A_B_C_....Z> = ANY OF THE CHARACTER STRINGS A, B, C....Z
  112. * CAN MATCH AND ARE SYNONYMS. "_" CANNOT BE
  113. * IN STRING
  114. *
  115. * [ = RESYNC POINT. IF MISMATCH OCCURS, SKIP AND TRY
  116. * THE MATCH AT NEXT "[".
  117. *
  118. * @ = OUTPUT PARAMETER CODE
  119. *
  120. * ^ = END MATHCER. PERIOD OR COMMA OR END OF INPUT LINE
  121. * CAN MATCH AND TERMINATE SCAN. COMMA CAN MATCHING
  122. * SYNTAX SCAN TO FIRST "[" IF PRESENT.
  123. *
  124. * ? = PARAMETER, 1 TO 7 ALPHA-NUMERIC CHARACTERS.
  125. * COUPLED WITH LAST OUTPUT PARAMETER CODE.
  126. *
  127. * & = CHARACTER STRING, 50 CHARACTERS MAXIMUM TO END
  128. * OF THE LINE. ALSO TERMINATES SYNTAX SCAN.
  129. *
  130. * $ = END OF LINE TERMINATOR.
  131. * IF WERE THE ONLY CHARACTER IN A SYNTAX LINE,
  132. * THEN IT IS AN END OF TABLE INDICATOR.
  133. *
  134. * THE FIRST RESYNC POINT "[" HAS SPECIAL SIGNIFICANCE IN THAT IT IS
  135. * THE POINT THE SYNTAX SCAN IS SET TO UPON MATCHING A COMMA, "^"
  136. * IN THE SYNTAX WITH A "," IN THE INPUT LINE. IF A MISMATCH OCCURS
  137. * WITH THE INPUT TOKEN THEN THE SYNTAX SCAN IS ADVANCED TO THE NEXT
  138. * "[" AND ANOTHER COMPARISON IS MADE. WHEN NO MORE "[" POINTS
  139. * REMAIN IN THE SYNTAX THEN A MISMATCH IS DECLARED, THE OUTPUT
  140. * PARAMETER LIST IS DISCARDED, AND INPUT SCAN RESET TO THE BEGINNING
  141. * OF THE INPUT LINE AND THE NEXT SYNTAX LINE IS TRIED.
  142. *
  143. * THE OUTPUT PARAMETER CODE "@" WHEN READ FROM SYNTAX RESULTS IN A
  144. * NEW OUTPUT PARAMETER WORD TO BE ADDED AND THE NEXT THREE CHARACTERS
  145. * FROM THE SYNTAX TABLE TO BE INSERTED INTO THE WORD. SHOULD A "?"
  146. * BE READ FROM THE SYNTAX LINE, THEN THE NEXT TOKEN FROM INPUT IS
  147. * STORED INTO THE OUTPUT PARAMETER WORD WITH THE LAST PARAMETER CODE.
  148. *
  149. *
  150. * SEMANTIC FLAG CHARACTERS:
  151. *
  152. * \ = SET, ONLY ONE OF SET ALLOWED.
  153. *
  154. * ! = DEFAULT, ONLY ALLOWABLE WITHIN SET. INCLUDE
  155. * IF NO OTHER MEMBER OF SET INCLUDED.
  156. *
  157. *
  158. * A SET IN TERMS OF SEMANTICS IS THE LIST OF PARAMETER CODES (3
  159. * CHARACTERS FOLLOWING "@") CONTAINED WITHIN PAIRS OF "\"
  160. * CHARACTERS.
  161. *
  162. * ONLY ONE MEMBER OF A SET MAY BE PRESENT IN THE OUTPUT PARAMETER
  163. * LIST, AND THIS ALSO DISALLOWS REPEATED OCCURRENCES OF THE SAME
  164. * KEYWORD.
  165. *
  166. * IF THE CHARACTER "!" APPEARS WITHIN A SET, THEN ONE AND ONLY ONE
  167. * PARAMETER CODE FROM THE SET MUST BE IN THE OUTPUT PARAMETER LIST.
  168. * IF THE "!" CHARACTER IS FOLLOWED IMMEDIATELY BY THE "@" CHARACTER,
  169. * THEN THE 3 CHARACTERS FOLLOWING THE "@" ARE THE DEFAULT AND WILL
  170. * BE INSERTED INTO THE PARAMETER LIST IF NO OTHER MEMBER OF THE SET
  171. * WAS IN THE INPUT. IF THE "!" CHARACTER IN THE SYNTAX WAS FOLLOWED
  172. * BY A CHARACTER OTHER THAN "@" THEN AN ERROR IS DECLARED IF NO
  173. * MEMBER OF THE SET WAS IN THE INPUT.
  174. *
  175. *
  176. * SEMANTIC EXAMPLES:
  177. *
  178. * \![ \ = AT LEAST ONE PARAMETER MUST BE ENTERED AND
  179. * THERE IS NO DEFAULT.
  180. *
  181. * \ \ = THE ENTIRE SET OF PARAMETERS IS OPTIONAL.
  182. *
  183. * \ !@DEF\ = DEFAULT, I.E. IF NO MEMBER OF SET IS ENTERED,
  184. * THE PARAMETER CODE FOLLOWING THE "!@" CHARACTERS
  185. * IS THE DEFAULT FOR THE SET.
  186. *
  187. #
  188.  
  189.  
  190. #
  191. **** PROC SSRRCS XREF LIST.
  192. #
  193. XREF
  194. BEGIN
  195. PROC SSBEBF; # EXTRACT BIT FIELD FROM A TABLE #
  196. PROC SSBSBF; # STORE BIT FIELD INTO A TABLE #
  197. PROC SSRGNT; # GET NEXT TOKEN FROM A COMMAND STRING #
  198. END
  199. #
  200. ****
  201. #
  202.  
  203.  
  204. # DEFS FOR ERROR CODE #
  205.  
  206. DEF NOERR$ # 0 #; # NO ERROR #
  207. DEF PRMLNG$ # 1 #; # PARAMETER TOO LONG #
  208. DEF EXPRD$ # 2 #; # EXPECTING PERIOD #
  209. DEF EXPDCMA$ # 3 #; # EXPECTING PERIOD OR COMMA #
  210. DEF UNRGCMD$ # 4 #; # UNRECOGNIZED COMMAND #
  211. DEF INVCMPRM$ # 5 #; # INVALID COMBINATION OF PARAMETERS #
  212. DEF CMDMSGPRM$ # 6 #; # COMMAND MISSING PARAMETER #
  213. DEF OUTPMSH$ # 7 #; # OUTPUT PARAMETER LIST TOO SHORT #
  214. DEF MSGLNG$ # 8 #; # INPUT MESSAGE TOO LONG #
  215. DEF VALOUT$ # 9 #; # VALUE OUT-OF-RANGE #
  216.  
  217. # DEFS FOR SYNTAX, SEMANTIC AND INPUT FLAG CHARACTERS, AND OUTPUT #
  218. # PARAMETER LIST CODE. #
  219.  
  220. DEF MESSAGE$ # "&" #; # SYNTAX- CHAR STRING, 50 OR LESS CHARS #
  221. DEF PRMCODE$ # "@" #; # SYNTAX- OUTPUT PARAMETER CODE #
  222. DEF CHARLEN$ # 6 #; # CHAR LENGTH IN BITS FOR OCT DISP-CODE #
  223. DEF CHARWD$ # 10 #; # NO. OF 6-BIT CHAR PER CM WORD #
  224. DEF COMMA$ # "," #; # SYNTAX AND SEMANTIC- SEPARATOR #
  225. DEF A$ # "A" #; # INPUT- LOWER BOUND FOR ALPH-NUM STRING#
  226. DEF EOL$ # "$" #; # SYNTAX- END OF LINE TERMINATOR #
  227. DEF DFONEST$ # "!" #; # SEMANTIC- DEFAULT, ONE OF SET #
  228. DEF ONESET$ # "\" #; # SEMANTIC- SET, ONE OF SET ALLOWED #
  229. DEF ENDSYNST$ # ">" #; # SYNTAX- END OF SYNONYM SET #
  230. DEF MAXMSGL$ # 50 #; # INPUT- MAX MESSAGE LENGTH IN CHARS #
  231. DEF MAXSVC # 255 #; # INPUT- MAX NUMBER OF SVC CIRCUITS #
  232. DEF ZERO$ # "0" #; # INPUT- LOWER BOUND FOR NUMERIC STRING #
  233. DEF NINE$ # "9" #; # INPUT- UPPER BOUND OF ALPH-NUM STRING #
  234. DEF PERIOD$ # "." #; # SEMANTIC- END OF INPUT TERMINATOR #
  235. DEF ENDMH$ # "^" #; # SYNTAX- END MATCHER #
  236. DEF PRMTR$ # "?" #; # SYNTAX- PARAMETER 1-7 ALPHA-NUM CHARS #
  237. DEF RESYNC$ # "[" #; # SYNTAX- RESYNC CHAR #
  238. DEF BEGSYNST$ # "<" #; # SYNTAX- BEGIN OF SYNONYM SET #
  239. DEF SYNSPTR$ # "_" #; # SYNTAX- SEPARATOR FOR SYNONYM SET #
  240. DEF VEB$ # "VEB" #; # OUTPUT-PARAMETER-LIST VERB CODE #
  241. DEF RPARENTH # "(" # ;
  242. DEF LPARENTH # ")" # ;
  243. DEF MS0$ # "MS0" #; # PARAMETER CODE FOR SEND MESSAGE CMD #
  244.  
  245.  
  246. # DEFS FOR ARRAY SIZES #
  247.  
  248. DEF CSTSIZ$ # 31 #; # CST SIZE = 30 ENTRY + 1 TERMINATE ENTR#
  249. DEF CSSIZ$ # 14 #; # CMD STRING SZ= 139 + 1 TERMINATE CHAR #
  250.  
  251.  
  252.  
  253. # FORMAL PARAMETERS #
  254.  
  255. #
  256. ** CST - COMMAND SYNTAX/SEMANTIC TABLE
  257. *
  258. * THIS TABLE DEFINES THE SYNTAX AND SEMANTICS OF THE ALLOWABLE
  259. * COMMANDS. IT IS THIS TABLE THAT THE INPUT STRING IS GOING TO
  260. * CHECK AGAINST FOR VALID COMMAND.
  261. #
  262.  
  263. ARRAY CST[00:CSTSIZ$] S(CSSIZ$);
  264. BEGIN
  265. ITEM CST$LINE C(00,00,140);
  266. END
  267.  
  268. #
  269. ** CSTRING - COMMAND STRING.
  270. *
  271. * A COMMAND STRING OF *LEN* NUMBER OF CHARACTERS.
  272. #
  273.  
  274. ARRAY CSTRING[00:00] S(CSSIZ$);
  275. BEGIN
  276. ITEM CS$STRING C(00,00,140);
  277. END
  278.  
  279. ITEM LEN I; # LENGTH IN CHARS OF COMMAND STRING #
  280.  
  281. #
  282. ** OUTPARM - OUTPUT PARAMETER LIST.
  283. *
  284. * THIS ARRAY CONTAINS THE OUTPUT PARAMETER LIST RESULTING FROM
  285. * A SUCCESSFUL RECOGNITION OF THE INPUT STRING.
  286. * NOTE: THIS ARRAY SIZE HAS TO BE THE SAME AS *MAX*.
  287. #
  288.  
  289. ARRAY OUTPARM[00:30] S(1);
  290. BEGIN
  291. ITEM OPM$WORD C(00,00,10); # WHOLE WORD REFERENCE #
  292. ITEM OPM$VALUE C(00,00,07); # PARAMETER VALUE #
  293. ITEM OPM$MSGL U(00,00,42); # MESSAGE LENGTH #
  294. ITEM OPM$CODE C(00,42,03); # PARAMETER CODE #
  295. END
  296.  
  297. ITEM MAX I; # MAX NO. OF ENTRIES IN OUTPARM #
  298. ITEM OUTCNT I; # ACTUAL NO. OF ENTRIES IN OUTPARM #
  299. ITEM EC I; # ERROR CODE #
  300. ITEM ET C(10); # ERROR TEXT #
  301.  
  302. #
  303. ** PARMLST - PARAMETER LIST.
  304. *
  305. * THIS IS AN INTERMEDIATE PARAMETER LIST BUILT BY THE SYNTAX
  306. * CHECKER WITH PARAMETERS IN THE ORDER AS IT IS ENTERED IN
  307. * THE COMMAND. THEN IT IS USED BY THE SEMANTIC CHECKER TO
  308. * BUILD THE ACTUAL OUTPUT PARAMETER LIST(OUTPARM) WITH
  309. * PARAMETERS IN THE ORDER AS IT APPEARS IN THE COMMAND
  310. * SYNTAX TABLE.
  311. * NOTE: THIS ARRAY SIZE HAS TO BE THE SAME SIZE AS *OUTPARM*.
  312. #
  313.  
  314. ARRAY PARMLST[00:30] S(1);
  315. BEGIN
  316. ITEM PML$WORD C(00,00,10); # WHOLE WORD REFERENCE #
  317. ITEM PML$VALUE C(00,00,07); # PARAMETER VALUE #
  318. ITEM PML$NCVAL U(00,00,08); # PARAMETER HEX VALUE #
  319. ITEM PML$MSGL U(00,00,42); # MESSAGE LENGTH #
  320. ITEM PML$CODE C(00,42,03); # PARAMETER CODE #
  321. END
  322.  
  323. # ACTUAL PARAMETERS TO *SSBEBF*, *SSBSBF*, AND *SSRGNT* #
  324.  
  325. ITEM BLEN I; # NO. OF BITS TO EXTRACT/STORE (X6) #
  326. ITEM GNTEC I; # ERROR CODE FROM *SSRGNT* #
  327. ITEM IBIT I; # INPUT- START BIT POSITION W/I WORD #
  328. ITEM IORD I; # INPUT- START WORD ORDINAL W/I TABLE #
  329. ITEM IPOS I; # INPUT- NEXT CHAR POSITION #
  330. ITEM IIPOS I; # INPUT- CURRENT CHAR POSITION #
  331. ITEM ITOKEN C(10); # INPUT- CURRENT TOKEN #
  332. ITEM PSPOS I; # SYNTAX- PREVIOUS CHAR POSITION #
  333. ITEM PSTOKEN C(10); # SYNTAX- PREVIOUS TOKEN #
  334. ITEM RESULT C(10); # RESULT OF EXTRACTION OF BIT FIELD #
  335. ITEM SBIT I; # SYNTAX_ START BIT POSITION W/I WORD #
  336. ITEM SORD I; # SYNTAX_ START WORD ORDINAL W/I TABLE #
  337. ITEM SPOS I; # SYNTAX- NEXT CHAR POSITION #
  338. ITEM STOKEN C(10); # SYNTAX- CURRENT TOKEN #
  339.  
  340.  
  341. # GENERAL ITEMS #
  342.  
  343. ITEM CURLINE B; # LOOP EXIT VAR ON DONE WITH CURRENT LINE #
  344. ITEM DONE B; # LOOP EXIT VAR ON PUT MSG INTO OUTPARM #
  345. ITEM EOSET B; # LOOP EXIT VAR ON END OF SET #
  346. ITEM ERROR B; # LOOP EXIT VAR ON ERROR #
  347. ITEM FOUND B; # LOOP EXIT VAR ON FOUND CODE IN OUTPARM #
  348. ITEM FRSTEOS B; # FIRST END OF SET FOUND FLAG #
  349. ITEM I I; # INDUCTION VAR ON CST #
  350. ITEM J I; # INDUCTION VAR #
  351. ITEM K I; # INDUCTION VAR #
  352. ITEM L I; # INDUCTION VAR #
  353. ITEM M I; # INDUCTION VAR #
  354. ITEM N I; # INDUCTION VAR #
  355. ITEM MEMCNT I; # MEMBER COUNT #
  356. ITEM MEMREQD B; # MEMBER REQUIRED FLAG #
  357. ITEM MSGLEN I; # MESSAGE LENGTH IN CHARS #
  358. ITEM OP I; # INDEX TO OUTPARM #
  359. ITEM RESYNCFOUD B; # FIRST RESYNC FOUND FLAG #
  360. ITEM RESYNCPONT I; # FIRST RESYNC POINT #
  361. ITEM SETDFAULT C(7); # DEFAULT FOR THE SET #
  362. ITEM SPASS B; # LOOP EXIT VAR ON SYNTAX/SEMANTIC PASS #
  363. ITEM SVCBIN I; # BINARY VALUE OF SVC COUNT #
  364. ITEM SVCCNT I; # SVC COUNT #
  365. ITEM SVCCONT B; # LOOP EXIT VAR ON SVC CONVERSION PASS #
  366. ITEM SYNYMACTVE B; # SYNONYM ACTIVE FLAG #
  367.  
  368.  
  369. CONTROL EJECT;
  370.  
  371.  
  372. #
  373. * IF INPUT COMMAND STRING IS NULL, EXIT WITH
  374. * EC = UNRECOGNIZED COMMAND.
  375. #
  376.  
  377. IF LEN EQ 0
  378. THEN
  379. BEGIN
  380. EC = UNRGCMD$;
  381. GOTO EXIT;
  382. END
  383.  
  384. # INITIALIZES VARIABLES AND ARRAYS #
  385.  
  386. EC = NOERR$; # PRESET ERROR CODE TO NO ERROR #
  387. ET = " "; # PRESET ERROR TEXT TO BLANKS #
  388. SPASS = FALSE; # PRESET SYNTAX CHECKING PASS TO FALSE #
  389. ERROR = FALSE; # PRESET INPUT ERROR TO FALSE #
  390.  
  391. #
  392. * START SYNTAX CHECKING OF THE INPUT COMMAND STRING UNTIL IT PASS
  393. * ON A SYNTAX LINE, OR *CST* HAS BEEN EXHAUSTED, OR ERROR IS
  394. * DETECTED IN INPUT.
  395. #
  396.  
  397. FOR I = 0 STEP 1 WHILE ((NOT SPASS)
  398. AND (NOT ERROR))
  399. DO
  400. BEGIN # PROCESSING SYNTAX TABLE #
  401. IPOS = 0; # RESET TO BEGINNING OF INPUT #
  402. SPOS = 0; # RESET TO BEGINNING OF A NEW SYTAX LINE #
  403. CURLINE = TRUE; # RESET CURRENT SYNTAX LINE TO TRUE #
  404. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC); # GET FIRST STKN #
  405. IF STOKEN EQ EOL$
  406. THEN
  407. BEGIN
  408. EC = UNRGCMD$; # END OF CST, UNRECOGNIZED COMMAND #
  409. ERROR = TRUE;
  410. END
  411. ELSE
  412. BEGIN # PROCESSING A NEW SYNTAX LINE #
  413. RESYNCFOUD = FALSE; # RESET RESYNC-FOUND TO FALSE #
  414. SYNYMACTVE = FALSE; # RESET SYNONYM_ACTIVE TO FALSE #
  415. FOR J = 0 STEP 1 UNTIL 30
  416. DO
  417. BEGIN # CLEAR INTERMEDIATE PARAMETER LIST#
  418. PML$WORD[J] = " ";
  419. END
  420. OUTCNT = 0; # RESET OUTCNT #
  421. OP = 0; # RESET PARMLST INDEX TO FIRST ENTRY#
  422. PML$VALUE[OP] = STOKEN; # ADD FIRST S-TOKEN TO PARMLST #
  423. PML$CODE[OP] = VEB$; # ADD VERB CODE #
  424. OUTCNT = OUTCNT + 1; # INCREMENT OUTCNT #
  425. FOR J = 0 WHILE (STOKEN NQ COMMA$)
  426. DO # LOOP TIL STOKEN = "," #
  427. BEGIN
  428. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  429. IF STOKEN EQ PRMCODE$
  430. THEN
  431. BEGIN # @, ADD NEXT TOKEN TO PARMLST #
  432. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  433. OP = OP + 1; # ALLOC A NEW ENTRY IN PARMLST #
  434. OUTCNT = OUTCNT + 1; # INCREMENT OUTCNT #
  435. PML$CODE[OP] = STOKEN; # ADD TOKEN TO PARMLST #
  436. END
  437. END
  438. # SKIP THE "," #
  439.  
  440. FOR J = 0 WHILE ((NOT SPASS)
  441. AND (STOKEN NQ EOL$)
  442. AND (CURLINE)
  443. AND (NOT ERROR))
  444. DO # LOOP TIL SYNTAX PASS, OR END OF SYN-LINE#
  445. # OR NOT CURRENT SYN-LINE, OR INPUT ERROR #
  446. BEGIN # CASE ON SYNTAX FLAG CHARACTERS #
  447. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  448. IF STOKEN EQ PRMCODE$
  449. THEN
  450. BEGIN
  451. GOTO LLPRMCODE;
  452. END
  453. ELSE IF STOKEN EQ RPARENTH
  454. OR STOKEN EQ LPARENTH
  455. THEN
  456. BEGIN
  457. GOTO LLPARENTH ;
  458. END
  459. ELSE IF STOKEN EQ PRMTR$
  460. THEN
  461. BEGIN
  462. GOTO LLPRMTR;
  463. END
  464. ELSE IF STOKEN EQ ENDMH$
  465. THEN
  466. BEGIN
  467. GOTO LLENDMH;
  468. END
  469. ELSE IF STOKEN EQ RESYNC$
  470. THEN
  471. BEGIN
  472. GOTO LLRESYNC;
  473. END
  474. ELSE IF STOKEN EQ BEGSYNST$
  475. THEN
  476. BEGIN
  477. GOTO LLBEGSYNST;
  478. END
  479. ELSE IF STOKEN EQ ENDSYNST$
  480. THEN
  481. BEGIN
  482. GOTO LLENDSYNST;
  483. END
  484. ELSE IF STOKEN EQ MESSAGE$
  485. THEN
  486. BEGIN
  487. GOTO LLMESSAGE;
  488. END
  489. ELSE IF ((STOKEN EQ SYNSPTR$)
  490. OR (STOKEN EQ DFONEST$)
  491. OR (STOKEN EQ ONESET$))
  492. THEN
  493. BEGIN
  494. GOTO ENDCASE1;
  495. END
  496. ELSE
  497. BEGIN
  498. GOTO LLOTHER;
  499. END
  500.  
  501. LLPRMCODE: # @, STORE PARAMETER CODE IN OUTPUT #
  502. IF OP+1 GQ MAX
  503. THEN
  504. BEGIN
  505. EC = OUTPMSH$; #OUTPUT PARAMETER LIST TOO SHORT#
  506. ERROR = TRUE;
  507. END
  508. ELSE
  509. BEGIN
  510. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  511. IF STOKEN NQ EOL$
  512. THEN
  513. BEGIN
  514. OP = OP + 1; # ALLOC A NEW ENTRY IN PARMLST #
  515. OUTCNT = OUTCNT + 1; # INCREMENT OUTCNT #
  516. PML$CODE[OP] = STOKEN; # ADD STOKEN TO PARMLST #
  517. END
  518. END
  519. GOTO ENDCASE1;
  520.  
  521. LLPARENTH:
  522. IF IPOS EQ LEN
  523. THEN
  524. SPASS = TRUE ;
  525. ELSE
  526. BEGIN
  527. EC = UNRGCMD$ ;
  528. ET = ITOKEN ;
  529. ERROR = TRUE ;
  530. END
  531. GOTO ENDCASE1 ;
  532.  
  533. LLPRMTR: # ?, ALPHA-NUM STRING EXPECT IN INPUT #
  534. IF IPOS GQ LEN
  535. THEN
  536. BEGIN
  537. EC = CMDMSGPRM$; # COMMAND MISSING PARAMETER #
  538. ERROR = TRUE;
  539. END
  540. ELSE
  541. BEGIN
  542. SSRGNT(CSTRING, IPOS, LEN, ITOKEN, GNTEC);
  543. IF GNTEC NQ 0
  544. THEN
  545. BEGIN
  546. EC = PRMLNG$; # PARAMETER TOO LONG #
  547. ET = ITOKEN;
  548. ERROR = TRUE;
  549. END
  550. ELSE
  551. BEGIN
  552. IF PML$CODE[OP] EQ "NC0" # NCIR PARAMETER #
  553. THEN
  554. BEGIN
  555. SVCCNT = 0; # INITIALIZE SVC ACCUM. #
  556. SVCCONT = TRUE; # INITIALIZE LOOP CONTINUE VAR #
  557. FOR N = 0 STEP 1 WHILE SVCCONT
  558. DO
  559. BEGIN # CONVERT TOKEN TO INTEGER #
  560. SVCCONT = N LQ 3; # SCAN FOUR CHARACTERS #
  561. IF (C<N,1>ITOKEN GQ ZERO$)
  562. AND (C<N,1>ITOKEN LQ NINE$)
  563. THEN
  564. BEGIN
  565. SVCBIN = C<N,1>ITOKEN - O"33"; # CONVERT TO OCT.#
  566. SVCCNT = (SVCCNT * 10) + SVCBIN; # UPDATE ACCUM.#
  567. END
  568. ELSE
  569. IF C<N,1>ITOKEN NQ " " # CHAR NOT A SPACE #
  570. THEN
  571. BEGIN
  572. CURLINE = FALSE; # NEXT SYN-LINE #
  573. GOTO ENDCASE1;
  574. END
  575. ELSE
  576. SVCCONT = FALSE; # EXIT LOOP AND RANGE CHECK #
  577. END # FOR LOOP #
  578. IF SVCCNT GR MAXSVC # MAX NO. OF SVC CIRCUITS #
  579. THEN
  580. BEGIN
  581. EC = VALOUT$; # VALUE OUT-OF-RANGE #
  582. ET = ITOKEN;
  583. ERROR = TRUE;
  584. END
  585. ELSE
  586. BEGIN
  587. PML$NCVAL[OP] = SVCCNT; # STORE NO. SVCS #
  588. GOTO ENDCASE1;
  589. END
  590. END # IF NC0 #
  591. ELSE
  592. IF (C<0,1>ITOKEN GQ A$) AND (C<0,1>ITOKEN LQ NINE$)
  593. THEN
  594. BEGIN # ALPHA-NUM STRING #
  595. PML$VALUE[OP] = ITOKEN; # ADD ITOKEN TO PARMLST #
  596. END
  597. ELSE
  598. BEGIN
  599. CURLINE = FALSE; # NEXT SYN-LINE #
  600. END
  601. END
  602. END
  603. GOTO ENDCASE1;
  604.  
  605.  
  606. LLENDMH: # "^ ", END OR COMMA MATCHER #
  607. IF IPOS EQ LEN
  608. THEN
  609. BEGIN # NO "." IN INPUT, ONE IS ASSUMMED #
  610. SPASS = TRUE; # SYNTAX PASS SUCCESSFUL #
  611. END
  612. ELSE
  613. BEGIN
  614. SSRGNT(CSTRING, IPOS, LEN, ITOKEN, GNTEC);
  615. IF GNTEC NQ 0
  616. THEN
  617. BEGIN
  618. EC = PRMLNG$;
  619. ET = ITOKEN;
  620. ERROR = TRUE;
  621. END
  622. ELSE
  623. BEGIN
  624. IF ITOKEN EQ PERIOD$
  625. THEN
  626. BEGIN
  627. IF IPOS EQ LEN
  628. THEN # END OF INPUT STRING #
  629. BEGIN
  630. SPASS = TRUE; # I-TOKEN = ".", SYNTAX PASS #
  631. END
  632. ELSE
  633. BEGIN # PERIOD IN MIDST OF INPUT #
  634. EC = UNRGCMD$;
  635. ET = ITOKEN;
  636. ERROR = TRUE;
  637. END
  638. END
  639. ELSE IF ITOKEN EQ COMMA$
  640. THEN
  641. BEGIN # I-TOKEN = "," #
  642. IF RESYNCFOUD
  643. THEN
  644. BEGIN # RESYNC FOUND #
  645. PSPOS = SPOS - 2; # GET PREVIOUS TOKEN #
  646. SSRGNT(CST[I], PSPOS, 0, PSTOKEN, GNTEC);
  647. IF PSTOKEN NQ RESYNC$
  648. THEN
  649. BEGIN # "^" NOT PRECEDED BY "[" #
  650. SPOS = RESYNCPONT; # RESET TO RESYNC PT #
  651. END
  652. END
  653. ELSE
  654. BEGIN
  655. IF IPOS EQ LEN
  656. THEN # END OF INPUT "," INSTEAD OF"."#
  657. BEGIN
  658. EC = EXPRD$; # EXPECTING PERIOD #
  659. ET = ITOKEN;
  660. ERROR = TRUE;
  661. END
  662. END
  663. END
  664. ELSE # OTHER #
  665. BEGIN
  666. EC = EXPDCMA$; # EXPECTING PERIOD OR COMMA #
  667. ET = ITOKEN;
  668. ERROR = TRUE;
  669. END
  670. END
  671. END
  672. GOTO ENDCASE1;
  673.  
  674. LLRESYNC: # [, FIRST RESYNC POINT #
  675. RESYNCFOUD = TRUE; # SET RESYNC-FOUND TRUE #
  676. RESYNCPONT = SPOS; # SET RESYNC-POINT TO CUR S-TKN #
  677. GOTO ENDCASE1;
  678. LLBEGSYNST: # <, BEING SYNONYM SET #
  679. SYNYMACTVE = TRUE; # SET SYNONYM-ACTIVE TRUE #
  680. GOTO ENDCASE1;
  681.  
  682. LLENDSYNST: # >, END OF SYNONYM SET #
  683. SYNYMACTVE = FALSE; # SET SYNONYM_ACTIVE TO FALSE #
  684. IF RESYNCFOUD
  685. THEN
  686. BEGIN # RESYNC FOUND #
  687. FOR K = 0 WHILE ((STOKEN NQ RESYNC$)
  688. AND (CURLINE))
  689. DO # SKIP FORWARD TO NEXT "[" #
  690. BEGIN
  691. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  692. IF STOKEN EQ EOL$
  693. THEN
  694. BEGIN # END OF SYNTAX LINE #
  695. CURLINE = FALSE; # SKIP TO NEXT SYNTAX LINE #
  696. END
  697. END
  698. END
  699. ELSE
  700. BEGIN # RESYNC NOT FOUND #
  701. CURLINE = FALSE; # SKIP TO NEXT SYNTAX LINE #
  702. END
  703. GOTO ENDCASE1;
  704.  
  705. LLMESSAGE: # &, TRNSFR ALL INPUT CHARS TO PARMLST #
  706. MSGLEN = LEN - IPOS; # MESSAGE LENGTH #
  707. IF MSGLEN GR MAXMSGL$
  708. THEN
  709. BEGIN # MESSAGE EXCEEDS LIMIT #
  710. EC = MSGLNG$; # MESSAGE TOO LONG #
  711. ERROR = TRUE;
  712. END
  713. ELSE
  714. BEGIN # MESSAGE W/I LEN LIMIT #
  715. PML$MSGL[OP] = MSGLEN; # ADD MSG LENGTH TO PARMLST #
  716.  
  717. # CONVERT IPOS INTO TABLE ORDINAL(IORD) AND STARTING #
  718. # BIT(IBIT) WITHIN WORD. #
  719.  
  720. IORD = 0;
  721. IBIT = IPOS * CHARLEN$;
  722. FOR K = 0 WHILE (IPOS - CHARWD$) GR 0
  723. DO
  724. BEGIN
  725. IPOS = IPOS - CHARWD$;
  726. IORD = IORD + 1;
  727. IBIT = IPOS * CHARLEN$;
  728. END
  729. DONE = FALSE; # RESET LOOP EXIT VAR TO FALSE #
  730. IF IBIT EQ 60
  731. THEN # ADJUST BIT POSITION TO BEG OF NEXT WRD #
  732. BEGIN
  733. IORD = IORD + 1;
  734. IBIT = 0;
  735. END
  736. FOR K = 0 WHILE (NOT DONE)
  737. DO # LOOP TIL ALL CHARS STORED IN PARMLST #
  738. BEGIN
  739. IF MSGLEN GR CHARWD$
  740. THEN
  741. BEGIN
  742. MSGLEN = MSGLEN - CHARWD$; # DECREMENT MSGLEN #
  743. BLEN = CHARWD$ * CHARLEN$; # STORE WHOLD WORD #
  744. END
  745. ELSE
  746. BEGIN
  747. BLEN = MSGLEN * CHARLEN$; # STORE MSGLEN NO OF CHAR #
  748. DONE = TRUE; # AND THIS IS IT #
  749. END
  750. IF OP + 1 GQ MAX
  751. THEN
  752. BEGIN
  753. EC = OUTPMSH$; # PARMLST TOO SHORT #
  754. ERROR = TRUE;
  755. DONE = TRUE;
  756. END
  757. ELSE
  758. BEGIN
  759. SSBEBF(CSTRING, IORD, IBIT, BLEN, RESULT);
  760. OP = OP + 1; # ALLOC NEW ENTRY IN PARMLST #
  761. OUTCNT = OUTCNT + 1; # INCREMENT OUTCNT, STORE CHARS #
  762. SORD = 0;
  763. SBIT = 0;
  764. SSBSBF(PARMLST[OP], SORD, SBIT, BLEN, RESULT);
  765. END
  766. END
  767. SPASS = TRUE; # TERMINATE SYNTAX CHECKING #
  768. END
  769. GOTO ENDCASE1;
  770.  
  771. LLOTHER: # OTHER, STRING TO BE COMPARED W/ INPUT #
  772. IF IPOS GQ LEN
  773. THEN
  774. BEGIN # END OF INPUT STRING #
  775. EC = CMDMSGPRM$; # COMMAND MISSING PARAMETER #
  776. ERROR = TRUE;
  777. END
  778. ELSE
  779. BEGIN
  780. IIPOS = IPOS; # SAVE CUR CHAR POSITION #
  781. SSRGNT(CSTRING, IPOS, LEN, ITOKEN, GNTEC);
  782. IF GNTEC NQ 0
  783. THEN
  784. BEGIN
  785. EC = PRMLNG$;
  786. ET = ITOKEN;
  787. ERROR = TRUE;
  788. END
  789. ELSE
  790. BEGIN
  791. IF STOKEN EQ ITOKEN
  792. THEN
  793. BEGIN # INPUT TOKEN MATCH #
  794. IF SYNYMACTVE
  795. THEN
  796. BEGIN
  797. FOR K = 0 WHILE (STOKEN NQ ENDSYNST$)
  798. DO
  799. BEGIN # SKIP FORWARD TO NEXT ">" TKN #
  800. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  801. END
  802. SYNYMACTVE = FALSE; # SET SYNONYM-ACTIVE FALSE #
  803. END
  804. END
  805. ELSE
  806. BEGIN # I-TOKEN NOT MATCH S-TOKEN #
  807. IPOS = IIPOS; # RESET NXT POS TO CUR POS #
  808. IF NOT SYNYMACTVE
  809. THEN
  810. BEGIN # SYNONYM NOT ACTIVE #
  811. IF NOT RESYNCFOUD
  812. THEN
  813. BEGIN # RESYNC NOT FOUND #
  814. CURLINE = FALSE; # SKIP TO NEXT SYNTAX LINE #
  815. END
  816. ELSE
  817. BEGIN # RESYNC FOUND #
  818. FOR K = 0 WHILE ((STOKEN NQ RESYNC$)
  819. AND (CURLINE))
  820. DO
  821. BEGIN # SKIP FORWARD TO NEXT "[" #
  822. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  823. IF STOKEN EQ EOL$
  824. THEN
  825. BEGIN # END OF SYNTAX LINE #
  826. CURLINE = FALSE; # SKIP TO NEXT SYN-LINE #
  827. END
  828. ELSE
  829. BEGIN
  830. SYNYMACTVE = FALSE; # SET SYNONYM-ACT FALSE #
  831. END
  832. END
  833. END
  834. END
  835. END
  836. END
  837. END
  838. GOTO ENDCASE1;
  839.  
  840. ENDCASE1:
  841. END # END CASE ON SYNTAX FLAGS #
  842.  
  843. END # PROCESSING A NEW SYNTAX LINE #
  844.  
  845. END # END PROCESSING SYNTAX TABLE #
  846.  
  847. IF NOT SPASS
  848. THEN GOTO EXIT; # FAIL SYNTAX CHECKING, EXIT WITH ERROR #
  849.  
  850. #
  851. * START SEMANTIC CHECKING USING THE INTERMEDIATE PARAMETER LIST AND
  852. * THE SYNTAX LINE(LINE I-1) THAT THE INPUT LINE JUST PASSED AT.
  853. * AT THIS TIME ANY DUPLICATE KEYWORDS, MISSING PARAMETERS AND
  854. * DEFAULTS TO BE INSERTED ARE RECOGNIZED AND ADDED TO THE OUPUT
  855. * OR THE ENTIRE COMMAND REJECTED IF WHAT WAS ENTERED IS INCORRECT.
  856. #
  857.  
  858.  
  859. FRSTEOS = FALSE; # CLEAR FIRST END OF SET FLAG #
  860. I = I - 1; # RE-POSITION TO THE JUST PASSED SYN-LINE #
  861. SPOS = 0; # RESET TO BEGINNING OF THE SYN-LINE #
  862. ERROR = FALSE; # SET ERROR FLAG TO FALSE #
  863. STOKEN = " "; # SET TO BLANK TO FORCE FIRST TIME LOOP #
  864.  
  865. #
  866. * CLEAR OUTPUT PARMETER LIST.
  867. #
  868.  
  869. FOR J = 0 STEP 1 UNTIL MAX
  870. DO
  871. BEGIN
  872. OPM$WORD[J] = " ";
  873. END
  874.  
  875. OP = 0; # SET OUTPARM INDEX TO 0 #
  876. OPM$WORD[OP] = PML$WORD[0]; # COPY COMMAND VERB OVER #
  877.  
  878. FOR J = 0 WHILE ((STOKEN NQ EOL$)
  879. AND (NOT ERROR))
  880. DO # LOOP TIL END OF SYNTAX LINE OR ERROR #
  881. BEGIN
  882. EOSET = FALSE; # SET END OF SET TO FALSE #
  883. MEMCNT = 0; # SET MEMBER COUNT TO 0 #
  884. MEMREQD = FALSE; # SET MEMBER-REQUIRED TO FALSE #
  885. SETDFAULT = " "; # SET SET-DEFAULT TO EMPTY #
  886. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  887. FOR K = 0 WHILE ((STOKEN NQ EOL$)
  888. AND (NOT ERROR)
  889. AND (NOT EOSET))
  890. DO # LOOP TIL END OF LINE, OR SET, OR ERROR #
  891. BEGIN
  892. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  893. IF STOKEN EQ PRMCODE$
  894. THEN
  895. BEGIN
  896. GOTO LLSPRMCODE;
  897. END
  898. ELSE IF STOKEN EQ DFONEST$
  899. THEN
  900. BEGIN
  901. GOTO LLDFONEST;
  902. END
  903. ELSE IF STOKEN EQ ONESET$
  904. THEN
  905. BEGIN
  906. GOTO LLONESET;
  907. END
  908. ELSE
  909. BEGIN
  910. GOTO ENDCASE2;
  911. END
  912.  
  913. LLSPRMCODE: # @, PARAMETER CODE #
  914. FOUND = FALSE;
  915. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC); # GET STOKEN #
  916. FOR L = 1 STEP 1 WHILE ((L LS OUTCNT)
  917. AND (NOT FOUND))
  918. DO
  919. BEGIN # SEE IF PARM CODE APPEARS IN PARMLST #
  920. IF STOKEN EQ PML$CODE[L]
  921. THEN
  922. BEGIN
  923. OP = OP + 1; # BUMP OUTPARM INDEX #
  924. OPM$WORD[OP] = PML$WORD[L]; # COPY PARM TO OUTPARM #
  925. FOR M=L+1 STEP 1 WHILE M LS OUTCNT
  926. DO # CHECK FOR DUPLICATE DECLARATION #
  927. BEGIN
  928. IF STOKEN EQ PML$CODE[M]
  929. THEN # IF DUPLICATE DECLARATIN FOUND #
  930. BEGIN
  931. ERROR = TRUE; # SET ERROR INDICATOR #
  932. EC = INVCMPRM$; # SET ERROR CODE #
  933. END
  934. END
  935. IF PML$CODE[L] EQ MS0$
  936. THEN
  937. BEGIN # MESSAGE CMD- COPY ENTIRE MESSAGE #
  938. L = L + 1;
  939. FOR M = OP+1 STEP 1 UNTIL OUTCNT-1
  940. DO
  941. BEGIN
  942. OPM$WORD[M] = PML$WORD[L];
  943. L = L + 1;
  944. END
  945. END
  946. FOUND = TRUE;
  947. END
  948. END
  949. IF FOUND
  950. THEN
  951. BEGIN # PARM CODE APPEARS IN PARMLST #
  952. IF FRSTEOS
  953. THEN # IF FIRST END OF SET FOUND #
  954. BEGIN
  955. MEMCNT = MEMCNT + 1; # INCREMENT MEMBER COUNT #
  956. END
  957. IF MEMCNT GR 1
  958. THEN
  959. BEGIN
  960. EC = INVCMPRM$; # INVALID COMBINATION OF PARM #
  961. ERROR = TRUE;
  962. END
  963. END
  964. GOTO ENDCASE2;
  965.  
  966. LLDFONEST: # !, DEFAULT, OR ONE MEMBER OF SET #
  967. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC); # GET NEXT TOKN#
  968. IF STOKEN EQ PRMCODE$
  969. THEN
  970. BEGIN # STOKEN = "@" #
  971. SSRGNT(CST[I], SPOS, 0, STOKEN, GNTEC);
  972. FOUND = FALSE;
  973. FOR L = 1 STEP 1 WHILE ((L LS OUTCNT)
  974. AND (NOT FOUND))
  975. DO # SEE IF NEXT TKN IN PARMLST #
  976. BEGIN
  977. IF STOKEN EQ PML$CODE[L]
  978. THEN
  979. BEGIN
  980. MEMCNT = MEMCNT + 1; # INCREMENT MEMBER COUNT #
  981. IF MEMCNT GR 1
  982. THEN
  983. BEGIN
  984. EC = INVCMPRM$; # INVALID COMBINATION OF PARM #
  985. ERROR = TRUE;
  986. GOTO ENDCASE2;
  987. END
  988. OP = OP + 1;
  989. OPM$WORD[OP] = PML$WORD[L];
  990. FOUND = TRUE;
  991. END
  992. END
  993. IF NOT FOUND
  994. THEN
  995. BEGIN # NEXT STOKEN NOT IN PARMLST #
  996. SETDFAULT = STOKEN; # SAVE IT AS SET-DEFAULT #
  997. END
  998. END
  999. ELSE
  1000. BEGIN # ! NOT FOLLOWED BY @ #
  1001. MEMREQD = TRUE; # SET MEMBER REQUIRED TO TRUE #
  1002. END
  1003. GOTO ENDCASE2;
  1004.  
  1005. LLONESET: # \, END OF SET #
  1006. IF MEMCNT EQ 0
  1007. THEN
  1008. BEGIN # MEMBER-COUNT = 0 #
  1009. IF SETDFAULT NQ " "
  1010. THEN
  1011. BEGIN # SET DEFAULT AVAILABLE #
  1012. IF OUTCNT LS MAX
  1013. THEN
  1014. BEGIN
  1015. PML$CODE[OUTCNT] = SETDFAULT; # ADD SDF TO PARMLST #
  1016. OPM$CODE[OUTCNT] = SETDFAULT; # ADD SDF TO OUTPARM #
  1017. OUTCNT = OUTCNT + 1; # INCREMENT OUTCNT #
  1018. END
  1019. ELSE
  1020. BEGIN
  1021. EC = OUTPMSH$; # PARMLST TOO SHORT #
  1022. ERROR = TRUE;
  1023. END
  1024. END
  1025. ELSE
  1026. BEGIN # SET-DEFAULT EMTPY #
  1027. IF MEMREQD
  1028. THEN
  1029. BEGIN # MEMBER REQUIRED TRUE #
  1030. EC = CMDMSGPRM$; # COMMAND MISSING PARAMETER #
  1031. ERROR = TRUE;
  1032. END
  1033. END
  1034. END
  1035. IF NOT FRSTEOS
  1036. THEN # IF 1ST END OF SET NOT FOUND YET #
  1037. BEGIN
  1038. FRSTEOS = TRUE; # SET FIRST END OF SET FLAG #
  1039. END
  1040. ELSE
  1041. BEGIN
  1042. EOSET = TRUE; # SET END OF SET FLAG #
  1043. END
  1044. GOTO ENDCASE2;
  1045.  
  1046. ENDCASE2:
  1047. END # END OF CASE ON SEMANTIC FLAGS #
  1048.  
  1049. END # END OF WHOLE SYNTAX LINE LOOP #
  1050.  
  1051. EXIT:
  1052. END # SSRRCS #
  1053.  
  1054. TERM
cdc/nos2.source/nam5871/ssrrcs.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator