User Tools

Site Tools


cdc:nos2.source:nam5871:syngen

SYNGEN

Table Of Contents

Source Code

SYNGEN.txt
  1. *DECK SYNGEN
  2. OVERLAY(SYNGEN,0,0)
  3. PRGM SYNGEN;
  4. BEGIN
  5. #**********************************************************************#
  6. ITEM COPYRIGHT C(34) =
  7. "COPYRIGHT CONTROL DATA SYSTEMS INC.1994";
  8. #**********************************************************************#
  9. ITEM ABTFLAG B = FALSE; # TRUE IF *ABORT-ON-ERRORS* PARAMETER #
  10. # WAS SPECIFIED ON CONTROL STATEMENT #
  11. XREF
  12. BEGIN
  13. ITEM LFLAG; #FLAG FOR LISTING OPTION CHOSEN #
  14. # 1 = FULL OUTPUT LISTING REQUESTED.#
  15. # 0 = DIAGNOSTICS ONLY. #
  16. ITEM TFLAG; #FLAG FOR CONSTRUCTION OF A TABLE OF #
  17. #TRACING INFORMATION FOR USE IN TRACING #
  18. #PATHS THRU SYNTBLE. 1 = TRACEM TABLE IS#
  19. #BUILT (DEFAULT CASE). 0 = NOT BUILT. #
  20. ITEM REWIND; #FLAG FOR FILE POSITION OPTION CHOSEN #
  21. # 1 = ALL FILES REWOUND AT END. #
  22. # 0 = NO FILES REWOUND AT END. #
  23. ITEM LXREFWS; #WSA FOR LXREF FILE WRITING. #
  24. ITEM DXREFWS; #WSA FOR DXREF FILE WRITING. #
  25. ITEM SXREFWS; #WSA FOR SXREF FILE WRITING. #
  26. PROC SYNOPEN; #COMPASS RTN WHICH OPENS ALL SYNGEN FILE#
  27. PROC SYNABT; #COMPASS RTN WHICH ABORTS JOB AFTER #
  28. #WRITING DAYFILE DIAGNOSTICS. #
  29. PROC SYNCOM; #COMPASS RTN WHICH WRITES PRESET ARRAY #
  30. #RECORDS TO SYNGEN"S OUTPUT FILE. #
  31. PROC SYNCOPY; #COMPASS RTN WHICH COPIES THE SYNTBLE #
  32. #FILE, AND TRACEM FILE IF BUILT, TO THE #
  33. #SYNGEN OUTPUT FILE. #
  34. ARRAY SYNIWSA[8]; #WORKING STORAGE FOR SYNGEN"S INPUT FILE#
  35. ITEM INWORD C(0,0,10);
  36. ITEM SYNIRL; #INPUT RECORD LENGTH IN CHARACTERS. #
  37. ITEM SYNORL; #OUTPUT RECORD LENGTH IN CHARACTERS. #
  38. ITEM SYNEOF; #EOF FLAG, 1=EOF. #
  39. ARRAY SYNTWSA[5]; #WSA FOR TRACEM FILE I/O. #
  40. ITEM TRACEWSAWD C(0,0,10);
  41. PROC SYNPRNT; #COMPASS RTN WHICH WRITES RECORDS ON THE#
  42. #SYSTEM OUTPUT FILE. #
  43. PROC SYNREAD; #COMPASS RTN WHICH READS RECORDS (CARD #
  44. #IMAGES) FROM SYNGEN"S INPUT FILE. #
  45. PROC LXREFW; #COMPASS RTNS TO WRITE AND READ THE #
  46. PROC LXREFR; #LABEL CROSS REFERENCE FILE, THE DIAG- #
  47. PROC DXREFW; #NOSTIC CROSS REFERENCE FILE AND THE #
  48. PROC DXREFR; #SUBROUTINE CROSS REFERENCE FILE, #
  49. PROC SXREFW; #RESPECTIVELY. #
  50. PROC SXREFR;
  51. PROC TRACEW; #COMPASS RTN WHICH WRITES ON THE TRACEM #
  52. #FILE. #
  53. PROC SYNCLSE; #COMPASS RTN WHICH CLOSES ALL FILES AND #
  54. #WRITES OUT THE PRESET ARRAYS BUILT BY #
  55. #SYNGEN. #
  56. END
  57. XDEF PROC SYNTBLR;
  58. XDEF ITEM HDRDATE C(10);
  59. XDEF ITEM HDRTIME C(10);
  60. XREF PROC SYNTIDA;
  61. XREF ITEM OUTLEN; # RECORD LENGTH FOR COMPILE FILE #
  62. XREF ITEM REALEOF;
  63. STATUS CHARTYPE ALPHABETIC, NUMERIC, DELIMITER;
  64. DEF SCALL # #; # FOR READABILITY OF PROC CALLS #
  65. ITEM TYPE; # TYPE OF CHARACTER FROM -GETCHAR- #
  66. ARRAY AINCHAR[0]; # HOLDS CHARACTER FROM -GETCHAR- #
  67. BEGIN
  68. ITEM INCHARC C(0,54,1); # FOR CHARACTER USAGE #
  69. ITEM INCHARI U(0,54,6); # FOR NUMBER USAGE #
  70. END
  71. ITEM FC; # FROM CHAR IN -INWORD- #
  72. ITEM FW; # FROM WORD IN QUIWSA ARRAY #
  73. ITEM TOPENTRY; # TOP ENTRY IN THE SKIPTBL #
  74. XREF ITEM DIRFLAG; # FLAG FOR A SKIP DIRECTIVE. 1 A #
  75. # DIRECTIVE, 0- NOT A DIRECTIVE #
  76. XREF ITEM SKIPFLG; # FLAG FOR SKIPPING. 1- SKIP, #
  77. # 0- NOSKIP, -1 - A TRUE IFEQ #
  78. XREF PROC ENDINP;
  79. ARRAY HASHEDTABLE[127]; #TABLE OF POINTERS TO DATA ACCESSED VIA #
  80. ITEM HASHENTRY = [128(0)];#HASHED CODES. #
  81. BASED ARRAY SYMBOLTABLE; #ARRAY FOR ACCESSING SYMBOL TABLE #
  82. BEGIN #ENTRIES. #
  83. ITEM SNAME C(1,0,10);#WORD OF SYMBOL NAME. #
  84. ITEM SDEFINEBIT B(0,0,1);#TRUE IF DEFINED, FALSE OTHERWISE. #
  85. ITEM SLENGTH I(0,6,6);#LENGTH OF SYMBOL IN WORDS. #
  86. ITEM STYPE I(0,12,6); #TYPE OF SYMBOL (LABEL, ROUTINE, ETC.) #
  87. ITEM NEXTPTR I(0,24,18);#PTR TO NEXT ENTRY IN A CHAIN. #
  88. ITEM SVALUE I(0,42,18);#VALUE OF THE SYMBOL. #
  89. END
  90. BASED ARRAY SYMBOLTABLE2;#ARRAY FOR ACCESSING A 2ND SYMBOL TABLE #
  91. BEGIN #ENTRY SIMULTANEOUSLY. #
  92. ITEM SNAME2 C(1,0,10);
  93. ITEM SLENGTH2 I(0,6,6);
  94. END
  95. BASED ARRAY SORT; #USED FOR SORTING THE CROSS REFERENCES. #
  96. ITEM SORTWORD;
  97. BASED ARRAY SYNTBLE; # USED FOR THE -SYNTBLE- -FILE- #
  98. ITEM SYNTBLEWD;
  99. ARRAY [1]; #RESULT OF BINARY NUMBER CONVERTED TO #
  100. ITEM OCTAL; #DISPLAY-CODED OCTAL. #
  101. ARRAY [3]; #HOLDS SYMBOL TO BE INSERTED IN SYMBOL #
  102. # TABLE OR EXTRACTED FROM IT. #
  103. ITEM NAME C(0,0,10); #NAME OF SYMBOL . #
  104. ARRAY SCRATCH[13]; #SCRATCH STORAGE FOR I/O RECORDS. #
  105. ITEM SCRATCHWD C(0,0,10);
  106. BASED ARRAY RA; #ARRAY FOR EXAMINING THE SYSTEMS COMMUN-#
  107. BEGIN #ICATION AREA #
  108. ITEM CCPARAM C(0,0,1);#ACCESSES 1ST CHAR OF CONTROL CARD PARS#
  109. ITEM NEXTAVAIL I(0,42,18);#ACCESSES NEXT AVAILABLE WORD IN FL#
  110. ITEM NRCCPARAMS I(0,42,18);#COUNT OF PARAMS ON CONTROL CARD. #
  111. ITEM FULLWORD I(0,0,60);
  112. ITEM CCFILENAME I(,,42);#ACCESSES LFN CONTROL CARD PARAMS. #
  113. END
  114. BASED ARRAY LABELPTRS; #ARRAY OF POINTERS TO LABELLED SECTIONS #
  115. ITEM LABELPTR; #OF THE SYNTABLE. AS EACH LABEL IS DE- #
  116. #FINED AN ENTRY IN THIS TABLE IS ASSIGN-#
  117. #ED TO IT AND A POINTER VALUE STORED IN #
  118. #THE ASSIGNED ENTRY. #
  119. BASED ARRAY SUBLABELPTRS[99];#POINTERS TO SUBLABEL SECTIONS #
  120. ITEM SUBLABELPTR (,,60);#WITHIN EACH LABELLED SECTION. RE- #
  121. #INITIALIZED FOR EACH LABELLED SECTION. #
  122. #POINTER VALUE IS NEG IF SUBLABEL IS UN-#
  123. #DEFINED, POS IF DEFINED. ARRAY IS IN- #
  124. #DEXED BY SUBLABEL NUMBER. #
  125. ARRAY DUPELABELMSG[7];
  126. ITEM DUPELABEL C(0,0,10) = [" ******** "," ",
  127. " "," ",
  128. " DOUBLY","-DEFINED, ",
  129. "LATEST OVE","RRIDES. "];
  130. ARRAY UNDEFMESSAGE[6];
  131. ITEM UNDEFMESS C(0,0,10) = [" ******** "," ",
  132. " "," ",
  133. " UNDEFI","NED ",
  134. " "];
  135. ARRAY [2]; #DISPLAY-CODED LABEL OF SYNTBLE SECTION #
  136. ITEM CURRENTLABEL C(,,10); #CURRENTLY BEING BUILT. #
  137. ARRAY BADDIGITMSG[4];
  138. ITEM BADDIGIT C(0,0,10) = [" ******** "," ",
  139. "IS NOT A V","ALID INTEG",
  140. "ER. "];
  141. ARRAY LEXSEQ[6];
  142. ITEM LSWORD C(0,0,10) = [" ******** ","KEYWORD OU",
  143. "T OF SEQUE","NCE - ",
  144. 3(" ")];
  145. ARRAY BADOCTALMSG2[4];
  146. ITEM BADOCT2 C(0,0,10) = [" ******** ","PRECEDING ",
  147. "CARD CONTA","INS BAD OC",
  148. "TAL DIGIT."];
  149. ARRAY LABELCOMMENT[5]; #COMMENT FOR LABEL IN SYNTBLE PRESET. #
  150. ITEM LABELCOMWORD C(,,10) = [" # : ",4(" "),
  151. " # "];
  152. ARRAY INSTRCOMMENT[5]; #COMMENT FOR WORD OF CODE IN SYNTBLE. #
  153. ITEM INSTRUCTCOM C(,,10) = [" # ",4(" "),
  154. " # "];
  155. ARRAY PRESETCODE[5]; #FORMAT FOR PRESET LINE OF SYNTBLE CODE.#
  156. BEGIN
  157. ITEM PRESET C(,,10) = [" O"" ",4(" "),
  158. """, "];
  159. ITEM PRESETI; #REDEFINITION OF WORD USAGE. #
  160. END
  161. BASED ARRAY LABELENTRY; #FORMATS AN ENTRY IN THE LBLPTRS PRESET #
  162. BEGIN #ARRAY #
  163. ITEM LABELNAME C(0,0,10); #NAME OF LABEL. #
  164. ITEM LABELPRESET C(5,0,10); #DECIMAL PTR TO SYNTBLE SECTION. #
  165. END
  166. ARRAY PROCNAME[5];
  167. ITEM PNAME C(,,10) = [" PROC SYN","TAXTABLE; ",4(" ")];
  168. ARRAY LABELPTRHEDR[5]; #HEADER RECORD FOR LBLPTRS PRESET ARRAY.#
  169. ITEM LABELPTRHDR C(0,0,10) = [" ARRAY LBL","PTRS [",
  170. " ]; ",3(" ")];
  171. ARRAY LABELPTRITEM[5]; #ITEM DEF RECORD FOR LBLPTRS ARRAY PRE- #
  172. ITEM LBLPTRITEM C(0,0,10) = [" ITEM LB","LPTR U = [", #SET. #
  173. 4(" ")];
  174. ARRAY LABELPTRTAIL[5]; #RECORD FOR TERMINATION OF LBLPTRS PRE- #
  175. ITEM LBLPTRTAIL C(0,0,10) = [5(" ")," ]; "];#SET#
  176. ARRAY TRACEMTAIL[5]; #TAILEND RECORD FOR TRACEM PRESET. #
  177. ITEM TRACEMTAILWD C(0,0,10) = [5(" ")," ]; "];
  178. ARRAY TRACEMHDR[5]; #1ST RECORD FOR TRACEM ARRAY PRESET. #
  179. ITEM TRACEMHDRWD C(0,0,10) = [" ARRAY TRA","CEM [ ",
  180. "]; ",3(" ")];
  181. ARRAY SKIPLINE[5];
  182. ITEM SKIP C(,,10) = [6(" ")];
  183. ARRAY DXREFHEADER2[3];
  184. ITEM DXREFHDR2 C(,,10) = [" DIAGNOSTI","C ",
  185. "REFERENCED"," AT "];
  186. ARRAY LXREFHEADER2[5];
  187. ITEM LXREFHDR2 C(0,0,10) = [" LABEL "," ",
  188. " "," ",
  189. "REFERENCED"," BY "];
  190. ARRAY SXREFHEADER2[5];
  191. ITEM SXREFHDR2 C(0,0,10) = [" SUBROUTIN","E SWITC",
  192. "H POSITION"," ",
  193. "REFERENCED"," BY "];
  194. ARRAY SXREFHEADER3[3];
  195. ITEM SXREFHDR3 C(0,0,10) = [" "," BASE ",
  196. "10 BASE ","8 "];
  197. BASED ARRAY LEXICON [0]; # #
  198. BEGIN # #
  199. ITEM LEXWRD C(0,00,10); # KEYWORD (MAX LENGTH IS 30 CHR)#
  200. ITEM LEXID I(0,00,15); # UNIQUE OCTAL VALUE ASSOCIATED #
  201. # WITH THE KEY WORD. #
  202. ITEM LEX1PARAM I(0,15,15); # PARAMETER VALUE TO BE ASSOCIAT#
  203. ITEM LEX2PARAM I(0,30,15); # ED WITH THE KEY WORD #
  204. ITEM LEXSYNSECT I(0,45,15); # CONTAINS KEYWORD = LABEL FLAG.#
  205. # IF A KEYWORD IS THE SAME AS A #
  206. # LABEL, THE ADDRESS OF THE #
  207. # LABEL IN SYNTABLE WILL OVERLAY#
  208. # THE FLAG IN LEXSYNSECT. #
  209. END
  210. BASED ARRAY SYN1SCRATCH [0]; # BASED ARRAY POINTING TO ONE #
  211. ITEM KEY1WRD C(0,00,10); # WORD KEYWORDS. #
  212. BASED ARRAY SYN2SCRATCH [0]; # BASED ARRAY POINTING TO TWO #
  213. ITEM KEY2WRD C(0,00,10); # WORD KEYWORDS. #
  214. BASED ARRAY SYN3SCRATCH [0]; # BASED ARRAY POINTING TO THREE #
  215. ITEM KEY3WRD C(0,00,10); # WORD KEYWORDS. #
  216. ARRAY LOCWORDS [26];
  217. ITEM LOCWRD I(0,0,60) = [27(0)];
  218. ARRAY KEYWRDHDR [5]; # HEADER FOR LEXWORDS PRESET ARRAY. #
  219. ITEM KEYHDR C(0,0,10) = [" ARRAY LEX","WORDS [",
  220. " ]; ",3(" ")];
  221. ARRAY KEYWRDITEM [5]; # ITEM DEF FOR LEXWORDS PRESET ARRAY. #
  222. ITEM KEYITEM C(0,0,10) = [" ITEM LE","XWRD U = [",
  223. 4(" ")];
  224. ARRAY KEYWRDTERM [5]; # TERM FOR LEXWORDS PRESET ARRAY. #
  225. ITEM KEYTERM C(0,0,10) = [5(" ")," ]; "];
  226. ARRAY KEYWRDLINE [5]; # KEYWRD ENTRY IN LEXWORDS PRESET ARRAY. #
  227. ITEM KEYLINE C(0,0,10) = [" O""",2(" "),
  228. """, # "," ",
  229. " # "];
  230. ARRAY LEXICONHDR [5]; # HEADER FOR THE LEXICON PRESET ARRAY. #
  231. ITEM LEXHDR C(,,10) = [" ARRAY LEX","ICON [26];"," ",
  232. 3(" ")];
  233. ARRAY LEXICONITEM [5]; # ITEM DEF FOR THE LEXICON PRESET ARRAY. #
  234. ITEM LEXITEM C(0,0,10) = [" ITEM LE","X U = [ ",
  235. 4(" ")];
  236. ARRAY LEXICONTERM [5]; # TERM FOR THE LEXICON PRESET ARRAY. #
  237. ITEM LEXTERM C(0,0,10) = [5(" ")," ]; "];
  238. ARRAY LEXICONLINE [5]; # ENTRY IN THE LEXICON PRESET ARRAY. #
  239. ITEM LEXLINE C(0,0,10) = [" O""",2(" "),
  240. """, ",2(" ")];
  241. ITEM NUMBER1WRD;
  242. ITEM NUMBER2WRD;
  243. ITEM NUMBER3WRD;
  244. ITEM KEYFIRSTCHAR;
  245. ITEM MAXKEYWRDS;
  246. ITEM KEY1PTR = 0; # INDEX TO ONE WORD KEYWORDS. #
  247. ITEM KEY2PTR = 0; # INDEX TO TWO WORD KEYWORDS. #
  248. ITEM KEY3PTR = 0; # INDEX TO THREE WORD KEYWORDS#
  249. ITEM LEXPTR; # INDEX TO LEXID,LEX1PARAM, #
  250. # LEX2PARAM, LEXSYNSECT#
  251. ITEM ENTRIES; # COUNTER CONTAINING THE NUMBER #
  252. # OF ENTRIES BASED ON THE FIRST #
  253. # CHARACTER. #
  254. ITEM FIRSTCHAR; # CONTAIN THE DISPLAY CODE VALUE#
  255. # 01 THRU 32. COMPARED AGAINST #
  256. # THE FIRST CHARACTER OF THE KEY#
  257. # WORD TO DETERMINE THE NUMBER #
  258. # OF ENTRIES. #
  259. ITEM WRDLOCPTR; # INDEX INTO THE LEXWORDLOC #
  260. # TABLE. #
  261. ITEM TOTALWORDS; # COUNT OF TOTAL NUMBER OF WORDS#
  262. # PROCESSED IN LEXWORDS. #
  263. ITEM NUMBER1KEY; # TOTAL NUMBER OF 1 WORD KEYWRDS#
  264. ITEM NUMBER2KEY; # TOTAL NUMBER OF 2 WORD KEYWRDS#
  265. ITEM NUMBER3KEY; # TOTAL NUMBER OF 3 WORD KEYWRDS#
  266. # #
  267. # #
  268. # #
  269. # #
  270. # #
  271. ARRAY SYNCHARS[72]; # CONTAINS SYNTAX SPECIFICATIONS#
  272. ITEM CHAR C(0,0,10); # INPUT TO SYNGEN. 1 CHAR PER #
  273. # WORD. #
  274. BASED ARRAY STATETRANS [15,12];
  275. ITEM SWITCHVALUE I(0,0);
  276. ARRAY STATTRNS [207];
  277. ITEM SWTHVAL I(0,0,60) = [1,15(0),
  278. 2,3,3(0),42,0,7(28),31,0,
  279. 32,6,7,8,11,12,15,16,19,2(29),24,
  280. 2(29),31,0,
  281. 33,9,10,0,30,2(0),7(30),31,0,
  282. 34,13,14,13(30),
  283. 39,40,41,4(0),7(30),2(0),
  284. 35,17,18,4(0),7(29),31,0,
  285. 36,4,5,2(0),43,0,8(30),0,
  286. 36,4,5,2(0),43,0,3(29),21,4(29),0,
  287. 37,22,23,4(0),8(29),0,
  288. 36,4,5,2(0),43,0,5(29),25,2(29),0,
  289. 38,26,27,2(0),43,0,8(29),0,
  290. 36,4,5,2(0),43,0,2(29),20,5(29),0];
  291. STATUS SCHAR COLN,COMA,SLSH,ASK, # MUST CORRESPOND TO THE STATUS #
  292. DSGN,MINUS,PLUS,D, # ENTRIES IN THE STATE TRANSIT- #
  293. Y,E,S,N,O,LETTER, # ION TABLE. #
  294. DIGIT,SPC; # #
  295. ARRAY STATUSLIST[72]; #CONTAINS THE LEXICAL STATUS OF #
  296. ITEM STATLIST S:SCHAR (0,0,60) # CORRESPONDING ENTRY IN THE #
  297. = [72(S"COMA")]; # SYNCHARS ARRAY. #
  298. ARRAY DREQ[41] S(1); # DRIVER REQUESTS AND THEIR #003860
  299. BEGIN # OPERAND VALUES. #
  300. ITEM SYNR C(,,10) = ["SUBS",,"KEY",,"NAME",,"LIT",,"NUM",,
  301. "INT",,"FLT",,"FIX",,"SNW",,"SNC",,
  302. "FNAME",,"SNS",,"EOS",, 003880
  303. "SPREC",,"DPREC",,"CHARLIT",,"CHRMSK",,
  304. "OCTAL",,"CMPLX",,"EOT",,"EOF"];
  305. ITEM REQSTRUCTION I(1,0,60) = [ 3 ,,# +SUBS #
  306. 100 ,,# +KEY #
  307. 101 ,,# +NAME #
  308. 102 ,,# +LIT #
  309. 105 ,,# +NUM #
  310. 107 ,,# +INT #
  311. 110 ,,# +FLT #
  312. 108 ,,# +FIX #
  313. 13 ,,# +SNW #
  314. 14 ,,# +SNC #
  315. 99 ,,# +FNAME # 003900
  316. 15 ,,# +SNS # 003910
  317. 10 ,,# +EOS # 003920
  318. 111 ,,# +SPREC #
  319. 112 ,,# +DPREC #
  320. 103 ,,# +CHARLIT #
  321. 104 ,,# +CHRMSK #
  322. 106 ,,# +OCTAL #
  323. 109 ,,# +CMPLX #
  324. 12 ,,# +EOT #
  325. 11 # +EOF #];
  326. END
  327. ARRAY USTATE [7];
  328. ITEM US C(0,0,10) = [" ******** ","UNRECOGNIZ","ABLE STATE",
  329. "MENT------",,,,];
  330. ARRAY UKEY[7];
  331. ITEM UK C(0,0,10) = [" ******** ","UNDEFINED ","KEYWORD IG",
  332. "NORED --- ",,,,];
  333. ARRAY UACT[7];
  334. ITEM UA C(0,0,10) = [" ******** ","UNRECOGNIZ","ABLE ACTIO",
  335. "N IGNORED-",,,,];
  336. ARRAY NOSYNSECT[6];
  337. ITEM NOSYNS C(,,10) = [" ******** ","PRECEDING ","KEYWORD HA",
  338. "S NO CORRE","SPONDING S","YNTAX SECT",
  339. "ION "];
  340. BASED ARRAY SERR [0];
  341. ITEM SYNERROR C(0,0,10);
  342. ARRAY HEADERLINE[0] S(13);
  343. BEGIN
  344. ITEM HDREJECT C(0,0,10) = ["1 "];
  345. ITEM HDRPROC C(1,0,10);
  346. ITEM HDRPROC1 C(2,0,10) = [" "];
  347. ITEM HDRTITLE C(3,0,40);
  348. ITEM HDRSYNGEN C(7,0,20) = ["SYNGEN "];
  349. ITEM HDRDATE1 C(9,0,10);
  350. ITEM HDRTIME1 C(10,0,10);
  351. ITEM HDRPAGE C(11,0,10) = [" PAGE "];
  352. ITEM HDRPAGENO C(12,0,5);
  353. END
  354. ITEM # #
  355. BP = 0, # CONTAINS THE BIT POSITION OF #
  356. # CURRENT CHARACTER. #
  357. WRDPTR, # POINTER TO THE WORD THAT CONT-#
  358. # AINS THE CURRENT CHARACTER. #
  359. CHRPTR = 73, # INDEX INTO THE SYNCHARS AND #
  360. # STATUSLIST ARRAYS. #
  361. LASTCHAR = 72, # PTR TO THE ENTRY IN SYNCHARS #
  362. # CONTAINING THE LAST SOURCE #
  363. # CHAR IN AN INPUT RECORD. #
  364. CHARIND , # CONTAINS CHARACTER OR NUMERIC #
  365. # INDICATOR. #
  366. STATE = 0; # CONTAINS SUBSCRIPT INTO THE #
  367. # STATE TRANSITION TABLE. #
  368. STATUS SFLAG INSERT, EXTRACT;#STATUS LIST FOR INS$EXT. #
  369. ITEM
  370. COUNTER = 0, #SCRATCH VARIABLE USED IN COUNTING. #
  371. CTEMP C(10), #SCRATCH STORAGE - CHARACTERS. #
  372. CURNTLABLPTR, #PTR TO ENTRY IN SYMBOL TABLE FOR LABEL #
  373. #OF SYNTBLE SECTION CURRENTLY BEING BILT#
  374. CURNTSUBLABL C(2), #DISPLAY-CODED NAME OF CURRENT SUBSEC- #
  375. #TION BEING BUILT. . #
  376. FIRSTSUBLABL, #FLAG INDICATING WHETHER FIRST SUBLABEL #
  377. #IN THE SECTION HAS BEEN FOUND. #
  378. DISPLAYINSTR C(7), #DISPLAY-CODED INSTRUCTION (\ 7 CHARS.) #
  379. ERRORCOUNT = 0, #TALLY OF ERRORS IN CURRENT COMPILATION.#
  380. ERRORFLAG, #FLAG FOR ERROR OCCURRENCE, 0=NO ERROR. #
  381. I, #TEMPORARY SCRATCH VARIABLE. #
  382. INS$EXT S:SFLAG = #FLAG FOR SYNHASH ROUTINE INDICATING #
  383. S"INSERT",#WHETHER A SYMBOL IS TO BE INSERTED OR #
  384. #EXTRACTED FROM THE SYMBOL TABLE. #
  385. J, #TEMPORARY SCRATCH VARIABLE. #
  386. K,L,M,N,ITEMP, #SCRATCH VARIABLES. #
  387. P, # INDEX FOR SYNTBLR AND W #
  388. LABELCOUNTER = 0, #INDEX INTO THE LABELPTRS ARRAY TO THE #
  389. #LAST SYMBOL WHICH HAS BEEN DEFINED. #
  390. LASTAVAIL, #PTR TO LAST UNALLOCATED WORD IN JOB"S #
  391. #FIELDLENGTH. #
  392. LASTRANSFER, #PTR TO LAST PREVIOUS TRANSFER POINT IN #
  393. #THE SYNTBLE. #
  394. RTEMP R, #SCRATCH STORAGE - REAL VALUES. #
  395. SECTIONWORD = 0, #NR OF CURRENT WORD OF SYNTBLE INSTRUC- #
  396. #TIONS RELATIVE TO 1ST WORD OF LABELLED #
  397. #SECTION. #
  398. SUBLABEL, #BINARY VALUE OF SUBLABEL INTEGER. #
  399. SYMBOLTYPE = O"23", #TYPE OF SYMBOL IN "NAME". (PRESET FOR #
  400. #SUBRBUILD ROUTINE). #
  401. SYMBOLLENGTH = 2, #LENGTH OF SYMBOL IN "NAME" IN WORDS. #
  402. #(PRESET FOR SUBRBUILD ROUTINE). #
  403. SYMBOLVALUE, #VALUE OF SYMBOL IN "NAME". #
  404. SYNSTRUCTION, #ENCODED SYNTBLE INSTRUCTION. #
  405. SYNTBLEPARCL = 0, #NR OF NEXT PARCEL TO BE BUILT. #
  406. SYNTBLEWORD, #TALLY OF WORDS IN THE SYNTBLE FILE. #
  407. TRACESKEL C(10) = #SKELETON FOR AN ENTRY IN THE PRESET #
  408. """ "",", #TRACEM ARRAY. #
  409. UNDEFSYMBOLS = 0; #TALLY OF UNDEFINED SYMBOLS IN SYMBOL #
  410. #TABLE. #
  411. ITEM OLDFL;
  412. ITEM OLDLA;
  413. ITEM OLD65;
  414. ITEM PTC B;
  415. ITEM FL I=0; # MAX FL FOR RUN. DISPLAYED AT END. #
  416. ITEM ERRORS I=0; # TOTAL ERRORS FOR RUN. DISPLAYED AT END#
  417. ITEM WORD1 = 0; #STARTING WORD IN SOURCE FOR KEYWORDS #
  418. #AND SUBROUTINE NAMES - EITHER CARD COL #
  419. #1 OR 11. #
  420. ITEM SYNORL1; #NO OF CHAR FOR PRINTER TO PRINT #
  421. ITEM LINENO; #LINE NUMBER OF LINE JUST PRINTED #
  422. ITEM PAGENO; #PAGE NUMBER OF LINE JUST PRINTED #
  423. ITEM SORTFL; #FL AVAILABLE FOR SORTING #
  424. DEF LINELIMIT #55#; #NO OF LINES PER PAGE #
  425. DEF INFILE #B<0,60>INWORD[0]#;#LFN OF SYNGEN"S INPUT. DEFAULT IS #
  426. #THE SYSTEM INPUT FILE. #
  427. DEF OUTFILE #B<0,60>INWORD[1]#;#LFN OF THE OUTPUT FILE FOR THE #
  428. #ARRAY PRESETS BUILT BY SYNGEN. DEFAULT #
  429. #IS "COMPILE". #
  430. DEF LSTFILE #B<0,60>INWORD[2]#; # LFN FOR THE LISTINGS OF INPUT#
  431. # CROSS REFERENCES,ETC. DEFAULT IS #
  432. # OUTPUT. #
  433. DEF LXREFWSA #LXREFWS#; #WSA FOR WRITING ON LXREF FILE. #
  434. DEF DXREFWSA #DXREFWS#; #WSA FOR WRITING ON DXREF FILE. #
  435. DEF SXREFWSA #SXREFWS#; #WSA FOR WRITING ON SXREF FILE. #
  436. CONTROL EJECT;
  437. PROC GETCHAR;
  438. #**********************************************************************#
  439. # #
  440. # GETCHAR #
  441. # #
  442. #**********************************************************************#
  443. # GETS THE NEXT CHARACTER FROM -SYNIWSA-. THE CHARACTER IS SCREENED FOR#
  444. # ITS TYPE AND -TYPE- IS SET TO THE APPROPRIATE STATUS CONSTANT. THE #
  445. # CHARACTER IS STORED IN -AINCHAR-, WHICH HAS ITEMS OF -INCHARI- AND #
  446. # -INCHARC-. ALSO ADVANCES -FC- AND -FW- AS NECESSARY TO INDICATE WHICH#
  447. # CHARACTER HAS BEEN SELECTED FROM -SYNIWSA-. #
  448. #**********************************************************************#
  449. BEGIN
  450. IF FC LS 9 THEN # STILL MORE CHARS IN THIS WORD #
  451. FC = FC + 1; # WE USE THE NEXT CHARACTER #
  452. ELSE
  453. BEGIN # START WITH THE NEXT WORD #
  454. FC = 0; # FIRST CHAR POSITION IN NEW WORD #
  455. FW = FW + 1; # NEXT WORD #
  456. END
  457. INCHARI[0] = B<FC*6, 6>INWORD[FW]; # AVOID THE CHARACTER BEAD #
  458. I = INCHARI[0]; # TEMPORARY STORAGE OF CHARACTER #
  459. TYPE = CHARTYPE"DELIMITER"; # ASSUME CHARACTER TYPE IS DELIMITER#
  460. IF I EQ O"53" THEN # CHARACTER IS A $ #
  461. TYPE = CHARTYPE"ALPHABETIC"; # $ IS A LEGAL CHARACTER #
  462. ELSE
  463. IF I LQ O"44" THEN # NINE OR UNDER #
  464. IF I GQ O"33" THEN # IN ZERO TO NINE RANGE #
  465. TYPE = CHARTYPE"NUMERIC";
  466. ELSE
  467. IF I EQ 0 THEN # -A- IS LOWEST LEGAL CHAR #
  468. TYPE = CHARTYPE"DELIMITER";
  469. ELSE # IN NORMAL A-Z RANGE #
  470. TYPE = CHARTYPE"ALPHABETIC";
  471. RETURN;
  472. END
  473. CONTROL EJECT;
  474. PROC CHKERRCNT;
  475. #**********************************************************************#
  476. # #
  477. # CHKERRCNT #
  478. # #
  479. #ROUTINE THAT UPDATES THE ERROR COUNT AND ABORTS THE COMPILATION IF #
  480. #THE ERROR COUNT EXCEEDES THE LIMIT OF 100 ERRORS. #
  481. # #
  482. BEGIN
  483. DEF ERRLIMIT #100#; # ERROR LIMIT #
  484. ERRORCOUNT = ERRORCOUNT + 1; # UPDATE ERROR COUNT #
  485. IF ERRORCOUNT GQ ERRLIMIT THEN
  486. SYNABT(3); # ERROR LIMIT EXCEEDED, ABORT #
  487. # COMPILATION. #
  488. RETURN;
  489. END
  490. CONTROL EJECT;
  491. XDEF PROC CHKSKIP;
  492. PROC CHKSKIP;
  493. #**********************************************************************#
  494. # #
  495. # CHKSKIP #
  496. # #
  497. #ROUTINE WHICH CONSTRUCTS AND MAINTAINS A TABLE OF DEFINED NAMES AND #
  498. #VALUES. IT PERFORMS INSERTS, VALUE ASSIGNMENTS, AND CHECKS VALUES #
  499. #DEPENDING ON ITS DIRECTIVES..... IFEQ, DEF, ENDIF. #
  500. #ALSO HANDLES A DIRECTIVE TO FORCE A NEW PAGE ON THE LISTING.... EJECT #
  501. # #
  502. #ALL DIRECTIVES MUST START IN THE VERY FIRST CHARACTER POSITION OF THE #
  503. #INPUT RECORD, AND MUST HAVE A SPACE FOLLOWING THE DIRECTIVE VERB. #
  504. #THE FOLLOWING SYNTAX DESCRIPTION APPLIES TO *EJECT* AND ALL NEW #
  505. #COMPILER DIRECTIVES. EVENTUALLY, IT SHOULD BE THE STANDARD... #
  506. #ALL COMPILER DIRECTIVES MUST BE IMMEDIATELY PRECEDED BY, AND FOLLOWED #
  507. #BY A SYMPL COMMENT DELIMITER. IN THIS WAY, UNRECOGNIZED COMMANDS CAN #
  508. #CAN BE TREATED AS COMMENTS. THE STARTING DELIMITER MUST APPEAR IN THE #
  509. #FIRST CHARACTER POSITION OF THE INPUT RECORD, WITH THE COMMAND VERB #
  510. #STARTING IN THE SECOND CHARACTER POSITION. #
  511. # #
  512. #ENTRY CONDITIONS: #
  513. # A NEW RECORD IN SYNIWSA #
  514. # #
  515. #EXTERNAL REFERENCES: #
  516. # SYNIWSA - INPUT WORKING STORAGE AREA #
  517. # SKIPFLG - FLAG FOR CONDITIONAL SKIPPING #
  518. # DIRFLAG - FLAG FOR COND. SKIP. DIRECTIVE ON INPUT #
  519. # SKIPCNT - INCREMENTED FOR AN IFEQ, DECREMENTED FOR AN ENDIF #
  520. # #
  521. #EXIT CONDITIONS: #
  522. # #
  523. # FLAGS, DIRFLAG AND SKIPFLG, WILL BE SET BY CHKSKIP TO INDICATE #
  524. # WHETHER OR NOT THE INPUT LINE IS TO BE PROCESSED BY THE COMPILER. #
  525. # SYNREAD PERFORMS SPECIAL PROCESSING FOR THE FLAG VALUES: #
  526. # #
  527. # DIRFLAG = 1, THE INPUT LINE WAS A COMPILER DIRECTIVE, AND IS #
  528. # NOT TO BE PROCESSED BY THE COMPILER. THE VALUE #
  529. # OF SKIPFLG IS IRRELEVANT. #
  530. # #
  531. # DIRFLAG = 0, THE INPUT LINE WAS NOT A COMPILER DIRECTIVE, AND #
  532. # THE VALUE OF SKIPFLG CONTROLS WHETHER OR NOT THE #
  533. # LINE WILL BE PROCESSED BY THE COMPILER. #
  534. # #
  535. # SKIPFLG = 0, THE INPUT LINE IS NOT UNDER THE CONTROL OF #
  536. # CONDITIONAL COMPILATION DIRECTIVES, AND SHOULD #
  537. # BE PROCESSED BY THE COMPILER. #
  538. # #
  539. # SKIPFLG = 1, THE INPUT LINE IS BEING SKIPPED BY CONDITIONAL #
  540. # COMPILATION DIRECTIVES, AND SHOULD NOT BE #
  541. # PROCESSED BY THE COMPILER. #
  542. # #
  543. # SKIPFLG = -1, THE INPUT LINE IS BEING INCLUDED BY CONDITIONAL #
  544. # COMPILATION DIRECTIVES, AND SHOULD BE PROCESSED #
  545. # BY THE COMPILER. #
  546. # #
  547. # #
  548. #ERROR CONDITIONS: #
  549. # NONE #
  550. # #
  551. BEGIN
  552. ITEM DIGIT B; # ITEM SAYS FIRST CHAR IS DIGIT #
  553. ITEM DIRCODE; # CODE USED TO REMEMBER WHAT DIRECT #
  554. # IVE IS BEING PROCESSED #
  555. # 1=DEF, 2=IFEQ, 3=ENDIF #
  556. ITEM TC; # TO CHAR IN -CONDNAME- #
  557. ITEM TW; # TO WORD IN -ACOND- #
  558. ARRAY ACOND [0:1] S(2) ; # ARRAY OF SCRATCH CONDITIONAL STUFF#
  559. BEGIN
  560. ITEM CONDNAME C(00,00,10); # NAME OF THESKIPITEM #
  561. ITEM CONDENTRY I(01,24,18); # ENTRY NUM. INTO SKIPTBL FOR #
  562. # THIS NAME #
  563. ITEM CONDVALUE I(01,42,18); # VALUE OF THIS NAME/NUMBER #
  564. END
  565. ARRAY SKIPTBL [1:25] S(2); # HOLDS THE TABLE OF SKIP ITEMS #
  566. BEGIN
  567. ITEM SKIPNAME C(00,00,10); # NAME OF THE ITEM #
  568. ITEM SKIPVALUE I(01,42,18); # VALUE OF THE ITEM #
  569. END
  570. FW = 0; # FROM-WORD IS FIRST WORD #
  571. DIRFLAG = 1; # ASSUME IT IS A DIRECTIVE #
  572. IF C<0,7>INWORD[0] EQ "#EJECT#"
  573. THEN
  574. BEGIN
  575. SCALL PRNTHDR;
  576. RETURN;
  577. END
  578.  
  579. SCALL CHKLINO; # INCREMENT LINENO OR PAGENO #
  580. IF C<0,4>INWORD[0] EQ "DEF " THEN
  581. BEGIN
  582. FC = 3; # LAST CHAR POS CHECKED HERE #
  583. DIRCODE = 1; # CODE FOR DEF #
  584. END
  585. ELSE
  586. IF C<0,5>INWORD[0] EQ "IFEQ " THEN
  587. BEGIN
  588. FC = 4; # LAST CHAR POS CHECKED HERE #
  589. DIRCODE = 2; # CODE FOR IFEQ #
  590. END
  591. ELSE
  592. IF C<0,6>INWORD[0] EQ "ENDIF " THEN
  593. BEGIN
  594. DIRCODE = 3; # CODE FOR -ENDIF- #
  595. SKIPFLG = 0; # TERMINATE SKIPPING #
  596. RETURN;
  597. END
  598. ELSE
  599. BEGIN
  600. DIRFLAG = 0; # NOT A DIRECTIVE #
  601. RETURN;
  602. END
  603. FOR TW = 0 STEP 1 UNTIL 1 DO # FOR EACH OF THE TO-WORDS #
  604. BEGIN
  605. CONDNAME[TW] = " "; # INITIALIZE NAME TO BLANKS #
  606. CONDVALUE[TW] = 0; # INITIALIZE VALUE TO ZERO #
  607. CONDENTRY[TW] = 0; # NULL ENTRY POS IN -SKIPTBL- IS 0 #
  608. DIGIT = FALSE; # START WITH ASSUMPTION OF NOT DIGIT#
  609. FOR TC = 0 STEP 1 UNTIL 9 DO # FOR EACH POSSIBLE CHAR POS #
  610. BEGIN
  611. SCALL GETCHAR; # MOVE NEXT CHAR TO -AINCHAR- #
  612. IF TYPE EQ CHARTYPE"DELIMITER" THEN
  613. TEST TW; # MARKS THE END OF THIS TOKEN #
  614. IF TYPE EQ CHARTYPE"NUMERIC" AND TC EQ 0 THEN
  615. DIGIT = TRUE; # FIRST CHAR NUMERIC...INT LITERAL #
  616. IF DIGIT THEN # IF AN INTEGER LITERAL #
  617. IF TYPE EQ CHARTYPE"NUMERIC" THEN # ADD IN NUMBER VALUE #
  618. CONDVALUE[TW] = CONDVALUE[TW] * 10 + INCHARI[0] - O"33";
  619. ELSE #ONLY NUMERIC ALLOWED IN INT LITERAL#
  620. BEGIN
  621. TC = 10; # TO FORCE OUT OF -TC- LOOP #
  622. TEST TC; # WHERE WE SKIP TO NEXT DELIMITER #
  623. END
  624. ELSE
  625. C<TC,1>CONDNAME[TW] = INCHARC[0];
  626. END
  627. FOR TYPE = TYPE WHILE TYPE NQ CHARTYPE"DELIMITER" DO
  628. SCALL GETCHAR; # SKIP TO NEXT DELIMITER #
  629. END
  630. FOR I = 0 STEP 1 UNTIL 1 DO # FOR EACH OF THE SCRATCH ENTRIE#
  631. IF CONDNAME[I] NQ " " THEN # HAVE AN ITEM NAME...FIND IT #
  632. BEGIN
  633. FOR J = 1 STEP 1 UNTIL TOPENTRY DO # FOR EACH SKIP ITEM #
  634. IF SKIPNAME[J] EQ CONDNAME[I] THEN
  635. BEGIN
  636. CONDVALUE[I] = SKIPVALUE[J]; # SCRATCH ITEM GETS VALUE #
  637. CONDENTRY[I] = J; # ALSO ENTRY POSITION #
  638. TEST I; # FOUND THIS ONE, GO BACK FOR MORE #
  639. END
  640. TOPENTRY = TOPENTRY + 1; # NOT FOUND IN TABLE..ALLOCATE ENTRY#
  641. SKIPNAME[TOPENTRY] = CONDNAME[I]; # NAME THE ENTRY #
  642. SKIPVALUE[TOPENTRY] = 0; # GIVE IT A NULL VALUE #
  643. CONDVALUE[I] = 0; # GIVE THE SCRATCH ITEM NULL ALSO #
  644. CONDENTRY[I] = TOPENTRY; # ITS ENTRY POS IS THE TOP #
  645. END
  646. IF DIRCODE EQ 1 THEN # IF A -DEF- DIRECTIVE #
  647. BEGIN
  648. SKIPVALUE[CONDENTRY[0]] = CONDVALUE[1]; # IT RECEIVES VALUE #
  649. RETURN; # -DEF- ALL DONE. #
  650. END
  651. IF DIRCODE EQ 2 THEN # IT IS AN -IFEQ- DIRECTIVE #
  652. BEGIN
  653. IF CONDVALUE[0] NQ CONDVALUE[1] THEN SKIPFLG = 1; # SKIPPING #
  654. ELSE SKIPFLG = -1; # SIGNIFIES A GOOD COMPARE #
  655. RETURN; # -IFEQ- ALL DONE #
  656. END
  657. END
  658. CONTROL EJECT;
  659. PROC CHKLINO;
  660. #**********************************************************************#
  661. # #
  662. # CHKLINO #
  663. # #
  664. #ROUTINE WHICH ADDS 1 TO LINE NO AND COMPARES LINE NO TO LINE LIMIT. #
  665. #IF LINENO = LINELIMIT CALLS PRNTHDR TO PRINT HEADER AND RESET LINE NO #
  666. # #
  667. #ENTRY CONDITIONS #
  668. # LINENO AND PAGENO EQUAL LINE NUMBER AND PAGE NUMBER OF LAST LINE #
  669. # ANOTHER LINE IS ABOUT TO BE PRINTED #
  670. # #
  671. #EXIT CONDITIONS #
  672. # LINENO AND PAGENO = LINE AND PAGE NUMBER OF LINE ABOUT TO BE PRINTED#
  673. # USES SYNORL, CTEMP, ITEMP #
  674. # #
  675. BEGIN
  676. IF LINENO LS LINELIMIT THEN
  677. BEGIN
  678. LINENO = LINENO + 1; #INCREMENT LINE NO. IF ROOM ON PAGE #
  679. END
  680. ELSE
  681. BEGIN
  682. SCALL PRNTHDR; #PRINT HDR, RESET PAGENO, LINENO #
  683. END
  684. RETURN;
  685. END
  686. CONTROL EJECT;
  687. PROC PRNTHDR;
  688. #**********************************************************************#
  689. # #
  690. # PRNTHDR #
  691. # #
  692. #ROUTINE TO RESET LINENO AND PAGENO TO FIRST LINE ON NEXT PAGE AND #
  693. #PRINT HEADER AT TOP OF PAGE #
  694. # #
  695. #ENTRY CONDITIONS #
  696. # PAGENO = PAGE NUMBER OF LAST LINE ON OUTPUT FILE #
  697. # HEADER IN ARRAY HEADERLINE #
  698. # #
  699. #EXIT CONDITIONS #
  700. # HEADER PRINTED AT TOP OF NEXT PAGE #
  701. # LINENO AND PAGENO SET TO FIRST LINE ON NEXT PAGE #
  702. # USES SYNORL, CTEMP, ITEMP #
  703. # #
  704. #EXTERNAL REFERENCES #
  705. # SYNPRNT OUTPUT HEADER LINE AND TRIPLE SPACE LINE #
  706. # #
  707. BEGIN
  708. LINENO = 0; #RESET LINE NO #
  709. PAGENO = PAGENO + 1; #INCREMENT PAGE NO BY 1 #
  710. IF LFLAG NQ 0 THEN #IF LISTING BEING WRITTEN, NOT L=0 #
  711. BEGIN
  712. ITEMP = PAGENO; #INPUT PARAMETER TO BINTODISPDEC #
  713. SCALL BINTODISPDEC; #CONVERT PAGENO TO DISPLAY CODE DEC #
  714. HDRPAGENO[0] = CTEMP; #TRANSFER OUTPUT FROM BINTODISPDEC #
  715. SYNORL = 125;
  716. SYNPRNT(HEADERLINE); #PRINT HEADER LINE #
  717. SYNORL = 8;
  718. SYNPRNT("- "); #PRINT TRIPLE SPACE #
  719. END
  720. RETURN;
  721. END
  722. CONTROL EJECT;
  723. #**********************************************************************#
  724. # #
  725. # S Y N G E N #
  726. # #
  727. #THE SYSTEMS COMMUNICATION AREA MUST BE EXAMINED FOR PARAMETERS IN THE #
  728. #SYNGEN CONTROL CARD CALL. POSSIBILITIES ARE: #
  729. #SYNGEN CONTROL STATEMENT. NOTE - ONLY THE FIRST CHARACTER OF EACH #
  730. #PARAMETER IS USED TO CHECK AGAINST THE OPTION LIST. PARAMETER VALUES #
  731. #FOR FILENAMES ARE ACCEPTED UP TO SEVEN CHARACTERS LONG. THE #
  732. #POSSIBLE OPTIONS ARE: #
  733. # #
  734. # ABORT - OPTION TO CAUSE SYNGEN TO ABORT AFTER ALL COMPILATIONS IF #
  735. # ANY SOURCE ERRORS OCCURED. IF OMITTED, SYNGEN WILL JUST #
  736. # TERMINATE NORMALLY IF ERRORS HAVE OCCURRED. #
  737. # L=LFN - LFN OF THE FILE SYNGEN WILL WRITE A LISTING OF INPUT PLUS #
  738. # CROSS-REFERENCE AND DIAGNOSTICS REFERENCES. ALSO DIAGNOSTICS #
  739. # OF BAD INPUT. L=0 SUPPRESSES ALL OUTPUT EXCEPT DIAGNOSTICS. #
  740. # DEFAULT LFN IS OUTPUT #
  741. # I=LFN - LFN OF THE FILE SYNGEN IS TO USE AS IT"S INPUT FILE. THE #
  742. # THE DEFAULT NAME IS INPUT (SYSTEM INPUT FILE). #
  743. # O=LFN - LFN OF THE FILE SYNGEN IS TO USE FOR THE PRESET ARRAYS (THE #
  744. # DRIVING TABLES FOR SYNTAX ANALYZERS) WHICH IT BUILDS. #
  745. # DEFAULT NAME IS COMPILE. #
  746. # NOREWIND - FLAG INDICATING THE REQUEST FOR NOT REWINDING ALL FILES AT#
  747. # END OF SYNGEN EXECUTION. THE DEFAULT CASE IS REWINDING ALL #
  748. # FILES USED BY SYNGEN. #
  749. # T=1 - TRACEM TABLE IS BUILT. THE DEFAULT IS NO TRACE TABLE #
  750. # WHICH CORRESPONDS TO THE SYNTBLE, IS BUILT AND WRITTEN ON THE#
  751. # FILE WHICH IS TO CONTAIN ALL THE OTHER PRESET ARRAYS. #
  752. # CARDCOL=11 - SPECIFIES THAT THE KEYWORDS AND SUBROUTINE NAMES WILL BE#
  753. # OFFSET 10 COLUMNS TO THE RIGHT. #
  754. # #
  755. # OBSOLETE OPTIONS: #
  756. # #
  757. # P=PROC - NAME OF THE PROC TO BE COMPILED BY SYNGEN. THIS WILL BE THE #
  758. # NAME USED IN THE SYMPL SOURCE. THE USE OF THIS OPTION IS #
  759. # DISCOURAGED. THE PROC NAME SHOULD INSTEAD BE GIVEN ON THE #
  760. # FIRST SOURCE LINE GIVEN TO SYNGEN. THIS LINE SHOULD CONTAIN #
  761. # *PROC XXXXXXX* (FOR EXAMPLE) WITH THE *P* IN COLUMN 1. #
  762. # MULTIPLE PROCS CAN BE COMPILED BY ENDING EACH PROC WITH #
  763. # *TERM* IN COLUMN 1, THEREAFTER FOLLOWED BY THE NEXT #
  764. # *PROC XXXXXXX* IN COLUMN 1. #
  765. # #
  766. # #
  767. # ERRORS DIAGNOSED: ERRORS IN THE SYNGEN CONTROL CARD CAUSE A DAYFILE #
  768. # DIAGNOSTIC MESSAGE AND THE JOB IS ABORTED. #
  769.  
  770. BEGIN
  771. LFLAG = 1; #INITIALIZE CONTROL CARD OPTIONS TO THE #
  772. INFILE = O"11162025240000000000";#DEFAULT VALUES. #
  773. OUTFILE = O"03171520111405000000";
  774. LSTFILE = O"17252420252400000000";
  775. TFLAG = 0;
  776. REWIND = 1;
  777. ERRORFLAG = 0;
  778. P<RA> = 2;
  779. J = NRCCPARAMS[50] - 1; #PICK NR OF PARAMS FOR INDEXING. #
  780. FOR I=0 STEP 2 UNTIL J DO
  781. BEGIN
  782. CTEMP = CCPARAM[I]; #ISOLATE 1ST CHAR IN CONTROL CARD PARAM.#
  783. IF CTEMP EQ "A" THEN # IF ABORT OPTION SPECIFIED BY USER #
  784. BEGIN
  785. ABTFLAG = TRUE; # ABORT-ON-ERRORS REQUESTED #
  786. I = I - 1; # THIS PARAM TAKES UP ONLY ONE WORD #
  787. TEST I;
  788. END
  789. IF CTEMP EQ "L" THEN #LISTING OPTION MAY BE SPECIFIED BY USER#
  790. BEGIN
  791. IF CCPARAM[I+1] NQ "0" THEN
  792. B<0,42>INWORD[2] = CCFILENAME[I+1];
  793. ELSE LFLAG = 0;
  794. TEST I;
  795. END
  796. IF CTEMP EQ "T" THEN #TRACE OPTION SPECIFIED BY USER MAY ONLY#
  797. BEGIN #BE FOLLOWED BY A ZERO, TURNING OFF THE #
  798. IF CCPARAM[I+1] NQ "0" THEN #OPTION AND FLAG. #
  799. TFLAG = 1;
  800. ELSE TFLAG = 0;
  801. TEST I;
  802. END
  803. IF CTEMP EQ "I" THEN #INPUT FILE OPTION IS EXERCISED BY THE #
  804. BEGIN #USER. #
  805. B<0,42>INWORD[0] = CCFILENAME[I+1];
  806. TEST I;
  807. END
  808. IF CTEMP EQ "O" THEN #OUTPUT FILE OPTION IS EXERCISED BY #
  809. BEGIN #THE USER. #
  810. B<0,42>INWORD[1] = CCFILENAME[I+1];
  811. TEST I;
  812. END
  813. IF CTEMP EQ "N" THEN #NOREWIND OPTION IS EXERCISED BY THE #
  814. BEGIN #USER. #
  815. I = I - 1; #THIS PARAM TAKES UP ONLY ONE WORD. #
  816. REWIND = 0;
  817. TEST I;
  818. END
  819. IF CTEMP EQ "C" THEN #KEYWORDS AND SUBROUTINE NAMES START IN #
  820. BEGIN #A COLUMN OTHER THAN ONE. #
  821. IF B<0,12>CCFILENAME[I+1] EQ O"3434" THEN #ONLY VALID #
  822. WORD1 = 1; #VALUE IS CARDCOL = 11. #
  823. ELSE ERRORFLAG = 1;
  824. TEST I;
  825. END
  826. IF CTEMP EQ "P" THEN #PROC NAMING OPTION EXERCISED. #
  827. BEGIN
  828. PNAME[0] = " PROC ";
  829. PNAME[1] = " ";
  830. K = 42;
  831. L = 0;
  832. FOR M=0 STEP 6 UNTIL 36 DO
  833. BEGIN
  834. ITEMP = B<M,6>CCFILENAME[I+1];
  835. IF ITEMP EQ 0 THEN
  836. GOTO ENDWITHSEMI;
  837. B<K,6>PNAME[L] = ITEMP;
  838. IF K GR 53 THEN
  839. BEGIN
  840. K = 0;
  841. L = 1;
  842. END
  843. ELSE K = K + 6;
  844. END
  845. ENDWITHSEMI:
  846. B<K,6>PNAME[L] = ";";
  847. TEST I;
  848. END
  849. ERRORFLAG = 1; #ERROR IF PARAM NOT ONE OF ABOVE. #
  850. END
  851. IF ERRORFLAG NQ 0 THEN #CONTROL CARD ERRORS CAUSE A JOB #
  852. SYNABT(1); #ABORT. #
  853. SYNOPEN; #SYNOPEN IS A COMPASS ROUTINE WHICH #
  854. #OPENS ALL FILES TO BE USED IN THIS #
  855. #SYNGEN RUN. #
  856. LASTAVAIL = B<0,60>INWORD[0] - 1; #PTR RETURNED BY SYNOPEN. #
  857. IF LASTAVAIL GR O"77777" THEN #HASHEDTABLE ENTRIES HAVE ONLY 15 #
  858. LASTAVAIL = O"77777"; #BITS FOR POINTERS, SO 77777 IS THE MOST#
  859. #CORE USABLE BY THIS VERSION. IF MORE #
  860. #CORE IS NECESSARY, THE SYMBOL TABLE #
  861. #ENTRIES MAY BE ADDRESSED RELATIVE TO #
  862. #THE HIGH END OF FL, RATHER THAN #
  863. #DIRECTLY. #
  864. OLD65 = NEXTAVAIL[51];
  865. OLDLA = LASTAVAIL;
  866. SCALL SYNTIDA; #SET TIME AND DATE INTO HEADER #
  867. HDRDATE1[0] = HDRDATE;
  868. HDRTIME1[0] = HDRTIME;
  869. PROCLOOP:
  870. # THE FOLLOWING IS CODE TO PRESET CM FOR A COMPILE OF A PROGRAM #
  871. NEXTAVAIL[51] = OLD65;
  872. P<SYNTBLE> = NEXTAVAIL[51]; # INITIAL POSITION OF SYNTBLE #
  873. SYNTBLEWORD = 1; # FIRST AVAILABLE WORD ADDRESS IN #
  874. # PSEUDO-WA FILE *SYNTBLE* #
  875. LASTAVAIL = OLDLA;
  876. FOR I = OLD65-2 STEP 1 UNTIL LASTAVAIL-2 DO FULLWORD[I] = 0;
  877. COUNTER = 0;
  878. ERRORCOUNT = 0;
  879. LABELCOUNTER = 0;
  880. SECTIONWORD = 0;
  881. SYMBOLTYPE = O"23";
  882. SYMBOLLENGTH = 2;
  883. SYNTBLEPARCL = 0;
  884. UNDEFSYMBOLS = 0;
  885. KEY1PTR = 0;
  886. KEY2PTR = 0;
  887. KEY3PTR = 0;
  888. BP = 0;
  889. STATE = 0;
  890. FOR I = 0 STEP 1 UNTIL 127 DO HASHENTRY[I] = 0;
  891. FOR I = 0 STEP 1 UNTIL 26 DO LOCWRD[I] = 0;
  892. FIRSTSUBLABL = 0;
  893. SECTIONWORD = 0;
  894. LASTRANSFER = 0;
  895. FIRSTCHAR = 0;
  896. CURRENTLABEL[0] = 0;
  897. CURRENTLABEL[1] = 0;
  898. CURRENTLABEL[2] = 0;
  899. INS$EXT = S"INSERT";
  900. P<SYMBOLTABLE> = 0;
  901. CHRPTR = 73;
  902. PTC = FALSE;
  903. SYNEOF = 0;
  904. ENDINP; # REWIND THE XREF FILES #
  905. OUTLEN = 60; # SET LENGTH FOR COMPILE RECORDS #
  906. LEXBUILD; #LEXBUILD IS A SYMPL PROC WHICH #
  907. #BUILDS THE LEXICON TABLES. #
  908. ITEMP = (OLDLA - LASTAVAIL) + (P<SYNTBLE> + SYNTBLEWORD);
  909. IF ITEMP GR FL
  910. THEN
  911. BEGIN
  912. FL = ITEMP; # MAINTAIN -FL- AS MAXIMUM FL #
  913. END
  914.  
  915. P<SYNTBLE> = NEXTAVAIL[51]; # POSITION TO END OF LEXICAL TABLES #
  916. IF LFLAG NQ 0 THEN
  917. BEGIN
  918. HDRTITLE[0] = "INPUT SEMANTIC ROUTINES ";
  919. SCALL PRNTHDR; #START NEXT PAGE WITH HEADER #
  920. END
  921. SUBRBUILD; #SUBRBUILD IS A SYMPL PROC WHICH #
  922. #BUILDS A SUBROUTINE NAME TABLE FOR #
  923. #LATER IN BUILDING THE SYNTAX TABLE.#
  924. IF LFLAG NQ 0 THEN
  925. BEGIN
  926. HDRTITLE[0] = "INPUT SYNTAX SPECIFICATIONS ";
  927. SCALL PRNTHDR;
  928. END
  929. P<STATETRANS> = LOC(STATTRNS);#BUG IN SYMPL COMPILER COULD NOT #
  930. #PRESET A 2-D ARRAY, SO HAD TO PRESET A #
  931. #1-D ARRAY AND SET A 2-D BASED ARRAY TO #
  932. #IT FOR USE. #
  933. SYNBUILD; #SYNBUILD IS A SYMPL PROC WHICH #
  934. #CONSTRUCTS THE OUTPUT PRESET ARRAYS#
  935. #SYNTBLE, LBLPTRS, AND TRACEM, AS #
  936. #WELL AS THE CROSS REFERENCE FILES, #
  937. #IF LFLAG IS SET TO ONE. #
  938. SYNCOPY(SYNTBLEWORD); #COMPASS RTN WHICH COPIES SYNTBLE AND #
  939. #TRACEM. #
  940. CONLEXTABLES; #RTN WHICH CONVERTS BINARY LEXICON #
  941. #TABLES TO OUTPUT DISPLAY CODE AND #
  942. #WRITES THEN OUT. #
  943. IF NOT PTC THEN
  944. SYNCOM (" END
  945. ");
  946. ELSE
  947. BEGIN
  948. OUTLEN = 90;
  949. PTCTRANS:
  950. SYNREAD;
  951. IF C<0,3>INWORD[0] EQ "END" OR REALEOF GR 0 THEN GOTO PTCEOF;
  952. SYNCOM(SYNIWSA);
  953. GOTO PTCTRANS;
  954. PTCEOF: # #
  955. END
  956. SYNCOM(" END
  957. ");
  958. SYNCOM(" TERM;
  959. ");
  960. IF LFLAG NQ 0 THEN #IF THE USER REQUESTED A LISTING, #
  961. SYNXREF; #SYNREF IS A SYMPL ROUTINE WHICH #
  962. #SORTS THE CROSS REFERENCE LISTS AND#
  963. #PRINTS THEM. #
  964. ITEMP = (OLDLA - LASTAVAIL) + (P<SYNTBLE> + SYNTBLEWORD);
  965. IF ITEMP GR FL THEN FL = ITEMP; # MAINTAIN -FL- AS MAXIMUM FL #
  966. ERRORS = ERRORS + ERRORCOUNT; # MAINTAIN TOTAL ERRORS #
  967. IF REALEOF EQ 0 THEN GOTO PROCLOOP;
  968. WRAPUP: # #
  969.  
  970. # ROUND THE MAXIMUM FL UP TO THE NEXT 100B WORDS #
  971.  
  972. ITEMP = ((FL + O"100") / O"100") * O"100";
  973. BINTODISPOCT;
  974. ITEMP = ERRORS; # TOTAL ERRORS IN THIS RUN #
  975. BINTODISPDEC;
  976. SYNCLSE(CTEMP,OCTAL[1]); #SYNCLSE IS A COMPASS ROUTINE WHICH #
  977. #WRITES OUT THE PRESET ARRAYS WHICH HAVE#
  978. #BEEN BUILT BY SYNGEN, THEN CLOSES ALL #
  979. #THE FILES USED IN THIS SYNGEN RUN. #
  980. IF ABTFLAG # IF ABORT-ON-ERRORS REQUESTED #
  981. AND (ERRORS NQ 0) # AND ERRORS DID OCCUR #
  982. THEN
  983. BEGIN
  984. SYNABT(5); # SOURCE ERRORS -- ABORT REQUESTED #
  985. END
  986.  
  987. STOP; # NORMAL TERMINATION OF SYNGEN #
  988. END
  989. CONTROL EJECT;
  990. #**********************************************************************#
  991. # #
  992. # SYNALLOCATE #
  993. # #
  994. #**********************************************************************#
  995. #FUNCTION WHICH ALLOCATES SPACE WITHIN THE JOB"S FIELDLENGTH, IN A CON-#
  996. #TIGUOUS FASHION, AND RETURNS A POINTER TO THE FWA OF THE ALLOCATED #
  997. #SPACE. THE LWA OF AVAILABLE SPACE IS OBTAINED FROM RA+54 AND THE FWA #
  998. #OF AVAILABLE SPACE IS OBTAINED FROM RA+53. AS SPACE IS ALLOCATED, RA+ #
  999. #53 OR RA+54 IS UPDATED. A NEGATIVE SIZE REQUEST IS ALLOCATED FROM FL #
  1000. #BACKWARDS WHILE A POSITIVE SIZE REQUEST IS ALLOCATED FROM LWA CURRENT-#
  1001. #LY ALLOCATED FORWARDS TOWARDS FL. #
  1002. # ERRORS DIAGNOSED: REQUESTS THAT EXCEED THE JOB"S FIELDLENGTH RESULT #
  1003. # IN DIAGNOSTIC MESSAGES FOLLOWED BY A HALT. #
  1004. # #
  1005. FUNC SYNALLOCATE(SIZE);
  1006. BEGIN
  1007. ITEM SIZE; #SIZE OF THE SPACE REQUESTED. #
  1008. IF (P<SYNTBLE> + SYNTBLEWORD + ABS(SIZE)) GR LASTAVAIL
  1009. THEN # THEN NOT ENOUGH ROOM FOR -SIZE- #
  1010. BEGIN
  1011. SYNABT(0); # INSUFFICIENT FL MESSAGE AND ABORT #
  1012. END
  1013.  
  1014. IF SIZE LS 0 THEN
  1015. GOTO NEGSIZE;
  1016. NEXTAVAIL[51] = NEXTAVAIL[51] + SIZE;#UPDATE PTR TO NEXT WORD #
  1017. IF NEXTAVAIL[51] GR P<SYNTBLE> THEN # MOVE SYMTBLE OUT OF THE #
  1018. BEGIN # WAY OF THE NEW TABLE #
  1019. P<SORT> = NEXTAVAIL[51];
  1020. FOR I = SYNTBLEWORD STEP -1 UNTIL 0 DO
  1021. SORTWORD[I] = SYNTBLEWD[I];
  1022. P<SYNTBLE> = P<SORT>;
  1023. END
  1024. SYNALLOCATE = NEXTAVAIL[51] - SIZE;#AVAILABLE AND RETURN PTR TO #
  1025. RETURN; #ALLOCATED SPACE. #
  1026. NEGSIZE:
  1027. LASTAVAIL = LASTAVAIL + SIZE;#UPDATE PTR TO END OF AVAILABLE #
  1028. SYNALLOCATE = LASTAVAIL + 1; #SPACE AND RETURN PTR TO THE ALLOCAT#
  1029. RETURN; # ED SPACE. #
  1030. END
  1031. CONTROL EJECT;
  1032. #*********************************************************************#
  1033. # LEXBUILD #
  1034. #*********************************************************************#
  1035. PROC LEXBUILD;
  1036. BEGIN
  1037. HDRPROC[0] = " "; #BLANK FILL PROC NAME #
  1038. HDRPROC1[0] = " ";
  1039. HDRTITLE[0] = "INPUT KEYWORDS ";
  1040. PAGENO = 0; #FORCE SYNREAD TO PRINT HEADER AT PAGE 1#
  1041. LINENO = LINELIMIT; #ON NEXT (NONEOF) READ #
  1042. P<SYN1SCRATCH> = SYNALLOCATE(750); # ALLOCATE SPACE FOR ONE #
  1043. P<SYN2SCRATCH> = SYNALLOCATE(500); #TWO #
  1044. P<SYN3SCRATCH> = SYNALLOCATE(300); #THREE WORD KEYWORDS #
  1045. SYNREAD;
  1046. IF REALEOF GR 0 THEN GOTO WRAPUP;
  1047. IF C<0,4>INWORD[0] NQ "PROC" THEN GOTO READKEYWD1;
  1048. PNAME[0] = " ";
  1049. PNAME[1] = INWORD[0];
  1050. PNAME[2] = INWORD[1];
  1051. PNAME[3] = ";";
  1052. HDRPROC[0] = INWORD[0]; #INSERT PROC **** IN HEADER #
  1053. HDRPROC1[0] = INWORD[1];
  1054. READKEYWRD: # #
  1055. SYNREAD; # READ KEYWORD LIST (80 CHAR). #
  1056. READKEYWD1:
  1057. IF SYNEOF GR 0 THEN #STOP IF EOF ENCOUNTERED. #
  1058. SYNABT(2);
  1059. IF C<0,1>INWORD[WORD1] EQ " " THEN #IF 1ST CHAR IS BLANK THE CARD#
  1060. GOTO READKEYWRD; #IS ASSUMED BLANK AND SKIPPED. #
  1061. IF WORD1 NQ 0 THEN # MOVE WORDS 1,2 TO 0,1 AND IGNORE #
  1062. BEGIN # WORD 0. #
  1063. INWORD[0] = INWORD[1];
  1064. INWORD[1] = INWORD[2];
  1065. INWORD[2] = " ";
  1066. END
  1067. IF INWORD[0] EQ "+" AND #A + MAY BE A KEYWORD OR TERMINATOR.#
  1068. C<6,4>INWORD[3] EQ " " THEN # IF NO LEXID FIELD, ASSUME #
  1069. BEGIN #CARD IS TERMINATOR. #
  1070. IF KEY1PTR EQ KEY2PTR AND #IF NO KEYWORDS READ BEFORE + THEN #
  1071. KEY2PTR EQ KEY3PTR AND #NO LEXICON TO BUILD. #
  1072. KEY3PTR EQ 0 THEN
  1073. RETURN;
  1074. NUMBER1WRD = KEY1PTR - 2; # SET KEYWORD SECTION BOUNDRIES.#
  1075. NUMBER2WRD = KEY2PTR - 3; # #
  1076. NUMBER3WRD = KEY3PTR - 4; # #
  1077. GOTO PASS1; # #
  1078. END
  1079. K = 0; # WORD POINTER IN FOR-LOOP. #
  1080. J = 0; # CHARACTER POINTER IN FOR-LOOP.#
  1081. FOR I=0 STEP 1 UNTIL 29 DO # SCAN THE INPUT WORKING STORAGE#
  1082. BEGIN # AREA FOR A BLANK. THE FIRST #
  1083. IF B<J,6>INWORD[K] EQ O"55" # OCCURENCE OF A BLANK TERMINATE#
  1084. THEN GOTO CHECKLENGTH; # S THE KEYWORD NAME. AT THE #
  1085. # COMPLETION OF THE FOR-LOOP "I"#
  1086. # WILL CONTAIN THE LENGTH OF THE#
  1087. # KEYWORD. #
  1088. IF J EQ 54 THEN # CHECK IF COMPLETE WORD HAS #
  1089. BEGIN # BEEN SCANNED. IF IT HAS THEN #
  1090. J = 0; # SET CHAR PTR (J) TO POINT TO #
  1091. # THE 1ST CHAR OF THE NEXT WORD,#
  1092. K = K + 1; # INCREMENT THE WORD PTR (K) TO #
  1093. END # POINT TO THE NEXT WORD. #
  1094. ELSE # #
  1095. J = J + 6; # INCREMENT J TO POINT TO THE #
  1096. END # NEXT CHARACTER. #
  1097. CHECKLENGTH: # #
  1098. B<J,60-J>INWORD[K] = " ";#BLANK REST OF WORD AS INSUR- #
  1099. # ANCE. #
  1100. IF I LS 11 THEN GOTO ONEKEYWORD; # CHECK FOR A "1" WORD KEYWORD. #
  1101. IF I LS 21 THEN GOTO TWOKEYWORD; # CHECK FOR A "2" WORD KEYWORD. #
  1102. # #
  1103. KEY3WRD[KEY3PTR] = INWORD[0]; # STORE "FIRST" #
  1104. KEY3WRD[KEY3PTR + 1] = INWORD[1];# "SECOND" #
  1105. KEY3WRD[KEY3PTR + 2] = INWORD[2];# "THIRD" WORD OF THE #
  1106. # KEYWORD IN A SCRATCH WORKING #
  1107. # STORAGE AREA. #
  1108. KEY3PTR = KEY3PTR + 4; # INCREMENT KEY3PTR TO POINT TO #
  1109. # WHERE THE NEXT KEYWORD IS TO #
  1110. # BE PLACED. #
  1111. LEXPTR = KEY3PTR - 1; # POINTER TO WORD POSITION WHERE#
  1112. # ID,P1,P2 AND SECT ARE TO BE #
  1113. # PLACED. #
  1114. P<LEXICON> = LOC(SYN3SCRATCH); # ARRAY FOR ACCESSING ID,P,P2 #
  1115. # AND SECT. #
  1116. GOTO MOVELEXICON; # #
  1117. TWOKEYWORD: # #
  1118. KEY2WRD[KEY2PTR] = INWORD[0]; # STORE "FIRST" #
  1119. KEY2WRD[KEY2PTR + 1] = INWORD[1];# "SECOND" WORD OF THE #
  1120. # KEYWORD IN A SCRATCH WORKING #
  1121. # STORAGE AREA. #
  1122. KEY2PTR = KEY2PTR + 3; # INCREMENT KEY2PTR TO POINT TO #
  1123. # WHERE THE NEXT KEYWORD IS TO #
  1124. # BE PLACED. #
  1125. LEXPTR = KEY2PTR - 1; # POINTER TO WORD POSITION WHERE#
  1126. # ID,P1,P2 AND SECT ARE TO BE #
  1127. # PLACED. #
  1128. P<LEXICON> = LOC(SYN2SCRATCH); # ARRAY FOR ACCESSING ID,P,P2 #
  1129. GOTO MOVELEXICON; # AND SECT. #
  1130. ONEKEYWORD: # #
  1131. P<LEXICON> = LOC(SYN1SCRATCH); # #
  1132. LEXWRD[KEY1PTR] = INWORD[0]; # STORE THE KEYWORD IN THE KEY- #
  1133. # WORD ARRAY. #
  1134. KEY1PTR = KEY1PTR + 2; # INCREMENT KEY1PTR TO POINT TO #
  1135. # WHERE THE NEXT KEYWORD IS TO #
  1136. # BE PLACED. #
  1137. LEXPTR = KEY1PTR - 1; # POINTER TO WORD POSITION WHERE#
  1138. # ID=P1,P2 AND SECT ARE TO BE #
  1139. # PLACED. #
  1140. MOVELEXICON: # #
  1141. CTEMP = C<5,5>INWORD[3]; # CONVERT LEXID AND STORE IT. #
  1142. DISPOCTTOBIN;
  1143. LEXID[LEXPTR] = ITEMP;
  1144. CTEMP = C<5,5>INWORD[4]; # CONVERT P1 AND STORE IT. #
  1145. DISPOCTTOBIN;
  1146. LEX1PARAM[LEXPTR] = ITEMP;
  1147. CTEMP = C<5,5>INWORD[5]; # CONVERT P2 AND STORE IT. #
  1148. DISPOCTTOBIN;
  1149. LEX2PARAM[LEXPTR] = ITEMP;
  1150. IF C<0,1>INWORD[3] EQ "*" THEN # CHECK FOR AN * IN COL 31. IF #
  1151. LEXSYNSECT[LEXPTR] = -1; # THERE IS AN * PRESENT, SET #
  1152. ELSE # LEXSYNSECT TO 1. IF THERE IS #
  1153. LEXSYNSECT[LEXPTR] = 0; # NO * SET LEXSYNSECT TO 0. AN #
  1154. # * INDICATES THAT THERE IS A #
  1155. # LABELED SECTION NAME IN THE #
  1156. # SYNTAX STATEMENTS THAT IS IDEN#
  1157. # TICAL TO THIS KEYWORD. #
  1158. GOTO READKEYWRD; # READ NEXT RECORD OF THE KEY- #
  1159. # WORD LIST. #
  1160. PASS1:
  1161. P<LEXICON> = LOC(SYN1SCRATCH); # POINTER TO 1 WRD KEYWRD BUFFER#
  1162. MAXKEYWRDS = NUMBER1WRD; # STORE NUMBER OF 1 WORD KEYWRDS#
  1163. K = 2; # VALUE THAT LEXPTR IS INCREMENT#
  1164. # ED BY. #
  1165. I = 0; # BEGINNING BIT POSITION OF #
  1166. # ENTRIES FIELD IN LEXWORDLOC. #
  1167. J = 6; # BEGINNING BIT POSITION OF #
  1168. # INDEX TO KEYWRD LIST FIELD IN #
  1169. # LEXWORDLOC. #
  1170. TOTALWORDS = 0; # INITIALIZE LEXWORDS WORD CNTR.#
  1171. GOTO INITWRDLOC; # PROCESS KEYWORD. #
  1172. PASS2:
  1173. IF NUMBER2WRD LS 0 THEN # IF NO 2-WORD KEYWORDS, THEN GO#
  1174. GOTO PASS3; # DO 3-WORD KEYWORDS. #
  1175. P<LEXICON> = LOC(SYN2SCRATCH); # POINTER TO 2 WRD KEYWRD BUFFER#
  1176. MAXKEYWRDS = NUMBER2WRD; # STORE NUMBER OF 2 WORD KEYWRDS#
  1177. K = 3; # VALUE THAT LEXPTR IS INCREMENT#
  1178. # ED BY. #
  1179. I = 18; # BEGINNING BIT POSITION OF #
  1180. # ENTRIES FIELD IN LEXWORDLOC. #
  1181. J = 24; # BEGINNING BIT POSITION OF #
  1182. # INDEX TO KEYWRD LIST FIELD IN #
  1183. # LEXWORDLOC. #
  1184. GOTO INITWRDLOC; # PROCESS KEYWORD. #
  1185. PASS3:
  1186. IF NUMBER3WRD LS 0 THEN # IF NO 3-WORD KEYWORDS, THEN GO#
  1187. GOTO COMPACTLEX; # COMPACT THE TABLE. #
  1188. P<LEXICON> = LOC(SYN3SCRATCH); # POINTER TO 3 WRD KEYWRD BUFFER#
  1189. MAXKEYWRDS = NUMBER3WRD; # STORE NUMBER OF 3 WORD KEYWRDS#
  1190. K = 4; # VALUE THAT LEXPTR IS INCREMENT#
  1191. # ED BY. #
  1192. I = 36; # BEGINNING BIT POSITION OF #
  1193. # ENTRIES FIELD IN LEXWORDLOC. #
  1194. J = 42; # BEGINNING BIT POSITION OF #
  1195. # INDEX TO KEYWRD LIST FIELD IN #
  1196. # LEXWORDLOC. #
  1197. INITWRDLOC:
  1198. ENTRIES = 1; # INITIALIZE 1ST CHAR COUNTER. #
  1199. LEXPTR = 0; # INITIALIZE PTR TO KEYWRD LIST.#
  1200. BUILDWRDLOC:
  1201. WRDLOCPTR = B<0,6>LEXWRD[LEXPTR];# SET PTR TO VALUE OF 1ST CHAR #
  1202. IF WRDLOCPTR GQ O"33" OR # CHECK FOR START OF SPECIAL #
  1203. WRDLOCPTR EQ 0 THEN # CHARACTERS. #
  1204. GOTO SPECIALCHARS;
  1205. SKIPBADKEY:
  1206. IF LEXPTR EQ MAXKEYWRDS THEN # CHECK FOR END OF LEXICON SEC- #
  1207. GOTO SETLEXWRDLOC; # TION. #
  1208. KEYFIRSTCHAR = # STORE AND CONVERT THE FIRST #
  1209. B<0,6>LEXWRD[LEXPTR + K]; # CHAR OF THENEXT KEYWORD. #
  1210. IF WRDLOCPTR EQ KEYFIRSTCHAR THEN# CHECK IF KEYWORDS EQUAL EACH #
  1211. # OTHER ON FIRST CHAR ONLY. #
  1212. BEGIN
  1213. ENTRIES = ENTRIES + 1; # INCREMENT FIRST CHAR COUNTER. #
  1214. LEXPTR = LEXPTR + K; # INCREMENT TO NEXT ENTRY. #
  1215. GOTO BUILDWRDLOC; # PROCESS NEXT KEYWORD. #
  1216. END
  1217. IF KEYFIRSTCHAR LS WRDLOCPTR THEN# CHECK FOR SEQUENCE. IF NEXT #
  1218. BEGIN # KEYWORD IS OUT OF SEQUENCE #
  1219. # ISSUE DIAGNOSTIC, AND THEN #
  1220. # PROCECDE WITH BUILDING THE LEX#
  1221. # WORDLOC TABLE. #
  1222. IF KEYFIRSTCHAR EQ 0 THEN # IF 64 CHAR SET THEN 0 (:) IS A#
  1223. GOTO SETLEXWRDLOC; # VALID SPECIAL CHARACTER. #
  1224. SCALL CHKLINO;
  1225. SYNORL = 70;
  1226. FOR M=2 STEP 1 UNTIL K DO
  1227. LSWORD[M+2] = LEXWRD[LEXPTR+K+M-2];
  1228. FOR M=M STEP 1 UNTIL 4 DO
  1229. LSWORD[M+2] = " ";
  1230. SYNPRNT(LEXSEQ);
  1231. CHKERRCNT;
  1232. ENTRIES = ENTRIES + 1; # OUT-OF-ORDER KEYWORDS WILL BE #
  1233. LEXPTR = LEXPTR + K; # HIDDEN IN THE LEXICON SECTION #
  1234. GOTO SKIPBADKEY; # IN WHICH THEY WERE FOUND, AND #
  1235. END # THEY ARE NOT RETRIEVABLE. #
  1236. SETLEXWRDLOC:
  1237. B<J,12>LOCWRD[WRDLOCPTR] = # STORE PTR TO 1ST KEYWORD OF #
  1238. TOTALWORDS; # THIS CHAR SET INTO LEXWRDLOC. #
  1239. B<I,6>LOCWRD[WRDLOCPTR] = ENTRIES;#STORE THE NUMBER OF ENTRIES #
  1240. # IN LEXWORDLOC. #
  1241. TOTALWORDS = TOTALWORDS + ENTRIES * K;#PTR TO START OF NEW CHAR- #
  1242. IF LEXPTR GQ MAXKEYWRDS THEN # IF END OF SECTION, WHICH ONE. #
  1243. BEGIN
  1244. NEXTPASS:
  1245. IF K EQ 2 THEN # GO DO TWO-WORD KEYWORDS. #
  1246. GOTO PASS2;
  1247. IF K EQ 3 THEN # GO DO THREE-WORD KEYWORDS. #
  1248. GOTO PASS3;
  1249. GOTO COMPACTLEX; # GO COMPRESS INTO ONE ARRAY. #
  1250. END
  1251. ENTRIES = 1; # RESET ENTRY COUNTER. #
  1252. LEXPTR = LEXPTR + K; # SET KEYWORD PTR TO NEXT KEYWRD#
  1253. IF KEYFIRSTCHAR GQ O"33" OR # CHECK FOR START OF SPECIAL #
  1254. KEYFIRSTCHAR EQ 0 THEN # CHARACTERS. #
  1255. BEGIN
  1256. SPECIALCHARS:
  1257. B<J,12>LOCWRD[0] = TOTALWORDS;#STORE PTR TO START OF SPECIAL #
  1258. B<I,6>LOCWRD[0] = # CHARS. #
  1259. (MAXKEYWRDS - LEXPTR)/K + 1;#STORE NR ENTRIES FOR SPEC #
  1260. TOTALWORDS = TOTALWORDS + MAXKEYWRDS - LEXPTR + K;#CHARS AND #
  1261. # INCREMENT TOTALWORDS COUNT. #
  1262. GOTO NEXTPASS; # CHECK PASS NUMBER. #
  1263. END
  1264. GOTO BUILDWRDLOC; # FINISH CURRENT LEXICON SECTION#
  1265. COMPACTLEX:
  1266. J = KEY2PTR - 1; # NUMBER OF WORDS IN THE 2-WORD #
  1267. # KEYWORD BUFFER. #
  1268. FOR K=0 STEP 1 UNTIL J DO
  1269. BEGIN
  1270. KEY1WRD[KEY1PTR] = KEY2WRD[K];# MOVE THE 2-WORD KEYWORDS IN- #
  1271. # THE ONE WORD KEYWORD BUFFER. #
  1272. KEY1PTR = KEY1PTR + 1; # INCREMENT PTR TO NEXT WORD. #
  1273. END
  1274. J = KEY3PTR - 1; # NBR OF WORDS IN THE 3-WORD #
  1275. # KEYWORD BUFFER. #
  1276. FOR K=0 STEP 1 UNTIL J DO
  1277. BEGIN
  1278. KEY1WRD[KEY1PTR] = KEY3WRD[K];# MOVE THE 3-WORD KEYWORDS IN- #
  1279. # TO THE 1 WORD KEYWORD BUFFER. #
  1280. KEY1PTR = KEY1PTR +1; # INCREMENT PTR TO NEXT WORD. #
  1281. END
  1282. NEXTAVAIL[51] = LOC(KEY1WRD[KEY1PTR]);#RESET PTR TO LAST USED #
  1283. # WORD + 1 AFTER COMPACTION. #
  1284. P<LEXICON> = LOC(SYN1SCRATCH); # SET TO COMPACTED TABLE. #
  1285. RETURN; # RETURN TO SYNCTRL. #
  1286. END
  1287. CONTROL EJECT;
  1288. #**********************************************************************#
  1289. PROC DISPOCTTOBIN; # CONVERTS DISPLAY-CODED OCTAL #
  1290. BEGIN # (CTEMP) TO BINARY (ITEMP). #
  1291. ITEMP = 0; # INITIALIZE RESULT TO 0. #
  1292. FOR M=0 STEP 6 UNTIL 54 DO # CONVERT UP TO 10 CHARACTERS, #
  1293. BEGIN # ONE AT A TIME. #
  1294. N = B<M,6>CTEMP;
  1295. IF N EQ O"55" THEN # BLANK TERMINATES INTEGER BUT #
  1296. IF ITEMP EQ 0 THEN # LEADING BLANKS ARE IGNORED. #
  1297. TEST M; # #
  1298. ELSE RETURN; # #
  1299. IF N LS O"33" OR # PUT OUT DIAGNOSTIC IF AN IL- #
  1300. N GR O"42" THEN # LEGAL OCTAL DIGIT IS FOUND. #
  1301. BEGIN
  1302. IF LFLAG EQ 0 THEN #IF LFLAG=0 THEN CARD HAS NOT #
  1303. BEGIN # BEEN PRINTED ON OUTPUT. #
  1304. SYNORL = SYNIRL + 10;#LIST CARD WITH ERROR. #
  1305. SYNPRNT(LOC(SYNIWSA)-1);
  1306. END # #
  1307. SCALL CHKLINO;
  1308. SYNORL = 50;
  1309. ITEMP = 0;# ZERO IS RETURNED. #
  1310. SYNPRNT(BADOCTALMSG2);
  1311. CHKERRCNT;
  1312. RETURN; # ILLEGAL DIGIT TERMINATES CON- #
  1313. END # VERSION. #
  1314. ITEMP = ITEMP*2**3 + N - O"33";#ADD 3 NEW BITS TO LOW #
  1315. END # ORDER OF RESULT. #
  1316. END
  1317. CONTROL EJECT;
  1318. #********************************************************************#
  1319. # SYNTBLR #
  1320. # A PROC TO -READ- ENTRIES FROM THE SYMBOL/CODE TABLE #
  1321. #********************************************************************#
  1322. PROC SYNTBLR(RWSA, RWA);
  1323. BEGIN
  1324. ARRAY RWSA;
  1325. ITEM RWSAWD;
  1326. ITEM RWA;
  1327. FOR P = 0 STEP 1 UNTIL 5 DO
  1328. RWSAWD[P] = SYNTBLEWD[RWA + P];
  1329. RETURN;
  1330. END
  1331. CONTROL EJECT;
  1332. #********************************************************************#
  1333. # SYNTBLW #
  1334. # A PROC TO -WRITE- ENTRIES TO THE SYMBOL/CODE TABLE #
  1335. #********************************************************************#
  1336. PROC SYNTBLW(WWSA, WWA);
  1337. BEGIN
  1338. ARRAY WWSA;
  1339. ITEM WWSAWD;
  1340. ITEM WWA;
  1341. IF LOC (SYNTBLEWD [WWA + 6 ]) GQ LASTAVAIL THEN
  1342. SYNABT(0); # ABORT WITH SHORT FL #
  1343. FOR P = 0 STEP 1 UNTIL 5 DO
  1344. SYNTBLEWD[WWA + P] = WWSAWD[P];
  1345. RETURN;
  1346. END
  1347. CONTROL EJECT;
  1348. #**********************************************************************#
  1349. PROC CONLEXTABLES;
  1350. BEGIN
  1351. ITEMP = KEY1PTR - 1; # NBR OF WORDS IN KEYWORD LIST. #
  1352. M = ITEMP; # SAVE VALUE. #
  1353. BINTODISPDEC; # CONVERT TO DISPLAY DECIMAL. #
  1354. B<0,30>KEYHDR[2] = B<0,30>CTEMP; # STORE NUMBER OF WORDS IN THE #
  1355. # LEXWORDS PRESET ARRAY. #
  1356. SYNCOM(KEYWRDHDR);
  1357. SYNCOM(KEYWRDITEM);
  1358. M = M - (KEY2PTR + KEY3PTR);
  1359. J = 1;
  1360. L = 0;
  1361. STORE:
  1362. FOR K=0 STEP 1 UNTIL M DO # MOVE KEYWORDS INTO THE PRESET #
  1363. BEGIN # ARRAY. #
  1364. IF L EQ J THEN
  1365. BEGIN
  1366. L = 0;
  1367. KEYLINE[4] = " ";
  1368. IF B<45,15>KEY1WRD[K] EQ O"77776" THEN #IF NO LABELLED #
  1369. BEGIN # SECTION OF SYNTBLE CORRESPONDS#
  1370. B<45,15>KEY1WRD[K] = 0;#TO THIS KEYWORD AND THERE WAS#
  1371. IF LFLAG EQ 0 THEN # AN * IN COL 31 OF INPUT CARD, #
  1372. BEGIN # PRINT MESSAGE AND ZERO-OUT THE#
  1373. SCRATCHWD[0] = " ";#LEXSYNSECT FIELD PRIOR TO #
  1374. FOR I=1 STEP 1 UNTIL J DO # CONVERSION. #
  1375. SCRATCHWD[I] = KEY1WRD[K-(J+1)+I];
  1376. SYNORL = I * 10;
  1377. SYNPRNT(SCRATCH);
  1378. END
  1379. SCALL CHKLINO;
  1380. SYNORL = 68;
  1381. SYNPRNT(NOSYNSECT);
  1382. CHKERRCNT;
  1383. END
  1384. END
  1385. ELSE
  1386. BEGIN
  1387. L = L + 1; # STORE KEYWORDS IN COMMENTS. #
  1388. IF J EQ 1 THEN # EQIVALENCE SIGNS AND SEMICO- #
  1389. IF KEY1WRD[K] EQ "#" THEN #LONS CAN AFFECT COMPILATION #
  1390. KEYLINE[4] = "EQUIV SIGN";#IF PLACED IN COMMENTS, SO #
  1391. ELSE IF KEY1WRD[K] EQ ";" THEN #THEY MUST BE REPLACED #
  1392. KEYLINE[4] = "SEMICOLON ";#WITH NAMES. #
  1393. ELSE KEYLINE[4] = KEY1WRD[K];
  1394. ELSE KEYLINE[4] = KEY1WRD[K];#KEYWORD GOES IN COMMENT. #
  1395. END
  1396. ITEMP = KEY1WRD[K]; # ENTRY CONDITION FOR CONVERSION#
  1397. BINTODISPOCT; # CONVERT KEYWRD TO DISPLAY OCT.#
  1398. B<0,60>KEYLINE[1] = OCTAL[0];# STORE CONVERTED VALUE. #
  1399. B<0,60>KEYLINE[2] = OCTAL[1];# #
  1400. SYNCOM(KEYWRDLINE); # MOVE TO OUTPUT FILES. #
  1401. END
  1402. IF KEY1PTR NQ 0 THEN
  1403. BEGIN
  1404. IF KEY2PTR NQ 0 THEN
  1405. BEGIN
  1406. M = KEY2PTR - 1;
  1407. J = 2;
  1408. L = 0;
  1409. KEY2PTR = 0;
  1410. P<SYN1SCRATCH> = LOC(KEY1WRD[K]);
  1411. GOTO STORE;
  1412. END
  1413. IF KEY3PTR NQ 0 THEN
  1414. BEGIN
  1415. M = KEY3PTR - 1;
  1416. J = 3;
  1417. L = 0;
  1418. KEY3PTR = 0;
  1419. P<SYN1SCRATCH> = LOC(KEY1WRD[K]);
  1420. GOTO STORE;
  1421. END
  1422. END
  1423. SYNCOM(KEYWRDTERM);
  1424. SYNCOM(LEXICONHDR); # MOVE HEADER TO OUTPUT FILES. #
  1425. SYNCOM(LEXICONITEM); # MOVE ITEM DEC TO OUTPUT FILES.#
  1426. FOR K=0 STEP 1 UNTIL 26 DO
  1427. BEGIN
  1428. ITEMP = LOCWRD[K]; # STORE WORD OF THE LEXICON TBL.#
  1429. BINTODISPOCT; # CONVERT WORD TO DISPLAY OCTAL.#
  1430. B<0,60>LEXLINE[1] = OCTAL[0];# STORE CONVERTED VALUE. #
  1431. B<0,60>LEXLINE[2] = OCTAL[1];# #
  1432. SYNCOM(LEXICONLINE);
  1433. END
  1434. SYNCOM(LEXICONTERM); # WRITE TERMINATOR FOR THE LEX- #
  1435. RETURN; # ICON PRESET ARRAY AND RETURN. #
  1436. END
  1437. CONTROL EJECT;
  1438. #**********************************************************************#
  1439. # #
  1440. # SUBRBUILD #
  1441. # #
  1442. #PROC WHICH PLACES THE USER-SUPPLIED SUBROUTINE NAMES INTO A HASH-CODED#
  1443. #TABLE FOR LATER USE BY SYNSCAN WHEN THE SYNTAX TABLE - SYNTABLE - IS #
  1444. #BEING BUILT. THE CARDS IN THE INPUT FILE INTO SYNIWSA BY THE COMPASS #
  1445. #ROUTINE SYNREAD. IF THE USER DEFAULTS THE SWITCH VECTOR ENTRY VALUES #
  1446. #HE GETS CONSECUTIVE VALUES ASSIGNED IN THE ORDER THE NAMES ARE READ. #
  1447. #IF THE USER REQUESTED A LISTING OF HIS INPUT, THE COMPASS ROUTINE #
  1448. #SYNPRNT IS CALLED TO PRINT OUT THE CARD IMAGE WITH THE SWITCH VALUE #
  1449. #ADDED IF DEFAULTED. THE SUBROUTINE NAMES ARE ENTERED INTO A HASH-CODED#
  1450. #TABLE USING AN INDIRECT-CHAINING SCHEME: THE HASH CODE IS AN ADDRESS #
  1451. #IN A TABLE OF POINTERS TO DATA ENTRIES, SYNONYMS BEING CHAINED #
  1452. #TOGETHER IN A PUSHDOWN OR LIFO STACK. THE SYMPL ROUTINE SYNHASH SETS #
  1453. #THE BASED ARRAY TABLENTRY TO THE PROPER POSITION FOR THE NEXT ENTRY, #
  1454. #ALLOCATING SPACE AS NECESSARY BY CALLING SYNALLOCATE. #
  1455. # #
  1456. # ERRORS DIAGNOSED: DUPLICATE ROUTINE NAMES ARE DIAGNOSED AND THE #
  1457. # LATEST DEFINITION OVERRIDES. #
  1458. # #
  1459. PROC SUBRBUILD;
  1460. BEGIN
  1461. GETACARD:
  1462. SYNREAD; #READ CARD INTO SYNIWSA. #
  1463. IF SYNEOF GR 0 THEN #STOP IF EOF ENCOUNTERED. #
  1464. SYNABT(2);
  1465. IF WORD1 NQ 0 THEN # MOVE WORDS 1,2 TO 0,1 AND IGNORE #
  1466. BEGIN # WORD 0. #
  1467. INWORD[0] = INWORD[1];
  1468. INWORD[1] = INWORD[2];
  1469. INWORD[2] = " ";
  1470. END
  1471. IF INWORD[0] EQ " " THEN #ASSUMED TO BE BLANK CARD IF 1ST TEN #
  1472. GOTO GETACARD; #CHARS BLANK. BLANK CARDS ARE SKIPPED. #
  1473. IF INWORD[0] EQ "+" THEN #+ SIGN MEANS END OF SUBROUTINE #
  1474. RETURN; #NAME LIST INPUT. #
  1475. NAME[0] = INWORD[0];
  1476. NAME[1] = C<0,2>INWORD[1];
  1477. IF NAME[1] EQ " " THEN #SYMBOLLENGTH IS 1 WORD IF LESS THAN 11 #
  1478. SYMBOLLENGTH = 1; #CHARS IN THE ROUTINE NAME. #
  1479. ELSE SYMBOLLENGTH = 2;
  1480. CTEMP = C<7,3>INWORD[1];
  1481. IF CTEMP EQ " " THEN
  1482. BEGIN #IF THE USER DEFAULTS THE SWITCH VECTOR #
  1483. ITEMP = COUNTER; #INDEX FOR A SUBROUTINE NAME, HE GETS #
  1484. COUNTER = COUNTER + 1;#VALUES ASSIGNED IN THE ORDER THE NAMES#
  1485. END #ARE READ BY SYNGEN. #
  1486. ELSE #ELSE THE VALUE GIVEN BY THE USER IS #
  1487. DISPLAYTOBIN; #CONVERTED TO BINARY. #
  1488. SYMBOLVALUE = ITEMP; #STORE VALUE OF SUBR NAME. #
  1489. SYNHASH; #INSERT THE SUBROUTINE NAME AND SWITCH #
  1490. #INDEX INTO THE SYMBOL TABLE. #
  1491. IF ERRORFLAG EQ 2 THEN #ERROR MEANS HASH ROUTINE FOUND A DUPLI-#
  1492. BEGIN #CATE SUBROUTINE NAME. #
  1493. DUPELABEL[1] = NAME[0];
  1494. DUPELABEL[2] = NAME[1];
  1495. SCALL CHKLINO;
  1496. SYNORL = 77;
  1497. SYNPRNT(DUPELABELMSG);#PRINT OUT DIAGNOSTIC MESSAGE. #
  1498. CHKERRCNT;
  1499. END
  1500. GOTO GETACARD; #LOOP TO GET NEXT INPUT CARD. #
  1501. END
  1502. CONTROL EJECT;
  1503. #**********************************************************************#
  1504. # #
  1505. # SYNHASH #
  1506. # #
  1507. #PROC WHICH MANAGES THE SYNGEN SYMBOL TABLE, PERFORMING BOTH INSERTIONS#
  1508. #AND EXTRACTIONS OF TABLE ENTRIES AS INDICATED BY THE INS$EXT FLAG. THE#
  1509. #SYMBOL TABLE IS ORGANIZED AS A HASH-CODED ENTRY TABLE WITH INDIRECT #
  1510. #CHAINING. I.E. THE HASHED CODE PROVIDES AN INDEX INTO A FIXED-LENGTH #
  1511. #TABLE OF POINTERS. THE POINTER SO ACCESSED IS THE HEAD OF A CHAIN OF #
  1512. #SYMBOL TABLE ENTRIES WITH THE SAME HASHED CODE (SYNONYMS). THE CHAIN #
  1513. #IS A SIMPLE QUEUE OR FIFO LIST, WITH THE SPACE FOR EACH CHAIN ENTRY #
  1514. #ALLOCATED WHEN IT IS ENTERED INTO THE CHAIN. CHAIN ENTRIES ARE LINKED #
  1515. #BY POINTERS. #
  1516. # ERRORS DIAGNOSED: 1.THE ERRORFLAG IS SET IF THE SAME SYMBOL IS MUL- #
  1517. # TIPLY DEFINED AND THE LAST DEFINITION OVERRIDES.#
  1518. # 2.THE ERRORFLAG IS SET IF AN EXTRACTION REQUEST #
  1519. # REFERENCES AN UNDEFINED SYMBOL. #
  1520. # #
  1521. PROC SYNHASH;
  1522. BEGIN
  1523. ERRORFLAG = 0; #TURN OFF ERROR FLAG. #
  1524. I = NAME[0]; #FIRST WORD OF SYMBOL. #
  1525. ITEMP = SYMBOLLENGTH - 2;#CHECK LENGTH OF SYMBOL IN WORDS. #
  1526. IF ITEMP LS 0 THEN #IF 10 CHARS OR LESS THEN GO TO FOLDING #
  1527. GOTO FOLD; #CODE DIRECTLY. #
  1528. IF ITEMP GR 0 THEN #IF 21-30 CHARS FOLD IN LAST WORD. #
  1529. I = I + NAME[2];
  1530. I = I + NAME[1]; #FOLD IN 2ND WORD. #
  1531. FOLD:
  1532. ITEMP = ((B&lt;30,30>I*2**15)*2**15) + B<0,30>I;#SHIFT I LEFT(CIRCU-#
  1533. #LAR) 30 BITS. #
  1534. ITEMP = I + ITEMP; #FOLD ONE LAST TIME. #
  1535. RTEMP = B&lt;30,30>ITEMP * .0019569E-48;#PACK,NORMALIZE AND MULTIPLY#
  1536. #BY A HASHING CONSTANT. #
  1537. ITEMP = B&lt;53,7>RTEMP; #ONLY 9 BITS USED FOR SYNGEN HASHING, 7 #
  1538. J = B&lt;51,2>RTEMP; #BITS FOR WORD INDEX AND 2 FOR THE 15- #
  1539. #BIT QUADRANT OF THE WORD SO INDEXED. #
  1540. P&lt;SYMBOLTABLE> = B&lt;J*15,15>HASHENTRY[ITEMP];#PTR TO 1ST IN CHAIN.#
  1541. I = SYMBOLLENGTH - 2; #I = LENGTH OF SYMBOL CALLER IS QUERYING#
  1542. IF INS$EXT EQ S"INSERT" THEN #IS THIS AN INSERTION OR AN EXTRAC- #
  1543. GOTO INSERTION; #TION OF A SYMBOL AND VALUE. #
  1544. SYMBOLVALUE = -1; #TO BE USED ONLY IF THIS EXTRACTION RE- #
  1545. #QUEST IS 1ST REFERENCE TO UNDEFINED #
  1546. #SYMBOL. #
  1547. IF P&lt;SYMBOLTABLE> EQ 0 THEN #IF SYMBOL IS UNDEFINED THEN INSERT A#
  1548. BEGIN #REFERENCE TO THE SYMBOL. #
  1549. ERRORFLAG = 1; #SET FLAG FOR UNDEFINED SYMBOL. #
  1550. GOTO INSERTENTRY;
  1551. END
  1552. EXTRACT: #SEARCH DOWN CHAIN FOR SYMBOL MATCH. #
  1553. IF NAME[0] EQ SNAME[0] AND #POSSIBLE MATCH IF THE 1ST WORDS OF #
  1554. SYMBOLTYPE EQ STYPE[0] AND #SYMBOLS MATCH AND THE LENGTHS AND #
  1555. SYMBOLLENGTH EQ SLENGTH[0] THEN #TYPES ARE THE SAME. #
  1556. BEGIN
  1557. IF I LS 0 THEN #MATCH FOUND IF 10 CHARS OR LESS IN LENG#
  1558. GOTO EXTRACTMATCH;
  1559. IF NAME[1] NQ SNAME[1] THEN #IF 2ND WORD DOES NOT MATCH #
  1560. GOTO EXTNOMATCH;
  1561. IF I EQ 0 OR #MATCH FOUND IF 20 CHARS OR LESS IN LENG#
  1562. NAME[2] EQ SNAME[2] THEN #OR 3RD WORD MATCHES. #
  1563. GOTO EXTRACTMATCH;
  1564. END
  1565. EXTNOMATCH:
  1566. IF NEXTPTR[0] EQ 0 THEN #THIS ENTRY IS THE END OF A CHAIN, AND #
  1567. BEGIN #THE SYMBOL HAS NO ENTRY IN THE SYMBOL #
  1568. ERRORFLAG = 1; #TABLE, SO SET FLAG FOR UNDEFINED SYMBOL#
  1569. GOTO ADDTOCHAIN; #AND ENTER A REFERENCE TO THE SYMBOL AT #
  1570. END #THE END OF THE SYMBOL TABLE CHAIN. #
  1571. P&lt;SYMBOLTABLE> = NEXTPTR[0];#PTR TO NEXT ENTRY IN CHAIN. #
  1572. GOTO EXTRACT; #GO CHECK FOR MATCH. #
  1573. EXTRACTMATCH:
  1574. SYMBOLVALUE = SVALUE[0]; #VALUE IS RETURNED TO CALLER. #
  1575. IF NOT SDEFINEBIT[0] THEN #IF SYMBOL HAS NOT YET BEEN DEFINED, #
  1576. BEGIN #THEN SET ERRORFLAG TO TELL CALLER AND #
  1577. ERRORFLAG = 1; #SET VALUE TO POINTER TO LAST ENTRY IN #
  1578. SVALUE[0] = SYNTBLEWORD + SYNTBLEPARCL + 7;# SYNTBLE WHICH #
  1579. END #REFERENCES THIS SYMBOL. #
  1580. RETURN; #RETURN TO CALLING ROUTINE. #
  1581. INSERTION:
  1582. IF P&lt;SYMBOLTABLE> EQ 0 THEN #IF 0 THEN THIS IS 1ST USE OF THIS #
  1583. GOTO INSERTENTRY; #HASH CODE. #
  1584. INSERT:
  1585. IF NAME[0] EQ SNAME[0] AND #POSSIBLE MATCH IF FIRST WORD AND #
  1586. SYMBOLLENGTH EQ SLENGTH[0] THEN #LENGTHS ARE EQUAL. #
  1587. BEGIN
  1588. IF I LS 0 THEN #MATCH IF 10 CHARS OR LESS IN LENGTH, SO#
  1589. GOTO MULTIPLEDEF;#GO CHECK FOR POSSIBLE MULTI-DEFINITION.#
  1590. IF NAME[1] NQ SNAME[1] THEN #IF 2ND WORD DOES NOT MATCH #
  1591. GOTO INSNOMATCH; #THEN SYMBOLS DO NOT MATCH. #
  1592. IF I EQ 0 OR #MATCH FOUND IF 20 CHARS OR LESS IN LENG#
  1593. NAME[2] EQ SNAME[2] THEN #OR 3RD WORD MATCHES, SO GO #
  1594. GOTO MULTIPLEDEF;#CHECK FOR POSSIBLE MULTI-DEFINITION. #
  1595. END
  1596. INSNOMATCH:
  1597. IF NEXTPTR[0] EQ 0 THEN #SYMBOL IS NOT IN CHAIN SO GO ADD IT. #
  1598. GOTO ADDTOCHAIN;
  1599. P&lt;SYMBOLTABLE> = NEXTPTR[0];#PTR TO NEXT ENTRY IN CHAIN. #
  1600. GOTO INSERT; #GO CHECK FOR MATCH. #
  1601. INSERTENTRY:
  1602. #IF THIS IS FIRST USE OF THIS HASHED #
  1603. #CODE THEN STORE POINTER TO CHAIN IN THE#
  1604. P&lt;SYMBOLTABLE> = SYNALLOCATE(-SYMBOLLENGTH-1);#FIXED-LENGTH TABLE#
  1605. B&lt;J*15,15>HASHENTRY[ITEMP] = P<SYMBOLTABLE>;#OF POINTERS. #
  1606. GOTO INSERTATTRIB;
  1607. ADDTOCHAIN:
  1608. NEXTPTR[0] = SYNALLOCATE(-SYMBOLLENGTH-1);#ELSE PUT THIS ENTRY ON#
  1609. P&lt;SYMBOLTABLE> = NEXTPTR[0];#THE END OF THE CHAIN OF SYNONYMS. #
  1610. INSERTATTRIB:
  1611. NEXTPTR[0] = 0; #MARK THIS ENTRY AS END OF CHAIN. #
  1612. SLENGTH[0] = SYMBOLLENGTH;#STORE THE ATTRIBUTES OF THE SYMBOL. #
  1613. STYPE[0] = SYMBOLTYPE;
  1614. SNAME[0] = NAME[0];
  1615. REPLACEATTR:
  1616. SVALUE[0] = SYMBOLVALUE;
  1617. IF I LS 0 THEN GOTO SETDEFBIT;
  1618. SNAME[1] = NAME[1];
  1619. IF I GR 0 THEN
  1620. SNAME[2] = NAME[2];
  1621. SETDEFBIT:
  1622. IF INS$EXT NQ S"INSERT" THEN #RETURN TO CALLING ROUTINE IF THIS #
  1623. BEGIN #WAS A FORWARD SYMBOL REFERENCE. #
  1624. UNDEFSYMBOLS = UNDEFSYMBOLS + 1;#INCREMENT TALLY OF UNDEFINEE#
  1625. SDEFINEBIT[0] = FALSE;#SYMBOLS. MARK AS UNDEFINED. #
  1626. SVALUE[0] = SYNTBLEWORD + SYNTBLEPARCL + 7;
  1627. RETURN;
  1628. END
  1629. SDEFINEBIT[0] = TRUE; #FOR INSERTIONS, TURN ON THE DEFINITION #
  1630. RETURN; #BIT AND RETURN TO CALLING ROUTINE. #
  1631. MULTIPLEDEF:
  1632. IF STYPE[0] NQ SYMBOLTYPE THEN #IF NAMES ARE SAME BUT NOT TYPES #
  1633. GOTO INSNOMATCH; #IT IS NOT A MULTIPLY-DEFINED SYMBOL. #
  1634. IF NOT SDEFINEBIT[0] THEN #IF NAMES AND TYPES MATCH BUT #
  1635. BEGIN #SYMBOL WAS PREVIOUSLY UNDEFINED, RETURN#
  1636. ITEMP = SVALUE[0]; #PTR TO CHAIN OF REFERENCES IN ITEMP AND#
  1637. SVALUE[0] = SYMBOLVALUE;#REPLACE WITH SYMBOLVALUE. MARK THE #
  1638. SDEFINEBIT[0] = TRUE;#SYMBOL AS DEFINED. #
  1639. UNDEFSYMBOLS = UNDEFSYMBOLS - 1;#REDUCE UNDEFSYMBOL TALLY. #
  1640. ERRORFLAG = 3; #FLAG INDICATES SYMBOL PREVIOUSLY UNDEF.#
  1641. RETURN;
  1642. END
  1643. ERRORFLAG = 2; #FOR TRUE MULTIPLE-DEFINITIONS, SET FLAG#
  1644. GOTO REPLACEATTR; #AND OVERRIDE PREVIOUS DEFINITION. #
  1645. END
  1646. CONTROL EJECT;
  1647. #**********************************************************************#
  1648. # #
  1649. # SYNBUILD #
  1650. # #
  1651. #ROUTINE WHICH CONSTRUCTS THE SYNTABLE (TABLE WHICH IS USED TO DRIVE #
  1652. #THE SYNTAX ANALYSIS FOR A SYSTEM) AND THE TRACEM TABLE (TABLE WHICH IS#
  1653. #USED TO TRACE ANY PATH THROUGH THE SYNTABLE) PLUS THREE CROSS REFER- #
  1654. #ENCE LISTS - LABELS, SUBROUTINES, AND DIAGNOSTICS. #
  1655. # #
  1656. #ENTRY CONDITIONS: #
  1657. # SYNGEN"S INPUT FILE MUST BE POSITIONED TO THE THIRD SECTION CONTAIN-#
  1658. # ING THE SYNTAX SPECIFICATIONS, THE SUBROUTINE NAMES MUST HAVE BEEN #
  1659. # ENTERED INTO THE SYMBOL TABLE AND THE LEXICON TABLES MUST HAVE BEEN #
  1660. # BUILT. #
  1661. # #
  1662. #EXTERNAL REFERENCES: #
  1663. # SYNSCAN - CODE WHICH IDENTIFIES SYNTAX ENTRIES IN THE INPUT CARD. #
  1664. # SYNHASH - PROC WHICH ENTERS OR RETRIEVES INFO FROM THE SYMBOL TABLE.#
  1665. # SYNALLOCATE - PROC WHICH ALLOCATES SPACE WITHIN A JOB"S FIELDLENGTH.#
  1666. # SYNPRNT - ROUTINE WHICH PRINTS AN OUTPUT LINE. #
  1667. # #
  1668. #EXIT CONDITIONS: #
  1669. # SYNTABLE, TRACEM, AND THE THREE CROSS REFERENCE LIST ARE BUILT AND #
  1670. # SYNGEN"S INPUT FILE IS POSITIONED AT EOF. #
  1671. # #
  1672. #ERROR CONDITIONS: #
  1673. # UNDEFINED LABEL REFERENCE BY THE USER"S SYNTAX SPECIFICATIONS. #
  1674. # UNDEFINED SUBLABEL REFERENCE BY THE USER"S SYNTAX SPECIFICATIONS. #
  1675. PROC SYNBUILD;
  1676. BEGIN
  1677. P&lt;SUBLABELPTRS> = SYNALLOCATE(100);#ALLOCATE SPACE FOR SAVING #
  1678. #PTRS TO SUBLABELS IN A SYNTBLE SECTION.#
  1679. FOR I=0 STEP 1 UNTIL 99 DO #INITIALIZE SUBLABEL POINTERS TO ZERO.#
  1680. SUBLABELPTR[I] = 0;
  1681. P&lt;LABELPTRS> = P&lt;SUBLABELPTRS>+100;#LABELPTRS ARRAY SPACE WILL BE#
  1682. #ALLOCATED AS NEEDED. #
  1683. LASTRANSFER = 0; #INITIALIZE ALL POINTERS AND COUNTERS. #
  1684. COUNTER = 0; #INITIALIZE CODE LINE COUNTER. #
  1685. LABELCOUNTER = 0;
  1686. SYNTBLEPARCL = 0;
  1687. CURRENTLABEL[0] = 0;
  1688. FIRSTCHAR = 0; #INIT SCAN FLAG FOR DELIMITERS AND #
  1689. #COMMENTS. #
  1690. IF TFLAG NQ 0 THEN #IF A TRACEM ARRAY IS REQUESTED, THEN #
  1691. BEGIN #WRITE THE ARRAY ITEM DESCRIPTION TO THE#
  1692. TRACEWSAWD[0] = " ITEM TR";#FILE. #
  1693. TRACEWSAWD[1] = "ACEINSTR C";
  1694. TRACEWSAWD[2] = "(,,10) = [";
  1695. TRACEWSAWD[3] = " ";
  1696. TRACEWSAWD[4] = " ";
  1697. TRACEWSAWD[5] = " ";
  1698. TRACEW;
  1699. TRACEWSAWD[0] = " ";#RESET 1ST WORD OF THE WSA TO A #
  1700. END #BLANK. #
  1701. SCRATCHWD[0] = " ARRAY SYN";
  1702. SCRATCHWD[1] = "TBLE[ ";
  1703. SCRATCHWD[2] = "]; ";
  1704. SCRATCHWD[3] = " ";
  1705. SCRATCHWD[4] = " ";
  1706. SCRATCHWD[5] = " ";
  1707. SYNTBLW(SCRATCH,SYNTBLEWORD);
  1708. SYNTBLEWORD = SYNTBLEWORD + 6;
  1709. SCRATCHWD[0] = " ITEM SY";
  1710. SCRATCHWD[1] = "NWORD U =[";
  1711. SCRATCHWD[2] = " ";
  1712. SYNTBLW(SCRATCH,SYNTBLEWORD);
  1713. SYNTBLEWORD = SYNTBLEWORD + 6;
  1714. GOTO SYNSCAN; #CALL SYNSCAN PROCEDURE TO CRACK INPUT #
  1715. #AND GIVE CONTROL TO PROPER SYNTACTIC #
  1716. #ROUTINE. #
  1717. #**********************************************************************#
  1718. DRIVERREQ: #DRIVER REQUESTS AND KEYWORD CALLS. #
  1719. ENCODE:
  1720. ITEMP = SYNSTRUCTION; #CONVERT INSTRUCTION TO DISPLAY-CODED #
  1721. BINTODISPOCT; #OCTAL, LEFT-JUSTIFIED BLANK-FILLED. #
  1722. SYNSTRUCTION = (B&lt;30,30>OCTAL[1]*2**15)*2**15 + O"5555555555";
  1723. STORECODE:
  1724. IF TFLAG NQ 0 THEN #IF TRACEM REQUESTED AND THIS INSTRUC- #
  1725. IF FIRSTSUBLABL EQ 1 THEN #TION ISN"T 1ST SUBLABEL DEFINED IN #
  1726. BEGIN #SECTION, THEN MAKE ENTRY IN THE CURRENT#
  1727. B&lt;6,42>TRACESKEL = B&lt;0,42>DISPLAYINSTR;# TRACEM RECORD. #
  1728. TRACEWSAWD[1+SYNTBLEPARCL] = TRACESKEL;
  1729. END
  1730. ELSE FIRSTSUBLABL = 1; #SET FLAG SO NEXT INSTRUCTION GETS OUT. #
  1731. C&lt;0,7>INSTRUCTCOM[SYNTBLEPARCL+1]=DISPLAYINSTR;#COMMENT FOR CODE.#
  1732. PRESETI[1+SYNTBLEPARCL] = SYNSTRUCTION;#STORE CODED INSTRUCTION. #
  1733. IF SYNTBLEPARCL GR 2 THEN #IF FULL SYNTBLE WORD BUILT THEN WRITE #
  1734. BEGIN #THE RECORD TO FILE AND SET POINTERS TO #
  1735. SYNTBLEPARCL = 0; #NEXT WORD AND PARCEL. #
  1736. ITEMP = COUNTER; #CONVERT CODE LINE COUNTER TO OCTAL DIS-#
  1737. BINTODISPOCT; #PLAY CODE AND STORE IN COMMENT LINE. #
  1738. B&lt;24,30>INSTRUCTCOM[0] = B&lt;30,30>OCTAL[1];
  1739. SYNTBLW(INSTRCOMMENT,SYNTBLEWORD);#WRITE OUT COMMENT LINE. #
  1740. SYNTBLEWORD = SYNTBLEWORD + 6;
  1741. SYNTBLW(PRESETCODE,SYNTBLEWORD);
  1742. COUNTER = COUNTER + 1;#INCREMENT CODE LINE COUNTER. #
  1743. SECTIONWORD = SECTIONWORD + 1;
  1744. SYNTBLEWORD = SYNTBLEWORD + 6;
  1745. IF TFLAG NQ 0 THEN #WRITE OUT RECORD TO TRACEM FILE. #
  1746. TRACEW;
  1747. GOTO SYNSCAN; #GET NEXT INPUT ELEMENT. #
  1748. END
  1749. SYNTBLEPARCL = SYNTBLEPARCL + 1;#SET POINTER TO NEXT PARCEL. #
  1750. GOTO SYNSCAN; #GET NEXT INPUT ELEMENT. #
  1751. #**********************************************************************#
  1752. LABELS:
  1753. IF NAME[0] EQ CURRENTLABEL[0] AND #IF "NEW" LABEL IS SAME AS THE#
  1754. NAME[1] EQ CURRENTLABEL[1] AND #CURRENT LABEL, IT IS OPTIONAL#
  1755. NAME[2] EQ CURRENTLABEL[2] THEN #BOOKKEEPING DEVICE, SO IT IS #
  1756. GOTO SYNSCAN; #IGNORED AND NEXT INPUT ELEMENT REQUESTD#
  1757. IF TFLAG NQ 0 THEN #IF TRACEM BEING BUILT THEN SET FLAG TO #
  1758. BEGIN #INDICATE NEW SYNTBLE SECTION BEING #
  1759. IF SYNTBLEPARCL NQ 0 THEN #STARTED. #
  1760. BEGIN
  1761. FOR I=SYNTBLEPARCL+1 STEP 1 UNTIL 4 DO #FILL OUT TRACEM #
  1762. TRACEWSAWD[I] = """NO CODE"",";#RECORD WITH THAT WHICH #
  1763. TRACEW; #SHOULD NEVER SHOW UP ON A TRACE. #
  1764. END
  1765. FIRSTSUBLABL = -1; #FLAG FOR START OF NEW LABELLED SECTION.#
  1766. C&lt;1,1>TRACESKEL = ":"; # ADD : TO A LABEL AND STORE IT #
  1767. B&lt;12,36>TRACESKEL = B&lt;0,36>DISPLAYINSTR;# INTO A TRACEM ENTRY#
  1768. TRACEWSAWD[1] = TRACESKEL; #TRACEM ENTRY. #
  1769. END
  1770. IF SYNTBLEPARCL EQ 0 THEN #IF NOT ALREADY POSITIONED AT INSTRUC- #
  1771. GOTO WRITELABLCOM; #TION WORD BOUNDARY, THEN FILL OUT CUR- #
  1772. FOR I=SYNTBLEPARCL+1 STEP 1 UNTIL 4 DO #RENT SYNTBLE WORD AND #
  1773. BEGIN #WRITE OUT COMMENT AND CODE PRESET #
  1774. PRESET[I] = "00000"; #RECORDS. #
  1775. INSTRUCTCOM[I] = " ";
  1776. END
  1777. ITEMP = COUNTER; #CONVERT CODE LINE NUMBER TO DISPLAY- #
  1778. BINTODISPOCT; #CODED OCTAL AND STORE IN COMMENT LINE. #
  1779. B&lt;24,30>INSTRUCTCOM[0] = B&lt;30,30>OCTAL[1];
  1780. SYNTBLW(INSTRCOMMENT,SYNTBLEWORD);
  1781. SYNTBLEWORD = SYNTBLEWORD + 6;
  1782. SYNTBLW(PRESETCODE,SYNTBLEWORD);
  1783. SYNTBLEWORD = SYNTBLEWORD + 6;#INCREMENT POINTERS. #
  1784. SYNTBLEPARCL = 0;
  1785. COUNTER = COUNTER + 1;
  1786. WRITELABLCOM: #BUILD COMMENT CARD FOR NEW LABEL. #
  1787. B&lt;24,36>LABELCOMWORD[0] = B&lt;0,36>NAME[0];
  1788. B&lt;24,36>LABELCOMWORD[1] = B&lt;0,36>NAME[1];
  1789. B&lt;24,36>LABELCOMWORD[2] = B&lt;0,36>NAME[2];
  1790. B&lt;0,24>LABELCOMWORD[1] = B&lt;36,24>NAME[0];
  1791. B&lt;0,24>LABELCOMWORD[2] = B&lt;36,24>NAME[1];
  1792. B&lt;0,24>LABELCOMWORD[3] = B&lt;36,24>NAME[2];
  1793. SYNTBLW(LABELCOMMENT,SYNTBLEWORD);#WRITE OUT LABEL COMMENT LINE. #
  1794. SYNTBLEWORD = SYNTBLEWORD + 6;
  1795. P&lt;LABELENTRY> = SYNALLOCATE(6);#ALLOCATE ANOTHER ENTRY IN THE #
  1796. #LABELPTRS TABLE. #
  1797. LABELCOUNTER = LABELCOUNTER + 1;#INCREMENT LABEL TALLY. #
  1798. SYMBOLVALUE = LABELCOUNTER;#ENTRY POSITION IN LABELPTRS TABLE IS #
  1799. #THE DEFINED VALUE OF THE SYMBOL. #
  1800. SECTIONWORD = 0; #1ST WORD OF NEW LABELLED SECTION. #
  1801. LABELNAME[1] = NAME[0]; #STORE LABEL IN COMMENT PORTION OF THE #
  1802. LABELNAME[2] = NAME[1]; #LABELPTRS ARRAY ENTRY. #
  1803. LABELNAME[3] = NAME[2];
  1804. ITEMP = COUNTER; #CONVERT RELATIVE WORD POSITION IN THE #
  1805. BINTODISPDEC; #SYNTBLE TO DISPLAY CODE AND STORE INTO #
  1806. LABELPRESET[0] = CTEMP; #THE PRESET PORTION OF THE LABELPTRS #
  1807. #ARRAY ENTRY. #
  1808. LABELNAME[0] = " # ";#STORE COMMENT SYMBOLS INTO THE #
  1809. LABELNAME[4] = " #, ";#LABELPTRS ARRAY ENTRY. #
  1810. SYMBOLTYPE = "L";
  1811. INS$EXT = S"INSERT";
  1812. SYNHASH; #ENTER SYMBOL DEFINITION IN SYMBOL TABLE#
  1813. K = ITEMP; #SAVE PTR TO CHAIN OF REFERENCES. #
  1814. ITEMP = O"24000" + LABELCOUNTER;#BUILD INSTRUCTION CALLING NEWLY-#
  1815. BINTODISPOCT; #DEFINED LABEL. #
  1816. SYNSTRUCTION = (B&lt;30,30>OCTAL[1]*2**15)*2**15 + O"5555555555";
  1817. IF ERRORFLAG EQ 3 THEN #IF LABEL PREVIOUSLY UNDEFINED, REPLACE #
  1818. WALKCHAIN; #CHAIN ENTRIES WITH LABEL CALL. #
  1819. ELSE IF ERRORFLAG EQ 2 THEN #IF LABEL IS A DUPLICATE, STORE LABEL#
  1820. BEGIN #IN MESSAGE AND CALL SYNPRNT TO PRINT IT#
  1821. DUPELABEL[1] = NAME[0];#ON THE SYSTEM OUTPUT FILE. #
  1822. DUPELABEL[2] = NAME[1];
  1823. DUPELABEL[3] = NAME[2];
  1824. DUPELABEL[4] = " DOUBLY";
  1825. SCALL CHKLINO;
  1826. SYNORL = 77;
  1827. SYNPRNT(DUPELABELMSG);
  1828. CHKERRCNT;
  1829. END
  1830. FOR I=0 STEP 1 UNTIL 99 DO #REINITIALIZE SUBLABELPTRS TO ZERO, #
  1831. BEGIN #CHECKING FOR UNDEFINED SUBLABEL REFER- #
  1832. IF SUBLABELPTR[I] NQ 0 AND #ENCES. PUT OUT DIAGNOSTIC IF UN- #
  1833. SUBLABELPTR[I] GR 0 THEN #DEFINED SUBLABEL FOUND. #
  1834. BEGIN
  1835. UNDEFMESS[1] = CURRENTLABEL[0];
  1836. UNDEFMESS[2] = CURRENTLABEL[1];
  1837. UNDEFMESS[3] = CURRENTLABEL[2];
  1838. ITEMP = I;
  1839. BINTODISPDEC;
  1840. B&lt;0,6>UNDEFMESS[4] = ":";
  1841. B&lt;6,12>UNDEFMESS[4] = B&lt;18,12>CTEMP;
  1842. UNDEFMESS[5] = "NED SUBLAB";
  1843. UNDEFMESS[6] = "EL. ";
  1844. SCALL CHKLINO;
  1845. SYNORL = 65;
  1846. SYNPRNT(UNDEFMESSAGE);
  1847. CHKERRCNT;
  1848. UNDEFMESS[4] = " UNDEFI";#RESTORE BLANKS. #
  1849. K = SUBLABELPTR[I];#REPLACE CHAIN OF REFERENCE PTRS #
  1850. SYNSTRUCTION = "03777 ";
  1851. WALKCHAIN;
  1852. END
  1853. SUBLABELPTR[I] = 0;
  1854. END
  1855. IF LFLAG NQ 0 THEN #IF THE LFLAG IS SET THEN CROSS REFER- #
  1856. BEGIN #ENCE INFORMATION MUST BE KEPT. #
  1857. CURNTLABLPTR = P&lt;SYMBOLTABLE>;#KEEP PTR TO SYMBOL TABLE ENTRY#
  1858. END #FOR THE CURRENT LABEL. #
  1859. CURRENTLABEL[0] = NAME[0];#SAVE LABEL OF SYNTBLE SECTION THAT IS #
  1860. CURRENTLABEL[1] = NAME[1];#CURRENTLY BEING CONSTRUCTED. #
  1861. CURRENTLABEL[2] = NAME[2];
  1862. IF LASTRANSFER NQ 0 THEN #STORE A CALL TO THE NEW LABEL AT THE #
  1863. BEGIN #LAST / OR :SUBLABEL. #
  1864. SYNTBLR(SCRATCH,LASTRANSFER);#FETCH THE WORD FROM SYNTBLE. #
  1865. SCRATCHWD[0] = "00000 "; #STORE A NO-OP AT LASTRANSFER. #
  1866. SYNTBLW(SCRATCH,LASTRANSFER);#STORE UPDATED WORD BACK. #
  1867. LASTRANSFER = 0; #INITIALIZE TO ZERO FOR A NEW LABELLED #
  1868. END #SECTION. #
  1869. GOTO SYNSCAN; #GET NEXT SOURCE ELEMENT. #
  1870. #**********************************************************************#
  1871. SUBLABELS:
  1872. IF TFLAG NQ 0 THEN #IF TRACEM REQUESTED THEN SET FLAG TO #
  1873. BEGIN #INDICATE WHETHER THIS IS 1ST SUBLABEL #
  1874. IF FIRSTSUBLABL LS 0 THEN #IN THE CURRENT LABELLED SECTION. #
  1875. FIRSTSUBLABL = 0;
  1876. END
  1877. IF B&lt;0,1>SUBLABELPTR[SUBLABEL] EQ 1 THEN #IF THE SIGN-BIT IN THE #
  1878. BEGIN #ENTRY IS ALREADY SET THEN THIS SUBLABEL#
  1879. DUPELABEL[1] = CURRENTLABEL[0];#IS DOUBLY-DEFINED. #
  1880. DUPELABEL[2] = CURRENTLABEL[1];
  1881. DUPELABEL[3] = CURRENTLABEL[2];
  1882. ITEMP = SUBLABEL;
  1883. BINTODISPDEC;
  1884. C&lt;0,1>DUPELABEL[4] = ":";
  1885. B&lt;6,12>DUPELABEL[4] = B&lt;18,12>CTEMP;
  1886. SCALL CHKLINO;
  1887. SYNORL = 77;
  1888. SYNPRNT(DUPELABELMSG);
  1889. CHKERRCNT;
  1890. DUPELABEL[4] = " DOUBLY";
  1891. END
  1892. ELSE
  1893. IF SUBLABELPTR[SUBLABEL] GR 0 THEN #IF THE VALUE IS POSITIVE, #
  1894. BEGIN #IT REPRESENTS A PTR TO THE HEAD OF A #
  1895. K = SUBLABELPTR[SUBLABEL];#CHAIN OF REFERENCES TO BE SATIS-#
  1896. ITEMP = O"40000" + SYNTBLEPARCL*2**11 + SECTIONWORD;#FIED. #
  1897. BINTODISPOCT;
  1898. SYNSTRUCTION = (B&lt;30,30>OCTAL[1]*2**15)*2**15 +
  1899. O"5555555555";
  1900. WALKCHAIN;
  1901. END
  1902. SUBLABELPTR[SUBLABEL] = -(SYNTBLEPARCL*2**11 + SECTIONWORD);
  1903. CURNTSUBLABL = C&lt;1,2>DISPLAYINSTR;
  1904. #**********************************************************************#
  1905. SLASH:
  1906. IF LASTRANSFER NQ 0 THEN
  1907. BEGIN
  1908. ITEMP = O"60000" + SECTIONWORD + SYNTBLEPARCL*2**11;
  1909. BINTODISPOCT;
  1910. ITEMP = SYNTBLEWORD + SYNTBLEPARCL + 7;
  1911. I = (B&lt;30,30>OCTAL[1]*2**15)*2**15 + O"5555555555";
  1912. IF ITEMP-LASTRANSFER LS 4 THEN #IF THE LAST TRANSFER POINT IS#
  1913. BEGIN #IN THE CURRENT RECORD OF THE SYNTBLE #
  1914. PRESETI[LASTRANSFER-SYNTBLEWORD-6] = I;#FILE, THEN DON"T #
  1915. GOTO UPDATETRANSF;#GET THE RECORD, SIMPLY STORE IN THE #
  1916. END #WSA CURRENTLY BEING FILLED. #
  1917. SYNTBLR(SCRATCH,LASTRANSFER);#ELSE GET THE WORD FROM THE FILE#
  1918. B&lt;0,60>SCRATCHWD[0] = I;
  1919. SYNTBLW(SCRATCH,LASTRANSFER);
  1920. END
  1921. UPDATETRANSF:
  1922. LASTRANSFER = SYNTBLEWORD + SYNTBLEPARCL + 7;#UPDATE LAST TRANS- #
  1923. #FER POINTER. #
  1924. SYNSTRUCTION = 0; #STORE A ZERO IN THE CURRENT PARCEL OF #
  1925. GOTO STORECODE; #SYNTBLE, TEMPORARILY. #
  1926. #**********************************************************************#
  1927. LABELCALL:
  1928. INS$EXT = S"EXTRACT"; #SET UP CALL TO SYNHASH REQUESTING LABEL#
  1929. SYMBOLTYPE = "L"; #POSTION IN LABELPTRS TABLE. #
  1930. SYNHASH;
  1931. IF LFLAG NQ 0 THEN #LFLAG MEANS CROSS REFERENCE INFO IS #
  1932. BEGIN #REQUIRED. CROSS REFERENCE RECORD HAS #
  1933. LXREFWSA = P&lt;SYMBOLTABLE>;#PTR TO SYMBOLTABLE ENTRY FOR LABEL#
  1934. B&lt;12,12>LXREFWSA = " ";#NO SUBLABEL FOR LABEL DEFINITION. #
  1935. COMPLETEXREF:
  1936. B&lt;0,12>LXREFWSA = CURNTSUBLABL; #REFENCED,POINTER TO ENTRY OF#
  1937. B&lt;24,18>LXREFWSA = CURNTLABLPTR;#CURRENT LABEL, AND DISPLAY- #
  1938. LXREFW; #CODED SUBLABEL THAT IS CURRENT. #
  1939. END
  1940. STORECALL:
  1941. IF ERRORFLAG EQ 0 THEN #FLAG MEANING CALLED LABEL IS DEFINED SO#
  1942. BEGIN #INSTRUCTION CAN BE BUILT. #
  1943. SYNSTRUCTION = SYNSTRUCTION + SYMBOLVALUE;
  1944. GOTO ENCODE;
  1945. END
  1946. SYNSTRUCTION = SYMBOLVALUE;#ELSE PUT OUT A POINTER TO LAST PRE- #
  1947. GOTO STORECODE; #VIOUS REFERENCEE TO LABEL. #
  1948. #**********************************************************************#
  1949. SUBLABELCALL:
  1950. SYMBOLVALUE = SUBLABELPTR[SUBLABEL];#EITHER VALUE OR POINTER. #
  1951. IF B&lt;0,1>SYMBOLVALUE EQ 1 THEN #LS 0 MEANS SUBLABEL HAS BEEN #
  1952. BEGIN # DEFINED ALREADY. #
  1953. ERRORFLAG = 0;
  1954. SYMBOLVALUE = -SYMBOLVALUE;
  1955. END
  1956. ELSE #GQ 0 MEANS SUBLABEL IS UNDEFINED. #
  1957. BEGIN
  1958. ERRORFLAG = 1;
  1959. IF SYMBOLVALUE EQ 0 THEN #EQ 0 MEANS SUBLABEL NOT PREVIOUSLY #
  1960. SYMBOLVALUE = -1; #REFERENCED, SO -1 FLAGS END OF CHAIN OF#
  1961. SUBLABELPTR[SUBLABEL] = SYNTBLEWORD + SYNTBLEPARCL + 7;
  1962. END #REFERENCES. SAVE WORD ADDRESS OF LAST #
  1963. #REFERENCE IN SUBLABELPTRS TABLE ENTRY. #
  1964. IF LFLAG NQ 0 THEN #CROSS REFERENCE INFO IS REQUIRED, CON- #
  1965. BEGIN #TAINING PTR TO CURRENT LABEL ENTRY IN #
  1966. LXREFWSA = CURNTLABLPTR;#SYMBOL TABLE, SUBLABEL CALLED, ETC. #
  1967. B&lt;12,12>LXREFWSA = B&lt;0,12>DISPLAYINSTR;
  1968. GOTO COMPLETEXREF;
  1969. END
  1970. GOTO STORECALL;
  1971. #**********************************************************************#
  1972. SUBROUTINE:
  1973. INS$EXT = S"EXTRACT"; #SET UP CALL TO SYNHASH REQUESTING SUB- #
  1974. SYMBOLTYPE = "S"; #ROUTINE"S SWITCH VECTOR POSITION. #
  1975. SYNHASH;
  1976. IF LFLAG NQ 0 THEN #CROSS REFERENCE INFO REQUIRED INCLUDES #
  1977. BEGIN #PTRS TO SYMBOL TABLE ENTRIES FOR SUB- #
  1978. SXREFWSA = P&lt;SYMBOLTABLE>;#ROUTINE AND CURRENT LABEL AND DIS-#
  1979. B&lt;0,12>SXREFWSA = CURNTSUBLABL;#PLAY-CODED SUBLABEL. #
  1980. B&lt;24,18>SXREFWSA = CURNTLABLPTR;
  1981. SXREFW; #WRITE OUT XREF INFO. #
  1982. END
  1983. IF ERRORFLAG NQ 0 THEN #SUBROUTINE WAS NOT DEFINED BY USER TO #
  1984. BEGIN #SUBRBUILD. #
  1985. UNDEFMESS[1] = NAME[0];
  1986. UNDEFMESS[2] = NAME[1];
  1987. UNDEFMESS[3] = NAME[2];
  1988. C&lt;4,6>UNDEFMESS[5] = "SUBROU";
  1989. UNDEFMESS[6] = "TINE.";
  1990. SCALL CHKLINO;
  1991. SYNORL = 65;
  1992. SYNPRNT(UNDEFMESSAGE);
  1993. CHKERRCNT;
  1994.  
  1995. SYNSTRUCTION = SYNSTRUCTION + O"3777";#TO GENERATE A MODE 1 #
  1996. END #ERROR BY STD IF EXECUTED. #
  1997. ELSE SYNSTRUCTION = SYNSTRUCTION + SYMBOLVALUE;
  1998. GOTO ENCODE;
  1999. #**********************************************************************#
  2000. DIAGNOSTIC:
  2001. IF LFLAG NQ 0 THEN #CROSS REFERENCE INFO INCLUDES DISPLAY- #
  2002. BEGIN #CODED DIAGNOSTIC AND SUBLABEL AND PTR #
  2003. B&lt;0,10>DXREFWSA = B&lt;50,10>SYNSTRUCTION; # TO THE CURRENT #
  2004. B&lt;12,18>DXREFWSA = B&lt;6,18>DISPLAYINSTR; # SYNTBLE LABEL"S #
  2005. B&lt;42,18>DXREFWSA = CURNTLABLPTR;#ENTRY IN SYMBOL TABLE. #
  2006. B&lt;30,12>DXREFWSA = B&lt;0,12>CURNTSUBLABL;
  2007. DXREFW; #WRITE OUT XREF INFO #
  2008. END
  2009. GOTO ENCODE;
  2010. #**********************************************************************#
  2011. INPUTEOF: #ALL USER SPECS HAVE BEEN READ FROM FILE#
  2012. ENDINP; # FIX UP LISTING AND REWIND XREF FILES #
  2013. IF UNDEFSYMBOLS NQ 0 OR #FOR EACH UNDEFINED LABEL AND SEMANTIC #
  2014. LFLAG NQ 0 THEN #SUBROUTINE NAME IN THE SOURCE, PRINT #
  2015. BEGIN #OUT DIAGNOSTICS AND REPLACE SYNTBLE #
  2016. SYNSTRUCTION = "03777 ";#CODE REFERENCING THEM WITH AN #
  2017. FOR ITEMP=0 STEP 1 UNTIL 3 DO #INSTRUCTION DESIGNED TO GENER-#
  2018. BEGIN #ATE A MODE 1 ERROR IF STD ATTEMPTS TO #
  2019. J = ITEMP * 15; #EXECUTE IT. #
  2020. FOR I=0 STEP 1 UNTIL 127 DO
  2021. BEGIN
  2022. P&lt;SYMBOLTABLE> = B&lt;J,15>HASHENTRY[I];
  2023. CHKCHAINEND: IF P&lt;SYMBOLTABLE> EQ 0 THEN
  2024. TEST I;
  2025. N = SLENGTH[0] - 1;
  2026. IF NOT SDEFINEBIT[0] THEN #UNDEFINED SYMBOL ENTRY. #
  2027. BEGIN
  2028. IF STYPE[0] EQ O"23" THEN #IF UNDEFINED SUBRTN, #
  2029. GOTO DECUNDEFCNT;#IT HAS ALREADY BEEN TAKEN #
  2030. # CARE OF. #
  2031. UNDEFMESS[1] = SNAME[0];
  2032. IF N GR 0 THEN
  2033. BEGIN
  2034. UNDEFMESS[2] = SNAME[1];
  2035. IF N GR 1 THEN
  2036. UNDEFMESS[3] = SNAME[2];
  2037. ELSE UNDEFMESS[3] = " ";
  2038. END
  2039. ELSE UNDEFMESS[2] = " ";
  2040. UNDEFMESS[5] = "NED LABEL.";
  2041. SCALL CHKLINO;
  2042. SYNORL = 60;
  2043. SYNPRNT(UNDEFMESSAGE);#PRINT OUT DIAGNOSTIC. #
  2044. CHKERRCNT;
  2045. K = SVALUE[0];
  2046. WALKCHAIN;#REPLACE CALLS TO UNDEFINED SYMBOL. #
  2047. DECUNDEFCNT: UNDEFSYMBOLS = UNDEFSYMBOLS - 1;
  2048. IF UNDEFSYMBOLS EQ 0 AND LFLAG EQ 0 THEN
  2049. GOTO PUTLABELPTRS;
  2050. END
  2051. IF LFLAG NQ 0 THEN
  2052. FOR M=54 STEP -6 WHILE
  2053. B&lt;M,6>SNAME[N] EQ O"55" DO
  2054. B&lt;M,6>SNAME[N] = 0;
  2055. P&lt;SYMBOLTABLE> = NEXTPTR[0];#NEXT ENTRY IN CHAIN OF #
  2056. GOTO CHKCHAINEND; #SYNONYMS. #
  2057. END
  2058. END
  2059. END
  2060. PUTLABELPTRS:
  2061. FOR I=0 STEP 1 UNTIL 99 DO #CHECK ANY UNDEFINED SUBLABELS IN THE #
  2062. BEGIN #LAST LABELLED SECTION OF THE TABLE. #
  2063. IF SUBLABELPTR[I] GR 0 THEN
  2064. BEGIN
  2065. UNDEFMESS[1] = CURRENTLABEL[0];
  2066. UNDEFMESS[2] = CURRENTLABEL[1];
  2067. UNDEFMESS[3] = CURRENTLABEL[2];
  2068. ITEMP = I;
  2069. BINTODISPDEC;
  2070. C&lt;0,1>UNDEFMESS[4] = ":";
  2071. B&lt;6,12>UNDEFMESS[4] = B&lt;18,12>CTEMP;
  2072. UNDEFMESS[5] = "NED SUBLAB";
  2073. UNDEFMESS[6] = "EL. ";
  2074. SCALL CHKLINO;
  2075. SYNORL = 65;
  2076. SYNPRNT(UNDEFMESSAGE);
  2077. CHKERRCNT;
  2078. UNDEFMESS[4] = " UNDEFI";#RESTORE BLANKS. #
  2079. K = SUBLABELPTR[I];
  2080. SYNSTRUCTION = "03777 ";
  2081. WALKCHAIN;
  2082. END
  2083. END
  2084. SYNCOM(PROCNAME);
  2085. SYNCOM(" BEGIN
  2086. ");
  2087. IF NOT PTC THEN
  2088. SYNCOM(" XDEF BEGIN
  2089. ");
  2090. ITEMP = LABELCOUNTER; #WRITE OUT LABELPTRS ARRAY AS PRESET, #
  2091. BINTODISPDEC; #WITH ARRAY DECLARATION INFO IN FIRST 2 #
  2092. B&lt;0,30>LABELPTRHDR[2] = B&lt;0,30>CTEMP; #RECORDS. #
  2093. SYNCOM(LABELPTRHEDR);
  2094. SYNCOM(LABELPTRITEM);
  2095. FOR I=1 STEP 1 UNTIL LABELCOUNTER DO #WRITE OUT LBLPTRS ARRAY BY #
  2096. BEGIN #LOOPING. #
  2097. SYNCOM(LABELPTRS);
  2098. P&lt;LABELPTRS> = P&lt;LABELPTRS> + 6;
  2099. END
  2100. SYNCOM(LABELPTRTAIL); #WRITE OUT ARRAY TERMINATION CHARS. #
  2101. IF LASTRANSFER NQ 0 THEN #STORE AN INSTRUCTION IN THE LAST / OF #
  2102. BEGIN #OF THE TABLE WHICH WILL BE A NO-OP. #
  2103. IF SYNTBLEWORD+SYNTBLEPARCL+7-LASTRANSFER LS 4 THEN
  2104. B&lt;0,60>PRESETI[LASTRANSFER-SYNTBLEWORD-6] = "00000 ";
  2105. ELSE
  2106. BEGIN
  2107. SYNTBLR(SCRATCH,LASTRANSFER);
  2108. SCRATCHWD[0] = "00000 ";
  2109. SYNTBLW(SCRATCH,LASTRANSFER);
  2110. END
  2111. END
  2112. ITEMP = COUNTER;
  2113. IF SYNTBLEPARCL NQ 0 THEN #WRITE OUT REMAINING PART-WORD OF CODE,#
  2114. BEGIN #IF ANY. #
  2115. FOR I=SYNTBLEPARCL+1 STEP 1 UNTIL 4 DO
  2116. BEGIN
  2117. PRESET[I] = "00000";
  2118. INSTRUCTCOM[I] = " ";
  2119. END
  2120. BINTODISPOCT; #WORD COUNT IN OCTAL GOES INTO COMMENT. #
  2121. B&lt;24,30>INSTRUCTCOM[0] = B&lt;30,30>OCTAL[1];
  2122. SYNTBLW(INSTRCOMMENT,SYNTBLEWORD);
  2123. SYNTBLEWORD = SYNTBLEWORD + 6;
  2124. SYNTBLW(PRESETCODE,SYNTBLEWORD);
  2125. SYNTBLEWORD = SYNTBLEWORD + 6;
  2126. END
  2127. SYNTBLW(LABELPTRTAIL,SYNTBLEWORD);#WRITE OUT SYNTBLE ARRAY TERM. #
  2128. SYNTBLEWORD = SYNTBLEWORD + 6;
  2129. BINTODISPDEC; #STORE ARRAY SIZE IN ARRAY PRESET #
  2130. SYNTBLR(SCRATCH,1); #DECLARATION. #
  2131. B&lt;30,30>SCRATCHWD[1] = B&lt;0,30>CTEMP;
  2132. SYNTBLW(SCRATCH,1); #WRITE OUT WORD CONTAINING ARRAY SIZE. #
  2133. IF TFLAG NQ 0 THEN #IF TRACEM REQUESTED, WRITE OUT ARRAY #
  2134. BEGIN #TERMINATOR AND STORE ARRAY SIZE INTO #
  2135. IF SYNTBLEPARCL NQ 0 THEN #ARRAY DECLARATION AND SAVE IN THE #
  2136. BEGIN #WSA FOR THE INPUT FILE. #
  2137. FOR I=SYNTBLEPARCL+1 STEP 1 UNTIL 4 DO
  2138. TRACEWSAWD[I] = """NO CODE"",";
  2139. TRACEW;
  2140. END
  2141. FOR I=0 STEP 1 UNTIL 5 DO
  2142. TRACEWSAWD[I] = TRACEMTAILWD[I];
  2143. TRACEW;
  2144. ITEMP = COUNTER*4 + 3;
  2145. BINTODISPDEC;
  2146. B&lt;30,30>TRACEMHDRWD[1] = B&lt;0,30>CTEMP;
  2147. FOR I=0 STEP 1 UNTIL 6 DO
  2148. INWORD[I] = TRACEMHDRWD[I];
  2149. END
  2150. RETURN; #RETURN CONTROL TO SYNCTRL. #
  2151. CONTROL EJECT;
  2152. SWITCH SYNTAXSWCH # #
  2153. SCOLON, #:# # #
  2154. LET, #A# # #
  2155. LET, #B# # #
  2156. LET, #C# # #
  2157. SD, #D# # #
  2158. SE, #E# # #
  2159. LET, #F# # #
  2160. LET, #G# # #
  2161. LET, #H# # #
  2162. LET, #I# # #
  2163. LET, #J# # #
  2164. LET, #K# # #
  2165. LET, #L# # #
  2166. LET, #M# # #
  2167. SN, #N# # #
  2168. SO, #O# # #
  2169. LET, #P# # #
  2170. LET, #Q# # #
  2171. LET, #R# # #
  2172. SS, #S# # #
  2173. LET, #T# # #
  2174. LET, #U# # #
  2175. LET, #V# # #
  2176. LET, #W# # #
  2177. LET, #X# # #
  2178. SY, #Y# # #
  2179. LET, #Z# # #
  2180. DGT, #0# # #
  2181. DGT, #1# # #
  2182. DGT, #2# # #
  2183. DGT, #3# # #
  2184. DGT, #4# # #
  2185. DGT, #5# # #
  2186. DGT, #6# # #
  2187. DGT, #7# # #
  2188. DGT, #8# # #
  2189. DGT, #9# # #
  2190. SPLUS, #+# # #
  2191. SMINUS, #-# # #
  2192. SASK, #*# # #
  2193. SSLASH, #/# # #
  2194. SSPC, #(# # #
  2195. SSPC, #)# # #
  2196. SDSIGN, #$# # #
  2197. SSPC, #=# # #
  2198. SDELIM, # # # #
  2199. SCOMMA, #,# # #003940
  2200. SSPC, #.# # #
  2201. SCOMMENT, #EQUIV# # #
  2202. SSPC, #[# # #
  2203. SSPC, #]# # #
  2204. SCOLON, #:# # #
  2205. SSPC, #"# # #
  2206. SSPC, #_# # #
  2207. SSPC, #!# # #
  2208. SSPC, #&# # #
  2209. SSPC, #'# # #
  2210. SSPC, #?# # #
  2211. SSPC, #&lt;# # #
  2212. SSPC, #># # #
  2213. SSPC, #@# # #
  2214. SSPC, #\# # #
  2215. SSPC, #^# # #
  2216. SSPC; #SEMI-COLON# # #
  2217. SWITCH STTRANSWTCH SYN1ERR,COLON,SYNLBL,SYNSLBL,LBLCALL,LBLSLASH,
  2218. SUBLBLCALL,SUBLBLSLASH,SYNSUBR,SUBR,SUBRSLASH,
  2219. SYNKEY,SYNKEYWRD,SYNKEYWORD,KEYSLASH,SYNDRIVER,
  2220. SYND,SYNDIAG,DIAGSLASH,SYNY,SYNE,SYNS,SYNYES,
  2221. YESSLASH,SYNN,SYNO,SYNNO,NOSLASH,SYNLETTER,
  2222. SYNLETR,SYNCHAR,SYNDIGIT,SUBLLBLCALL,SUBRL,
  2223. SYNLKEYWRD,SYNLDIAG,LBLLCALL,SYNLYES,SYNLNO,
  2224. SYNLREQUEST,SYNREQ,DRIVERSLSH,HYPHENCHECK,
  2225. HYPHEN;
  2226. CONTROL EJECT;
  2227. #**********************************************************************#
  2228. # #
  2229. # LEXICONSCAN #
  2230. # #
  2231. # #
  2232. FUNC LEXICONSCAN B;
  2233. BEGIN
  2234. LEXPTR = B&lt;0,6>NAME[0]; # 1ST CHAR IN WORD IS INDEX. #
  2235. ITEMP = N * 18;
  2236. IF LEXPTR GR O"32" THEN # CHECK FOR SPECIAL CHAR AS 1ST #
  2237. BEGIN
  2238. WRDPTR = B&lt;ITEMP+6,12>LOCWRD[0];#PTR TO 1ST ENTRY IN SPEC CHR#
  2239. ENTRIES = B&lt;ITEMP,6>LOCWRD[0];#NR ENTRIES IN SPEC CHAR SET. #
  2240. GOTO SCNLEXWRD;
  2241. END
  2242. WRDPTR = B&lt;ITEMP+6,12>LOCWRD[LEXPTR];#PTR TO 1ST ENTRY IN CHAR ST#
  2243. ENTRIES = B&lt;ITEMP,6>LOCWRD[LEXPTR];#NR ENTRIES IN THIS CHAR SET. #
  2244. SCNLEXWRD:
  2245. FOR I=1 STEP 1 UNTIL ENTRIES DO # SEARCH CHAR SET FOR MATCH WITH#
  2246. BEGIN # THE SOURCE WORD IN NAME. #
  2247. IF LEXWRD[WRDPTR] EQ NAME[0] THEN
  2248. BEGIN
  2249. IF N LS 1 THEN
  2250. GOTO SCANEXIT;
  2251. IF LEXWRD[WRDPTR + 1] EQ NAME[1] THEN
  2252. BEGIN
  2253. IF N LS 2 THEN
  2254. GOTO SCANEXIT;
  2255. IF LEXWRD[WRDPTR + 2] EQ NAME[2] THEN
  2256. BEGIN
  2257. SCANEXIT:
  2258. LEXICONSCAN = TRUE;
  2259. RETURN;
  2260. END
  2261. END
  2262. END
  2263. WRDPTR = WRDPTR + 2 + N; # INCREMENT PTR TO NEXT ENTRY. #
  2264. END
  2265. LEXICONSCAN = FALSE;
  2266. RETURN;
  2267. END
  2268. #**********************************************************************#
  2269. SYNSCAN: #............................................................#
  2270. IF CHRPTR LS LASTCHAR THEN # CHECK FOR NEED TO READ A NEW #
  2271. GOTO STARTSTATE; # SOURCE RECORD. IF NOT GOTO THE#
  2272. # SYNTAX CRACKER. #
  2273. CHRPTR = 0; # #
  2274. READSYNTAX: # #
  2275. SYNREAD; # READ A NEW SOURCE RECORD. #
  2276. IF SYNEOF GR 0 THEN # IF EOF REACHED GOTO WRAP-UP. #
  2277. GOTO INPUTEOF; # #
  2278. IF FIRSTCHAR GR 0 THEN # IF COMMENT FROM PREVIOUS #
  2279. BEGIN # RECORD NOT ENDED, THEN SEARCH #
  2280. BP = -6; # FOR ENDING DELIMITER. #
  2281. I = -1; # #
  2282. WRDPTR = 0; # #
  2283. GOTO CNTCMNT; # #
  2284. END # #
  2285. FOR WRDPTR=0 STEP 1 UNTIL 6 DO # SKIP ANY CARDS WITH 72 LEADING#
  2286. IF INWORD[WRDPTR] NQ " " THEN # BLANKS. #
  2287. GOTO BREAKUP;
  2288. IF C&lt;0,2>INWORD[7] NQ " " THEN
  2289. GOTO BREAKUP;
  2290. GOTO READSYNTAX; # GET NEXT SOURCE RECORD. #
  2291. BREAKUP:
  2292. IF INWORD[0] EQ "END " THEN GOTO INPUTEOF;
  2293. IF INWORD[0] EQ "+ " THEN
  2294. BEGIN
  2295. PTC = TRUE;
  2296. GOTO INPUTEOF;
  2297. END
  2298. FOR BP=0 STEP 6 DO # LOCATE 1ST NON-BLANK CHARACTER#
  2299. IF B&lt;BP,6>INWORD[WRDPTR] NQ O"55" THEN #IN THE INPUT RECORD. #
  2300. GOTO GETFIRSTCHAR;
  2301. GETFIRSTCHAR:
  2302. FOR I=BP/6+WRDPTR*10 STEP 1 UNTIL 71 DO #1ST 72 CHARS OF RECORD #
  2303. BEGIN # ARE SCANNED. #
  2304. ITEMP = B&lt;BP,6>INWORD[WRDPTR];# #
  2305. GOTO SYNTAXSWCH[ITEMP]; # DISPLAY VALUE IS INDEX. #
  2306. STORECHAR: # #
  2307. FIRSTCHAR = 0; # #
  2308. CHAR[CHRPTR] = ITEMP; # STORE CHAR IN SYNCHARS. #
  2309. CHRPTR = CHRPTR + 1; # #
  2310. NEXTCHAR: # #
  2311. IF BP GR 53 THEN # INCREMENT PTRS TO NEXT SOURCE #
  2312. BEGIN # CHARACTER. #
  2313. BP = 0; # #
  2314. WRDPTR = WRDPTR + 1; # #
  2315. END # #
  2316. ELSE BP = BP + 6; # #
  2317. END # #
  2318. LASTOFRECORD: # #
  2319. LASTCHAR = CHRPTR; # PTR TO LAST SOURCE CHAR IN #
  2320. # SYNCHARS. #
  2321. IF CHRPTR EQ 0 THEN # IF NO SIGNIFICANT CHARS ON #
  2322. GOTO READSYNTAX; # CARD, GO GET NEXT RECORD. #
  2323. CHRPTR = 0; # #
  2324. STATLIST[LASTCHAR] = S"COMA"; # LAST CHAR ALWAYS A DELIMITER. #
  2325. GOTO STARTSTATE; # GOTO SYNTAX CRACKER. #
  2326. SCOMMA: # #003960
  2327. IF CHRPTR GQ 2 # A COMMA CAN BE EITHER A # DL3A018
  2328. AND (CHAR[CHRPTR-2] EQ " " OR # KEYWORD OR A DELIMITER. # DL3A018
  2329. CHAR[CHRPTR-2] EQ "/" OR
  2330. CHAR[CHRPTR-2] EQ ":" OR
  2331. CHAR[CHRPTR-2] EQ "," ) # TEST PRIOR 2 CHARS FOR KEYWORD# DL3A018
  2332. AND (CHAR[CHRPTR-1] EQ "$" OR # CONSTRUCTS, I.E. A DELIMITER # DL3A018
  2333. CHAR[CHRPTR-1] EQ "-" ) # FOLLOWED BY $ OR -. IF FOUND, # DL3A018
  2334. THEN GOTO SSPC; # TREAT AS KEYWORD SPECIAL CHAR.# DL3A018
  2335. # (SIMILAR TEST IS AT SCOMMENT) # DL3A018
  2336. IF CHRPTR EQ 1
  2337. AND (CHAR[CHRPTR-1] EQ "$" OR #JUST REST FOR $ OR -, AS ABOVE#
  2338. CHAR[CHRPTR-1] EQ "-" )
  2339. THEN GOTO SSPC;
  2340. GOTO SDELIM; # ELSE, COMMA IS A SYNGEN DELIM.#004000
  2341. SSPC: # #
  2342. STATLIST[CHRPTR] = S"SPC"; # STORE STATUS VALUE. #
  2343. GOTO STORECHAR; # #
  2344. DGT: # #
  2345. STATLIST[CHRPTR] = S"DIGIT"; # #
  2346. GOTO STORECHAR; # #
  2347. SCOLON: # #
  2348. IF CHRPTR GQ 2 # A COLON CAN BE EITHER A #
  2349. AND (CHAR[CHRPTR-2] EQ " " OR # KEYWORD OR A DELIMITER. #
  2350. CHAR[CHRPTR-2] EQ "/" OR # #
  2351. CHAR[CHRPTR-2] EQ ":" OR # #
  2352. CHAR[CHRPTR-2] EQ "," ) # TEST PRIOR 2 CHARS FOR KEYWORD#
  2353. AND (CHAR[CHRPTR-1] EQ "$" OR # CONSTRUCTS, I.E. A DELIMITER #
  2354. CHAR[CHRPTR-1] EQ "-" ) # FOLLOWED BY $ OR -. IF FOUND, #
  2355. THEN GOTO SSPC; # TREAT AS KEYWORD SPECIAL CHAR.#
  2356. # (SIMILAR TEST IS AT SCOMMENT) #
  2357. IF CHRPTR EQ 1 # IF ONLY 1 PRIOR CHAR, #
  2358. AND (CHAR[CHRPTR-1] EQ "$" OR # JUST TEST FOR $ OR -, AS ABOVE#
  2359. CHAR[CHRPTR-1] EQ "-" ) # #
  2360. THEN GOTO SSPC; # #
  2361. IF STATLIST[CHRPTR-1] EQ S"COMA" THEN #COLON IS A DELIMITER, SO #
  2362. CHRPTR = CHRPTR - 1; # PRECEDING BLANK OR COMMA IS #
  2363. # OVERLAID. #
  2364. STATLIST[CHRPTR] = S"COLN"; # #
  2365. GOTO STORECHAR; # #
  2366. SASK: # #
  2367. STATLIST[CHRPTR] = S"ASK"; # #
  2368. GOTO STORECHAR; # #
  2369. SSLASH: # #
  2370. STATLIST[CHRPTR] = S"SLSH"; # #
  2371. IF CHRPTR GR 0 AND # / CAN BE A KEYWORD TOO. #
  2372. STATLIST[CHRPTR-1] GR S"ASK" AND
  2373. STATLIST[CHRPTR-1] LS S"PLUS" THEN
  2374. BEGIN
  2375. IF CHRPTR GR 1 AND
  2376. STATLIST[CHRPTR-2] GQ S"ASK" THEN
  2377. GOTO STORECHAR;
  2378. STATLIST[CHRPTR] = S"LETTER";
  2379. END
  2380. GOTO STORECHAR; # #
  2381. SDSIGN: # #
  2382. STATLIST[CHRPTR] = S"DSGN"; # #
  2383. GOTO STORECHAR; # #
  2384. SMINUS: # #
  2385. STATLIST[CHRPTR] =S"MINUS"; # #
  2386. GOTO STORECHAR; # #
  2387. SPLUS: # #
  2388. STATLIST[CHRPTR] = S"PLUS"; # #
  2389. GOTO STORECHAR; # #
  2390. SD: # #
  2391. STATLIST[CHRPTR] = S"D"; # #
  2392. GOTO STORECHAR; # #
  2393. SY: # #
  2394. STATLIST[CHRPTR] = S"Y"; # #
  2395. GOTO STORECHAR; # #
  2396. SE: # #
  2397. STATLIST[CHRPTR] = S"E"; # #
  2398. GOTO STORECHAR; # #
  2399. SS: # #
  2400. STATLIST[CHRPTR] = S"S"; # #
  2401. GOTO STORECHAR; # #
  2402. SN: # #
  2403. STATLIST[CHRPTR] = S"N"; # #
  2404. GOTO STORECHAR; # #
  2405. SO: # #
  2406. STATLIST[CHRPTR] = S"O"; # #
  2407. GOTO STORECHAR; # #
  2408. LET: # #
  2409. STATLIST[CHRPTR] = S"LETTER"; # #
  2410. GOTO STORECHAR; # #
  2411. SDELIM: # #
  2412. IF FIRSTCHAR LS 0 THEN # IF DELIMITER PRECEDED THEN #
  2413. GOTO NEXTCHAR; # SKIP THIS ONE. #
  2414. IF CHRPTR EQ 0 THEN # IF COMMENT STARTED THIS CARD, #
  2415. GOTO NEXTCHAR; # SKIP BLANKS AFTER COMMENT. #
  2416. IF STATLIST[CHRPTR-1] LS S"ASK" THEN #/ AND : ARE DELIMITERS TOO,#
  2417. GOTO SLASHDELIM; # IGNORE FOLLOWING BLANKS AND #
  2418. # COMMAS. #
  2419. CHAR[CHRPTR] = ","; # STORE A COMMA. ALL DELIMITERS #
  2420. # ARE CONVERTED TO COMMAS. #
  2421. STATLIST[CHRPTR] = S"COMA"; # STORE STATUS VALUE OF CORRESP #
  2422. # ONDING ENTRY IN SYNCHARS. #
  2423. CHRPTR = CHRPTR + 1; # SET INDEX TO NEXT ARRAY ENTRY.#
  2424. SLASHDELIM:
  2425. FIRSTCHAR = -1; # INDICATES PRECEDING CHAR WAS A#
  2426. GOTO NEXTCHAR; # DELIMITER. #
  2427. SCOMMENT: # #
  2428. IF CHAR[CHRPTR-1] EQ "$" OR # CHECK IF THE PREVIOUS CHAR #
  2429. CHAR[CHRPTR-1] EQ "-" THEN # INDICATES A KEYWORD. IF KEYWRD#
  2430. GOTO EQUIV; # STORE CHARACTER. OTHERWISE A #
  2431. CNTCMNT: # COMMENT IS INDICATED. SCAN IN-#
  2432. FOR I=I+1 STEP 1 UNTIL 71 DO # PUT UNTIL TERMINATING COMMENT #
  2433. BEGIN # DELIMITER FOUND. #
  2434. IF BP GR 53 THEN # INCREMENT PTRS TO NEXT SOURCE #
  2435. BEGIN # CHARACTER. #
  2436. BP = 0; # #
  2437. WRDPTR = WRDPTR + 1; # #
  2438. END # #
  2439. ELSE BP = BP + 6; # #
  2440. ITEMP = B&lt;BP,6>INWORD[WRDPTR];# #
  2441. IF ITEMP EQ O"60" THEN # IF SOURCE CHAR IS ENDING DE- #
  2442. BEGIN # LIMITER THEN TURN OFF COMMENT #
  2443. FIRSTCHAR = 0; # FLAG AND CONTINUE SCAN. #
  2444. GOTO NEXTCHAR; # #
  2445. END # #
  2446. END # #
  2447. FIRSTCHAR = 1; # FLAG INDICATING THAT COMMENT #
  2448. # SPANS RECORD BOUNDARY. #
  2449. GOTO LASTOFRECORD; # #
  2450. EQUIV: # #
  2451. STATLIST[CHRPTR] = S"LETTER"; # #
  2452. GOTO STORECHAR; # #
  2453. STARTSTATE: # #
  2454. IF STATE EQ 13 THEN # CHECK ENDING SLASH LAST TIME. #
  2455. BEGIN # #
  2456. SLASHOP:
  2457. SYNSTRUCTION = O"60000"; # SET THE OPERATOR FIELD. #
  2458. DISPLAYINSTR = "/"; # STORE A SLASH. #
  2459. IF STATLIST[CHRPTR] LS S"ASK" THEN
  2460. BEGIN
  2461. IF STATLIST[CHRPTR] EQ S"COLN" THEN
  2462. STATE = 1;
  2463. ELSE STATE = 2;
  2464. CHRPTR = CHRPTR + 1;
  2465. GOTO SLASH;
  2466. END
  2467. STATE = 2;
  2468. GOTO SLASH; # GOTO SLASH PROCESSING SECTION #
  2469. # OF SYNGEN. #
  2470. END # #
  2471. NAME[0] = " "; # BLANK FILL NAME. #
  2472. NAME[1] = " "; # BLANK FILL NAME. #
  2473. NAME[2] = " "; # BLANK FILL NAME. #
  2474. NAME[3] = " "; # BLANK FILL NAME. #
  2475. CHARIND = 0; # ZERO OUT CHAR/NUM INDICATOR. #
  2476. M = -6; # INITIALIZE BIT POINTER. #
  2477. N = 0; # SET WORD PTR TO 0. #
  2478. GOTO STTRANSWTCH[SWITCHVALUE[STATLIST[CHRPTR],STATE]];
  2479. SYNLBL: # #
  2480. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2481. IF CHARIND GR 0 AND CHARIND # CHECK IF THE LABEL HAS AN #
  2482. NQ 2 THEN # ALPHA CHARACTER. #
  2483. BEGIN # #
  2484. IF LEXICONSCAN THEN # CHECK IF LABEL HAS THE SAME NAME #
  2485. # AS A KEYWORD. #
  2486. BEGIN
  2487. WRDPTR = WRDPTR + N + 1; # SET PTR TO LEXSYNSECT. #
  2488. IF LEXSYNSECT[WRDPTR] EQ -1 THEN
  2489. LEXSYNSECT[WRDPTR] = LABELCOUNTER + 1;
  2490. END
  2491. SYMBOLLENGTH = N + 1; # STORE THE LENGTH OF LABEL IN #
  2492. DISPLAYINSTR = NAME[0]; # STORE FIRST 7 CHARS OF LABEL #
  2493. GOTO LABELS; # WORDS. PASS CONTROL. #
  2494. END # #
  2495. GOTO SYN1ERR; # UNRECONIZABLE STATEMENT. #
  2496. SYNSLBL: # #
  2497. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2498. STATE = 2;
  2499. IF CHARIND EQ 2 THEN # CHECK IF SUBLABEL IS ALL DIGIT#
  2500. IF M LS 7 AND N EQ 0 THEN # CHECK IF SUBLABEL IS LESS THAN#
  2501. BEGIN # 3 CHARACTERS. #
  2502. CTEMP = NAME[0]; # ENTRY CONDITION FOR DISPLAY- #
  2503. # TOBIN #
  2504. DISPLAYTOBIN; # CONVERT THE VALUE IN CTEMP TO #
  2505. # BINARY INTEGER. #
  2506. SYNSTRUCTION = O"60000"; # SET OPERATOR CODE TO 6. #
  2507. SUBLABEL = ITEMP; # STORE THE BINARY INTEGER VALUE#
  2508. B&lt;0,6>DISPLAYINSTR = ":"; # STORE : AND THE SUBLABEL NAME.#
  2509. C&lt;1,6>DISPLAYINSTR = NAME[0];
  2510. GOTO SUBLABELS; # PASS CONTROL BACK TO SYNBUILD.#
  2511. END # #
  2512. GOTO SYN1ERR; # UNRECONIZABLE STATEMENT. #
  2513. LBLSLASH: # #
  2514. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2515. GOTO LBL1CALL; # #
  2516. LBLLCALL:
  2517. STATE = 1; # COLON WAS ENDING DELIMITER. #
  2518. GOTO LBL1CALL;
  2519. LBLCALL: # #
  2520. STATE = 2; # #
  2521. LBL1CALL: # #
  2522. SYMBOLLENGTH = N + 1; # STORE LENGTH OF LABEL IN WORDS#
  2523. SYNSTRUCTION = O"24000"; # SET THE OPERATOR FIELD TO 5. #
  2524. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2525. DISPLAYINSTR = NAME[0]; # STORE THE NAME OF THE LABEL. #
  2526. GOTO LABELCALL; # #
  2527. NOSLASH: # #
  2528. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2529. GOTO SYN1NO; # #
  2530. SYNLNO:
  2531. STATE = 1; # COLON WAS ENDING DELIMITER. #
  2532. GOTO SYN1NO;
  2533. SYNNO: # #
  2534. STATE = 2; # #
  2535. SYN1NO: # #
  2536. SYNSTRUCTION = 2; # SET OPERAND FIELD TO 2. #
  2537. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2538. DISPLAYINSTR = NAME[0]; # STORE NO. #
  2539. GOTO DRIVERREQ; # PASS CONTROL. #
  2540. YESSLASH: # #
  2541. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2542. GOTO SYN1YES; # #
  2543. SYNLYES:
  2544. STATE = 1; # COLON WAS WNDING DELIMITER. #
  2545. GOTO SYN1YES;
  2546. SYNYES: # #
  2547. STATE = 2; # #
  2548. SYN1YES: # #
  2549. SYNSTRUCTION = 1; # SET OPERAND FIELD TO 1. #
  2550. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2551. DISPLAYINSTR = NAME[0]; # STORE YES. #
  2552. GOTO DRIVERREQ; # PASS CONTROL. #
  2553. SUBLLBLCALL:
  2554. STATE = 1; # COLON WAS ENDING DELIMITER. #
  2555. GOTO SUBLBLCALL;
  2556. SUBLBLSLASH: # #
  2557. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2558. IF M LS 0 THEN
  2559. GOTO SLASHOP;
  2560. SUBLBLCALL: # #
  2561. IF M LS 0 THEN # IGNORE CONTIGUOUS DELIMITERS. #
  2562. GOTO SYN1CHAR; # #
  2563. IF M GR 6 OR N GR 0 THEN # IF SUBLABEL EXCEEDS 2 CHARS - #
  2564. GOTO SYN1ERR; # UNRECONIZABLE STATEMENT. #
  2565. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2566. CTEMP = NAME[0]; # ENTRY CONDITION FOR DISPLAYTO-#
  2567. # BIN. #
  2568. DISPLAYTOBIN; # CONVERT THE VALUE IN CTEMP TO #
  2569. # BINARY INTEGER. #
  2570. SUBLABEL = ITEMP; # STORE THE BINARY VALUE OF THE #
  2571. # SUBLBL NAME. #
  2572. SYNSTRUCTION = O"40000"; # SET THE HIGH ORDER BIT OF THE #
  2573. # THE OPERATOR FIELD. #
  2574. DISPLAYINSTR = NAME[0]; # STORE SUBLABEL NAME. #
  2575. GOTO SUBLABELCALL; # PASS CONTROL. #
  2576. DIAGSLASH: # #
  2577. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2578. GOTO SYN1DIAG; # #
  2579. SYNLDIAG:
  2580. STATE = 1; # COLON WAS ENDING DELIMITER. #
  2581. GOTO SYN1DIAG;
  2582. SYNDIAG: # #
  2583. STATE = 2; # RESET STATE. #
  2584. SYN1DIAG: # #
  2585. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2586. IF M GR 18 OR N GR 0 THEN # IF THE DIAG NUMBER EXCEEDS #
  2587. GOTO SYN1ERR; # THAN 3 NUMBERS, ISSUE ERROR. #
  2588. CTEMP = " ";
  2589. B&lt;0,M>CTEMP = B&lt;6,M>NAME[0]; # ENTRY CONDITION FOR #
  2590. # DISPLAYTOBIN. #
  2591. DISPLAYTOBIN; # CONVERT THE VALUE IN CTEMP TO #
  2592. # BINARY INTEGER. #
  2593. SYNSTRUCTION = ITEMP LOR O"4000";# STORE A 2 IN THE OPERATOR #
  2594. # FIELD AND THE BINARY VALUE OF #
  2595. # THE DIAGNOSTIC NUMBER IN THE #
  2596. # OPERAND FIELD. #
  2597. DISPLAYINSTR = NAME[0]; # STORE DIAGNOSTIC. #
  2598. GOTO DIAGNOSTIC; # PASS CONTROL. #
  2599. SUBRSLASH: # #
  2600. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2601. GOTO SUBR1; # #
  2602. SUBRL:
  2603. STATE = 1; # COLON WAS ENDING DELIMITER. #
  2604. GOTO SUBR1;
  2605. SUBR: # #
  2606. STATE = 2; # RESET STATE. #
  2607. SUBR1: # #
  2608. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2609. IF N*60+M GR 66 OR # CHECK FOR SUBROUTINE NAME > 12#
  2610. M LS 0 THEN # CHARS OR &lt; 1 CHAR IN LENGTH. #
  2611. GOTO SYN1ERR; # #
  2612. SYMBOLLENGTH = N + 1; # STORE LENGTH OF SUBROUTINE IN #
  2613. # WORDS. #
  2614. SYNSTRUCTION = O"10000"; # SET OPERATOR TO 2. #
  2615. B&lt;0,6>DISPLAYINSTR = O"47"; # STORE AN ASK. #
  2616. C&lt;1,6>DISPLAYINSTR = NAME[0]; # 1ST 6 CHARS OF SUBROUTINE NAME#
  2617. GOTO SUBROUTINE; # PASS CONTROL. #
  2618. COLON: # #
  2619. STATE = 1; # RESET STATE. #
  2620. GOTO SYN1CHAR; # CHECK NEXT CHARACTER. #
  2621. SYNY: # #
  2622. STATE = 12; # #
  2623. GOTO SYNCHAR; # #
  2624. SYNE: # #
  2625. STATE = 8; # #
  2626. GOTO SYNCHAR; # #
  2627. SYNS: # #
  2628. STATE = 9; # #
  2629. GOTO SYNCHAR; # #
  2630. SYNN: # #
  2631. STATE = 10; # #
  2632. GOTO SYNCHAR; # #
  2633. SYNO: # #
  2634. STATE = 11; # #
  2635. GOTO SYNCHAR; # #
  2636. SYNKEY: # #
  2637. SYNSTRUCTION = O"14000"; # SET THE OPERATOR FIELD TO 3. #
  2638. GOTO KEYCOMMON;
  2639. SYNKEYWRD: # #
  2640. SYNSTRUCTION = O"20000"; # SET THE OPERATOR FIELD TO 4. #
  2641. KEYCOMMON: # CODE COMMON TO BOTH $ AND - #
  2642. STATE = 4; # KEYWORDS. #
  2643. B&lt;0,6>DISPLAYINSTR = B&lt;0,6>CHAR[CHRPTR];# SAVE $ OR - . #
  2644. GOTO SYN1CHAR; # #
  2645. HYPHENCHECK:
  2646. IF M LS 0 THEN # LABELS MAY NOT HAVE A HYPHEN #
  2647. GOTO SYN1ERR; # AS THE FIRST CHARACTER NOR AS #
  2648. IF STATLIST[CHRPTR+1] EQ S"COLN" THEN #THE LAST CHARACTER. #
  2649. GOTO SYN1ERR;
  2650. SYNLETTER: # #
  2651. CHARIND = CHARIND LOR 1; # LOGICAL OR TO INDICATE ALPHA. #
  2652. SYNCHAR: # #
  2653. IF M EQ 54 THEN # SET WORD AND BIT POINTERS (N #
  2654. BEGIN # AND M) TO THE NEXT CHARACTER #
  2655. M = 0; # IN THE STRING BEING STORED IN #
  2656. N = N + 1; # "NAME". #
  2657. END # #
  2658. ELSE M = M + 6; # #
  2659. IF N GR 2 THEN # CHECK FOR A NAME EXCEEDING 30 #
  2660. GOTO SYN1ERR; # CHARACTERS. #
  2661. B&lt;M,6>NAME[N] = B&lt;0,6>CHAR[CHRPTR];# STORE CHARACTER IN NAME. #
  2662. SYN1CHAR: # #
  2663. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2664. GOTO STTRANSWTCH[SWITCHVALUE[STATLIST[CHRPTR],STATE]];
  2665. HYPHEN:
  2666. IF STATLIST[CHRPTR+1] LQ S"SLSH" THEN #LABELS MAY CONTAIN HYPHENS#
  2667. GOTO SYN1ERR; # THO NOT AS 1ST OR LAST CHARS. #
  2668. SYNLETR: # #
  2669. STATE = 7; # #
  2670. GOTO SYNCHAR; # #
  2671. SYNDIGIT: # #
  2672. CHARIND = CHARIND LOR 2; # LOGICAL OR TO INDICATE NUMERIC#
  2673. GOTO SYNCHAR; # #
  2674. # #
  2675. SYND: # #
  2676. STATE = 6; # #
  2677. GOTO SYNCHAR; # #
  2678. SYNSUBR: # #
  2679. STATE = 3; # #
  2680. IF STATLIST[CHRPTR+1] EQ S"DIGIT" THEN # 1ST CHAR IN A ROUTINE #
  2681. GOTO SYN1ERR; # NAME MUST BE ALPHABETIC. #
  2682. GOTO SYN1CHAR; # #
  2683. SYN1ERR:
  2684. P&lt;SERR> = LOC(USTATE);
  2685. GOTO ERROREXIT;
  2686. SYN4ERR:
  2687. P&lt;SERR> = LOC(UKEY);
  2688. GOTO ERROREXIT;
  2689. SYN5ERR:
  2690. P&lt;SERR> = LOC(UACT);
  2691. ERROREXIT:
  2692. FOR CHRPTR=CHRPTR STEP 1 UNTIL LASTCHAR DO
  2693. BEGIN
  2694. I = STATLIST[CHRPTR];
  2695. IF I LS 1 THEN
  2696. BEGIN
  2697. STATE = 1;
  2698. GOTO PRINTDMSG;
  2699. END
  2700. IF I LS 2 THEN
  2701. BEGIN
  2702. STATE = 2;
  2703. GOTO PRINTDMSG;
  2704. END
  2705. IF I LS 3 THEN
  2706. BEGIN
  2707. STATE = 13;
  2708. GOTO PRINTDMSG;
  2709. END
  2710. IF M EQ 54 THEN
  2711. BEGIN
  2712. N = N + 1;
  2713. M = 0;
  2714. END
  2715. ELSE M = M + 6;
  2716. B&lt;M,6>NAME[N] = B&lt;0,6>CHAR[CHRPTR];
  2717. END
  2718. STATE = 2;
  2719. PRINTDMSG:
  2720. CHRPTR = CHRPTR + 1;
  2721. SYNERROR[4] = NAME[0];
  2722. SYNERROR[5] = NAME[1];
  2723. SYNERROR[6] = NAME[2];
  2724. SYNERROR[7] = NAME[3];
  2725. IF LFLAG EQ 0 THEN
  2726. BEGIN
  2727. SCALL CHKLINO;
  2728. SYNORL = SYNIRL;
  2729. SYNPRNT(SYNIWSA);
  2730. END
  2731. SCALL CHKLINO;
  2732. SYNORL = 80;
  2733. SYNPRNT(SERR);
  2734. CHKERRCNT;
  2735. GOTO SYNSCAN; # TRY TO FIND A LEGAL SOURCE WD.#
  2736. SYNLKEYWRD:
  2737. STATE = 1;
  2738. GOTO SYN1KEYWRD;
  2739. KEYSLASH: # #
  2740. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2741. GOTO SYN1KEYWRD;
  2742. SYNKEYWORD: # #
  2743. STATE = 2;
  2744. SYN1KEYWRD:
  2745. IF NOT LEXICONSCAN THEN # IF NAME IS NOT A KEY WORD THEN#
  2746. GOTO SYN4ERR;
  2747. CHRPTR = CHRPTR + 1; # INCREMENT PTR TO NEXT CHAR. #
  2748. SYNSTRUCTION = SYNSTRUCTION + B&lt;4,11>LEXWRD[WRDPTR+N+1];
  2749. N = NAME[0];
  2750. IF NAME[0] EQ ";" THEN # SPELL OUT SPECIAL CHARS THAT #
  2751. N = "SEMICOLON "; # WILL CLOBBER SYMPL COMPILATION#
  2752. ELSE IF NAME[0] EQ """" THEN
  2753. N = "NOTEQUAL ";
  2754. ELSE IF NAME[0] EQ "#" THEN
  2755. N = "EQUIVALENC";
  2756. B&lt;6,36>DISPLAYINSTR = B&lt;0,36>N;
  2757. GOTO DRIVERREQ; # GOTO DRIVERREQ IN SYNBUILD. #
  2758. SYNDRIVER:
  2759. STATE = 5; # SET STATE FOR DRIVER REQUEST. #
  2760. GOTO SYN1CHAR;
  2761. SYNREQ:
  2762. STATE = 2;
  2763. SYN1REQUEST:
  2764. FOR I=0 STEP 2 UNTIL 40 DO # SCAN PRESET ARRAY CONTAINING #004020
  2765. BEGIN # DRIVER REQUESTS FOR A MATCH. #
  2766. IF NAME[0] EQ SYNR[I] THEN # EACH WRD FOLLOWING THE DRIVER #
  2767. BEGIN # REQUEST CONTAINS THE CORRESPON#
  2768. SYNSTRUCTION = REQSTRUCTION[I]; # DING OPERATOR AND #
  2769. CHRPTR = CHRPTR + 1; # OPERAND WHEN A MATCH IS FOUND #
  2770. B&lt;0,6>DISPLAYINSTR = O"45";#STORE + AND DRIVER REQUEST IN#
  2771. B&lt;6,36>DISPLAYINSTR = B&lt;0,36>NAME[0];# DISPLAYINSTR. #
  2772. GOTO DRIVERREQ; # STORE THE OPERATOR AND OPERAND#
  2773. END
  2774. END
  2775. GOTO SYN5ERR; # DRIVER REQ WAS NOT FOUND. #
  2776. DRIVERSLSH:
  2777. STATE = 13; # STATE FOR SLASH TERMINATOR. #
  2778. GOTO SYN1REQUEST;
  2779. SYNLREQUEST:
  2780. STATE = 1;
  2781. GOTO SYN1REQUEST;
  2782. END
  2783. CONTROL EJECT;
  2784. #**********************************************************************#
  2785. # #
  2786. # SYNXREF #
  2787. # #
  2788. #ROUTINE WHICH SORTS THE CROSS REFERENCE LISTS, FORMATS THEM AND WRITES#
  2789. #THEM ON THE SYSTEM OUTPUT FILE. #
  2790. # #
  2791. #ENTRY CONDITIONS: #
  2792. # THE THREE CROSS REFERENCE FILES - LXREF, DXREF, AND SXREF - MUST BE #
  2793. # POSITIONED TO BOI. #
  2794. #EXTERNAL REFERENCES: #
  2795. # LXREFR, DXREFR, AND SXREFR ARE COMPASS ROUTINES WHICH READ RECORDS #
  2796. # FROM THE LXREF, DXREF, AND SXREF FILES. #
  2797. # #
  2798. #EXIT CONDITIONS: #
  2799. # THE THREE SORTED CROSS REFERENCE LISTS WILL BE WRITTEN ON THE SYSTEM#
  2800. # OUTPUT FILE. #
  2801. # #
  2802. #ERROR CONDITIONS: #
  2803. # NONE #
  2804. # #
  2805. PROC SYNXREF;
  2806. BEGIN
  2807. P&lt;SORT> = NEXTAVAIL[51]; #BASE OF SORTING SPACE IS FIRST AVAIL- #
  2808. #ABLE WORD IN THE FIELD LENGTH. #
  2809. SORTFL = LASTAVAIL - P&lt;SORT>; #FL AVAILABLE FOR SORTING #
  2810. SYNEOF = 0; #TURN OFF EOF FLAG. #
  2811. FOR N=0 STEP 1 UNTIL SORTFL DO #READ ENTIRE FILE INTO CORE. IT #
  2812. BEGIN #MUST ALL FIT INTO CORE ELSE PUNT. #
  2813. DXREFR(LOC(SORTWORD[N]));
  2814. IF SYNEOF NQ 0 THEN #SYNEOF SET TO 1 WHEN EOF READ. #
  2815. GOTO SORTDXREF;
  2816. END
  2817. IF SYNEOF EQ 0 THEN #ABORT IF DIAGNOSTICS FILE CANNOT ALL BE#
  2818. SYNABT(0); #READ INTO CORE. #
  2819. SORTDXREF:
  2820. # SORT USING SHELL SORT ALGORITHM. #
  2821. N = N - 1;
  2822. M = N;
  2823. NEXTINTERVAL:
  2824. M = M/2;
  2825. IF M EQ 0 THEN
  2826. GOTO PRTDXREF;
  2827. K = N - M;
  2828. FOR J=0 STEP 1 UNTIL K DO
  2829. BEGIN
  2830. I = J;
  2831. BACKTRACK:
  2832. L = I + M;
  2833. IF B&lt;0,10>SORTWORD[I] LQ B&lt;0,10>SORTWORD[L] THEN
  2834. TEST J;
  2835. LABELCOUNTER = SORTWORD[I];#SWAP LIST ELEMENTS, PUTTING THE #
  2836. SORTWORD[I] = SORTWORD[L];#SMALLER FIRST IN THE LIST. #
  2837. SORTWORD[L] = LABELCOUNTER;
  2838. IF I GQ M THEN #SWAP REQUIRES BACKTRACKING. #
  2839. BEGIN
  2840. I = I - M;
  2841. GOTO BACKTRACK;
  2842. END
  2843. END
  2844. GOTO NEXTINTERVAL; #IF THRU WITH THIS SEGMENT, SORT NEW #
  2845. # SEGMENT. #
  2846. PRTDXREF:
  2847. HDRTITLE[0] = "DIAGNOSTIC CROSS REFERENCE ";
  2848. SCALL PRNTHDR;
  2849. SYNORL = 38; #ERENCE LISTING. #
  2850. SYNPRNT(DXREFHEADER2);
  2851. SYNORL = 8;
  2852. SYNPRNT(SKIPLINE);
  2853. LINENO = 2; #COMPENSATE FOR EXTRA HEADER #
  2854. FOR I=0 STEP 1 UNTIL 3 DO #BLANK OUT SCRATCH STORAGE FOR USE AS #
  2855. SCRATCHWD[I] = " "; #A PRINT LINE STORAGE AREA. #
  2856. IF N LS 0 THEN #IF NO DIAGNOSTICS THEN PRINT THE WORD #
  2857. BEGIN # NONE. #
  2858. SYNORL = 26;
  2859. SCRATCHWD[0] = " NONE";
  2860. SCRATCHWD[2] = "NONE";
  2861. SYNPRNT(SCRATCH);
  2862. GOTO READLXREF;
  2863. END
  2864. FOR I=0 STEP 1 UNTIL N DO #A LINE IS PRINTED FOR EACH DIAGNOSTIC #
  2865. BEGIN #REFERENCE. #
  2866. SCRATCHWD[4] = " "; #BLANK OUT SCRATCH WORDS WHICH MIGHT NOT#
  2867. SCRATCHWD[5] = " "; #BE USED. #
  2868. B&lt;6,24>SCRATCHWD[0] = O"04000000" + B&lt;12,18>SORTWORD[I];
  2869. # ADD A "D" IN FRONT OF DIAG NUMBER. #
  2870. P&lt;SYMBOLTABLE> = B&lt;42,18>SORTWORD[I];#SYMBOL TABLE ENTRY HAS #
  2871. J = SLENGTH[0]; #NAME AND LENGTH OF NAME OF LABELLED #
  2872. SCRATCHWD[2] = SNAME[0];#SECTION WITH DIAGNOSTIC REFERENCE. #
  2873. IF J GR 1 THEN #MOVE ALL OF LABEL TO SCRATCH WSA. #
  2874. BEGIN
  2875. SCRATCHWD[3] = SNAME[1];
  2876. IF J GR 2 THEN
  2877. SCRATCHWD[4] = SNAME[2];
  2878. END
  2879. FOR L=54 STEP -6 WHILE B&lt;L,6>SCRATCHWD[J+1] EQ 0 DO
  2880. B&lt;L,6>SCRATCHWD[J+1] = " ";
  2881. B&lt;0,6>SCRATCHWD[J + 2] = ":";#STORE : AND SUBLABEL IN WSA. #
  2882. B&lt;6,12>SCRATCHWD[J + 2] = B&lt;30,12>SORTWORD[I];
  2883. SCALL CHKLINO;
  2884. SYNORL = 58;
  2885. SYNPRNT(SCRATCH); #PRINT LINE OF CROSS REFERENCE LIST. #
  2886. END
  2887. READLXREF:
  2888. SYNEOF = 0; #TURN OFF EOF FLAG. #
  2889. FOR N=0 STEP 1 UNTIL SORTFL DO #READ ENTIRE LXREF INTO CORE. #
  2890. BEGIN
  2891. LXREFR(LOC(SORTWORD[N]));
  2892. IF SYNEOF NQ 0 THEN
  2893. GOTO SORTLXREF;
  2894. END
  2895. IF SYNEOF EQ 0 THEN #ABORT IF FILE WOULDN"T FIT IN CORE. #
  2896. SYNABT(0);
  2897. SORTLXREF:
  2898. N = N - 1;
  2899. SORTER; #CALL SORTING ROUTINE. #
  2900. HDRTITLE[0] = "LABEL CROSS REFERENCE ";
  2901. SCALL PRNTHDR;
  2902. SYNORL = 58;
  2903. SYNPRNT(LXREFHEADER2); #ERENCE LISTING. #
  2904. SYNORL = 8;
  2905. SYNPRNT(SKIPLINE);
  2906. LINENO = 2; #COMPENSATE FOR EXTRA HEADER #
  2907. SYNORL1 = 73;
  2908. PRINTER; #CALL PRINTING PROCEDURE. #
  2909. SYNEOF = 0; #TURN OFF EOF FLAG. #
  2910. FOR N=0 STEP 1 UNTIL SORTFL DO #READ ENTIRE SXREF INTO CORE. #
  2911. BEGIN
  2912. SXREFR(LOC(SORTWORD[N]));
  2913. IF SYNEOF NQ 0 THEN
  2914. GOTO SORTSXREF;
  2915. END
  2916. IF SYNEOF EQ 0 THEN
  2917. SYNABT(0);
  2918. SORTSXREF:
  2919. N = N - 1;
  2920. SORTER;
  2921. HDRTITLE[0] = "SUBROUTINE CROSS REFERENCE ";
  2922. SCALL PRNTHDR;
  2923. SYNORL = 58;
  2924. SYNPRNT(SXREFHEADER2); #REFERENCE LISTING. #
  2925. SYNORL = 38;
  2926. SYNPRNT(SXREFHEADER3);
  2927. LINENO = 2; #COMPENSATE FOR EXTRA HEADER #
  2928. SYNORL1 = 78;
  2929. PRINTER; #CALL PRINT FORMATTING ROUTINE. #
  2930. RETURN;
  2931. END
  2932. CONTROL EJECT;
  2933. #**********************************************************************#
  2934. PROC SORTER;
  2935. BEGIN
  2936. M = N;
  2937. NEXTINTERVAL:
  2938. M = M/2;
  2939. IF M EQ 0 THEN
  2940. RETURN;
  2941. K = N - M;
  2942. FOR J=0 STEP 1 UNTIL K DO
  2943. BEGIN
  2944. I = J;
  2945. BACKTRACK: L = I + M;
  2946. P&lt;SYMBOLTABLE> = B&lt;42,18>SORTWORD[I];
  2947. P&lt;SYMBOLTABLE2> = B&lt;42,18>SORTWORD[L];
  2948. IF SNAME[0] GR SNAME2[0] THEN
  2949. GOTO SWAPUM;
  2950. IF SNAME[0] EQ SNAME2[0] THEN
  2951. BEGIN
  2952. IF SLENGTH[0] GR SLENGTH2[0] THEN
  2953. GOTO SWAPUM;
  2954. IF SLENGTH[0] EQ SLENGTH2[0] AND
  2955. SLENGTH[0] GR 1 THEN
  2956. BEGIN
  2957. IF SNAME[1] GR SNAME2[1] THEN
  2958. GOTO SWAPUM;
  2959. IF SNAME[1] EQ SNAME2[1] AND
  2960. SLENGTH[0] GR 2 AND
  2961. SNAME[2] GR SNAME2[2] THEN
  2962. BEGIN #SWAP IF OUT OF ORDER. #
  2963. SWAPUM: LABELCOUNTER = SORTWORD[I];
  2964. SORTWORD[I] = SORTWORD[L];
  2965. SORTWORD[L] = LABELCOUNTER;
  2966. IF I GQ M THEN
  2967. BEGIN
  2968. I = I - M;
  2969. GOTO BACKTRACK;
  2970. END
  2971. END
  2972. END
  2973. END
  2974. END
  2975. GOTO NEXTINTERVAL;
  2976. END
  2977. CONTROL EJECT;
  2978. #**********************************************************************#
  2979. PROC PRINTER;
  2980. BEGIN
  2981. IF N LS 0 THEN #IF NO REFERENCES IN A CATEGORY, THEN #
  2982. BEGIN # THE WORD NONE IS PRINTED. #
  2983. SCRATCHWD[0] = " NONE";
  2984. SCRATCHWD[1] = " ";
  2985. SCRATCHWD[2] = " ";
  2986. SCRATCHWD[3] = " ";
  2987. SCRATCHWD[4] = "NONE";
  2988. SYNORL = 48;
  2989. SYNPRNT(SCRATCH);
  2990. RETURN;
  2991. END
  2992. FOR I=0 STEP 1 UNTIL N DO #PRINT A LINE FOR EACH CROSS REF. #
  2993. BEGIN
  2994. FOR J=0 STEP 2 UNTIL 6 DO #BLANK OUT WSA TO ERASE LAST #
  2995. BEGIN #RECORD THAT WAS WRITTEN. #
  2996. SCRATCHWD[J] = " ";
  2997. SCRATCHWD[J+1] = " ";
  2998. END
  2999. P&lt;SYMBOLTABLE> = B&lt;42,18>SORTWORD[I];#REFERENCED SYMBOL. #
  3000. P&lt;SYMBOLTABLE2> = B&lt;24,18>SORTWORD[I];#SYMBOL DOING REF. #
  3001. B&lt;6,54>SCRATCHWD[0] = B&lt;0,54>SNAME[0];#MOVE NAME OF SYMBL#
  3002. B&lt;0,6>SCRATCHWD[1] = B&lt;54,6>SNAME[0];#BEING REFERENCED. #
  3003. K = SLENGTH[0];
  3004. IF K GR 1 THEN
  3005. BEGIN
  3006. B&lt;6,54>SCRATCHWD[1] = B&lt;0,54>SNAME[1];
  3007. B&lt;0,6>SCRATCHWD[2] = B&lt;54,6>SNAME[1];
  3008. IF K GR 2 THEN
  3009. BEGIN
  3010. B&lt;6,54>SCRATCHWD[2] = B&lt;0,54>SNAME[2];
  3011. B&lt;0,6>SCRATCHWD[3] = B&lt;54,6>SNAME[2];
  3012. END
  3013. END
  3014. FOR J=0 STEP -6 WHILE B&lt;J,6>SCRATCHWD[K] EQ 0 DO
  3015. BEGIN #REPLACE TRAILING ZEROS WITH BLANKS. #
  3016. B&lt;J,6>SCRATCHWD[K] = " ";
  3017. IF J EQ 0 THEN
  3018. BEGIN
  3019. J = 60;
  3020. K = K- 1;
  3021. END
  3022. END
  3023. IF STYPE[0] EQ "L" THEN #IF LABEL CROSS REFERENCE BEING #
  3024. BEGIN #PRINTED, THEN PRINT SUBLABEL REFERENCE.#
  3025. IF B&lt;12,12>SORTWORD[I] NQ O"5555" THEN
  3026. BEGIN
  3027. K = K + 1;
  3028. B&lt;0,6>SCRATCHWD[K] = ":";
  3029. B&lt;6,12>SCRATCHWD[K] = B&lt;12,12>SORTWORD[I];
  3030. END
  3031. END
  3032. ELSE #IF SUBROUTINE CROSS REFERENCE BEING #
  3033. BEGIN #PRINTED, LIST THE SWITCH POSITION ALSO,#
  3034. ITEMP = SVALUE[0];#IN BOTH DECIMAL AND OCTAL. #
  3035. BINTODISPOCT;
  3036. FOR M=30 STEP 6 UNTIL 48 DO
  3037. BEGIN
  3038. IF B&lt;M,6>OCTAL[1] NQ O"33" THEN
  3039. GOTO STOREOCTPOS;
  3040. B&lt;M,6>OCTAL[1] = O"55";
  3041. END
  3042. STOREOCTPOS:
  3043. B&lt;30,30>SCRATCHWD[2] = B&lt;30,30>OCTAL[1];
  3044. BINTODISPDEC;
  3045. B&lt;30,30>SCRATCHWD[1] = B&lt;0,30>CTEMP;
  3046. END
  3047. IF P&lt;SYMBOLTABLE2> NQ P&lt;SYMBOLTABLE> THEN #REFERENCING #
  3048. BEGIN #SYMBOL PRINTED ONLY IF DIFFERENT FROM #
  3049. SCRATCHWD[4] = SNAME2[0];#REFERENCED SYMBOL. #
  3050. K = SLENGTH2[0];
  3051. IF K GR 1 THEN
  3052. BEGIN
  3053. SCRATCHWD[5] = SNAME2[1];
  3054. IF K GR 2 THEN
  3055. SCRATCHWD[6] = SNAME[2];
  3056. END
  3057. K = K + 3;
  3058. FOR L=54 STEP -6 WHILE B&lt;L,6>SCRATCHWD[K] EQ 0 DO
  3059. B&lt;L,6>SCRATCHWD[K] = " ";#REPLACE ZEROS = BLANKS. #
  3060. K = K + 1;
  3061. END
  3062. ELSE K = 4;
  3063. B&lt;0,6>SCRATCHWD[K] = ":";
  3064. B&lt;6,12>SCRATCHWD[K] = B&lt;0,12>SORTWORD[I];
  3065. SCALL CHKLINO;
  3066. SYNORL = SYNORL1;
  3067. SYNPRNT(SCRATCH);
  3068. END
  3069. RETURN;
  3070. END
  3071. CONTROL EJECT;
  3072. #**********************************************************************#
  3073. # #
  3074. # BINTODISPDEC #
  3075. # #
  3076. #ROUTINE WHICH CONVERTS BINARY INTEGERS INTO DISPLAY-CODED DECIMAL #
  3077. #INTEGERS. #
  3078. # #
  3079. #ENTRY CONDITIONS: #
  3080. # ITEMP CONTAINS AN UNSIGNED BINARY INTEGER TO BE CONVERTED. #
  3081. # #
  3082. #EXIT CONDITIONS: #
  3083. # CTEMP CONTAINS THE DECIMAL RESULT IN DISPLAY CODE, TRUNCATED TO FIVE#
  3084. # DIGITS IF NECESSARY, IN THE LEFTMOST FIVE CHARACTERS. #
  3085. # #
  3086. #ERROR CONDITIONS: NONE #
  3087. # #
  3088. PROC BINTODISPDEC;
  3089. ITEM I;
  3090. BEGIN
  3091. CTEMP = " 0"; #INITIALIZE CTEMP. #
  3092. FOR I=24 STEP -6 WHILE ITEMP GR 0 DO #CONVERT BY POWERS OF 10. #
  3093. BEGIN
  3094. J = ITEMP/10;
  3095. B&lt;I,6>CTEMP = ITEMP - J*10 + O"33";#ADD DISPLAY CODE BIAS. #
  3096. ITEMP = J;
  3097. END
  3098. RETURN;
  3099. END
  3100. CONTROL EJECT;
  3101. #**********************************************************************#
  3102. # #
  3103. # DISPLAYTOBIN #
  3104. # #
  3105. #ROUTINE TO CONVERT DISPLAY-CODED DECIMAL INTEGERS INTO BINARY. #
  3106. # #
  3107. #ENTRY CONDITIONS: #
  3108. # CTEMP CONTAINS A DISPLAY-CODED, UNSIGNED, DECIMAL INTEGER, LEFT-JUS-#
  3109. # TIFIED. #
  3110. #EXIT CONDITIONS: #
  3111. # ITEMP CONTAINS THE BINARY VALUE OF CTEMP #
  3112. # #
  3113. PROC DISPLAYTOBIN;
  3114. BEGIN
  3115. ITEMP = 0; #INITIALIZE RESULT TO ZERO. #
  3116. FOR I=0 STEP 6 UNTIL 54 DO
  3117. BEGIN
  3118. J = B&lt;I,6>CTEMP;
  3119. IF J EQ O"55" AND # SKIP LEADING BUT NOT TRAILING #
  3120. ITEMP NQ 0 THEN # BLANKS. #
  3121. RETURN;
  3122. IF J GR O"44" OR
  3123. J LS O"33" THEN
  3124. BEGIN
  3125. BADDIGIT[1] = CTEMP;
  3126. SCALL CHKLINO;
  3127. SYNORL = 43;
  3128. SYNPRNT(BADDIGITMSG);
  3129. CHKERRCNT;
  3130. END
  3131. ITEMP = ITEMP*10 + J-O"33";
  3132. END
  3133. END
  3134. CONTROL EJECT;
  3135. #**********************************************************************#
  3136. # #
  3137. # BINTODISPOCT #
  3138. # #
  3139. #ROUTINE TO CONVERT BINARY INTEGERS INTO DISPLAY CODED OCTAL INTEGERS. #
  3140. # #
  3141. #ENTRY CONDITIONS: #
  3142. # ITEMP CONTAINS A BINARY VALUE TO BE CONVERTED. #
  3143. # #
  3144. #EXIT CONDITIONS: #
  3145. # OCTAL CONTAINS THE TWENTY DISPLAY-CODED CHARACTERS WHICH ARE THE #
  3146. # RESULT. #
  3147. # #
  3148. PROC BINTODISPOCT;
  3149. ITEM I;
  3150. BEGIN
  3151. IF B&lt;0,30>ITEMP NQ 0 THEN #TAKE A SHORT CUT IF LESS THAN 31 SIG- #
  3152. FOR I=0 STEP 3 UNTIL 27 DO #NIFICANT BITS, ELSE GRIND IT OUT. #
  3153. B&lt;I*2,6>OCTAL[0] = B<I,3>ITEMP + O"33";
  3154. ELSE OCTAL[0] = O"33333333333333333333";
  3155. FOR I=30 STEP 3 UNTIL 57 DO
  3156. B&lt;(I-30)*2,6>OCTAL[1] = B<I,3>ITEMP + O"33";
  3157. RETURN;
  3158. END
  3159. CONTROL EJECT;
  3160. #**********************************************************************#
  3161. # #
  3162. # WALKCHAIN #
  3163. # #
  3164. #ROUTINE TO WALK DOWN CHAIN OF REFERENCES AND REPLACE POINTERS WITH THE#
  3165. #DISPLAY-CODED INSTRUCTION IN "SYNSTRUCTION". #
  3166. #THE CHAIN IS TERMINATED BY A NEGATIVE POINTER VALUE. #
  3167. # #
  3168. # ENTRY CONDITIONS: #
  3169. # K CONTAINS THE SYNTBLE WORD ADDRESS OF THE 1ST ENTRY IN THE CHAIN. #
  3170. # SYNSTRUCTION CONTAINS THE DISPLAY-CODED INSTRUCTION TO BE STORED. #
  3171. # SYNTBLEWORD CONTAINS THE INDEX OF THE LWA+1 OF SYNTBLE. #
  3172. # #
  3173. #EXTERNAL REFERENCES: #
  3174. # SYNTBLR AND SYNTBLW ARE COMPASS ROUTINES WHICH READ AND WRITE THE #
  3175. # SYNTBLE FILE. #
  3176. # #
  3177. #EXIT CONDITIONS: #
  3178. # THE CHAIN POINTERS WILL BE REPLACED BY THE CONTENTS OF SYNSTRUCTION.#
  3179. # #
  3180. #ERROR CONDITIONS: #
  3181. # A ZERO POINTER VALUE IS AN ERROR, AND IS DIAGNOSED WITH A DAYFILE #
  3182. # MESSAGE AND AN ABORT OF SYNGEN. #
  3183. # #
  3184. PROC WALKCHAIN;
  3185. ITEM ITEMP;
  3186. BEGIN
  3187. NEXTENTRY:
  3188. IF K GR SYNTBLEWORD THEN #IF THE ADDRESS IS IN THE WSA CURRENTLY #
  3189. BEGIN #BEING BUILT, THEN 1ST CHAIN ENTRY IS IN#
  3190. ITEMP = K - (SYNTBLEWORD+6);#THE ARRAY "PRESETCODE" AND NOT #
  3191. L = PRESETI[ITEMP]; #IN THE FILE. #
  3192. PRESETI[ITEMP] = SYNSTRUCTION;
  3193. GOTO CKENDOFCHAIN;
  3194. END
  3195. IF K EQ 0 THEN SYNABT(4); # IF A ZERO VALUE FOR LINK POINTER #
  3196. SYNTBLR(SCRATCH,K); #FETCH WORD OF SYNTBLE CONTAINING NEXT #
  3197. #IN CHAIN OF REFERENCES. #
  3198. L = SCRATCHWD[0]; #SAVE PTR TO NEXT CHAIN ENTRY. #
  3199. B&lt;0,60>SCRATCHWD[0] = SYNSTRUCTION;#STORE INSTRUCTION. #
  3200. SYNTBLW(SCRATCH,K); #STORE UPDATED SYNTBLE WORD BACK. #
  3201. CKENDOFCHAIN:
  3202. IF L LS 0 THEN RETURN; #RETURN IF END OF CHAIN REACHED. #
  3203. K = L;
  3204. GOTO NEXTENTRY;
  3205. END
  3206. END
  3207. TERM
  3208. *CWEOR,0
  3209. IDENT SYNIO
  3210. ENTRY SYNOPEN
  3211. ENTRY SYNCLSE
  3212. ENTRY SYNREAD
  3213. ENTRY SYNPRNT
  3214. ENTRY SXREFWS
  3215. ENTRY DXREFWS
  3216. ENTRY LXREFWS
  3217. ENTRY SYNTWSA
  3218. ENTRY SYNABT
  3219. ENTRY TRACEW
  3220. ENTRY LXREFW
  3221. ENTRY DXREFW
  3222. ENTRY SXREFW
  3223. ENTRY SYNCOPY
  3224. ENTRY LXREFR
  3225. ENTRY DXREFR
  3226. ENTRY SXREFR
  3227. ENTRY SYNCOM
  3228. ENTRY SYNIWSA INPUT WORKING STORAGE AREA
  3229. ENTRY SYNEOF INDICATES END OF FILE (1=EOF)
  3230. ENTRY LFLAG LFLAG=1 NO OUTPUT LISTINGS
  3231. ENTRY REWIND REWIND=1 REWIND PRESET FILE AT EOJ.
  3232. ENTRY SYNIRL LENGTH OF THE INPUT RECORD
  3233. ENTRY SYNORL LENGTH OF THE OUTPUT RECORD
  3234. ENTRY TFLAG
  3235. ENTRY OUTLEN RECORD LENGTH FOR COMPILE FILE
  3236. ENTRY REALEOF
  3237. ENTRY SKIPFLG FLAG FOR CONDITIONAL SKIPPING
  3238. ENTRY DIRFLAG FLAG FOR COND. SKIP DIRECTIVE
  3239. EXT HDRDATE
  3240. EXT HDRTIME
  3241. ENTRY SYNTIDA
  3242. SST
  3243. ************************************************************************
  3244. * * S Y N O P E N * *
  3245. * *
  3246. * ENTRY CONDITIONS: *
  3247. * THE FIRST WORD OF SYNIWSA CONTAINS THE INPUT FILE LFN. *
  3248. * THE SECOND WORD OF SYNIWSA CONTAINS THE PRESET FILE LFN. *
  3249. * THE THIRD WORD OF SYNIWSA CONTAINS A RECORD TYPE FLAG. *
  3250. * 0=C (DEFAULT) (FILES INPUT, OUTPUT AND PRESET) *
  3251. * 1=W *
  3252. * THE FOURTH WORD OF SYNIWSA CONTAINS A BLOCKING TYPE FLAG. *
  3253. * 0=Z (DEFAULT) (FILES INPUT, OUTPUT AND PRESET) *
  3254. * 1=I *
  3255. * LFLAG IS SET TO INDICATE IF LISTINGS ARE ON OR OFF. *
  3256. * LFLAG = 1 ON *
  3257. * LFLAG = 0 OFF *
  3258. * TFLAG IS SET TO INDICATE IF THE TRACEM PRESET IS TO BE CREATED. *
  3259. * TFLAG = 1 ON *
  3260. * TFLAG = 0 OFF *
  3261. * EXIT CONDITIONS: *
  3262. * FILES INPUT, OUTPUT, PRSET, SYNTBLE ARE OPEN. TRACEM FILE IS OPEN *
  3263. * IF TFLAG = 1. FILES LXREF,DXREF, SXREF ARE OPEN IF LFLAG = 1. *
  3264. * THE FIRST WORD OF SYNIWSA CONTAINS THE NUMBER OF WORDS IN SYNGEN"S*
  3265. * FIELD LENGTH. THE HEADERS: *
  3266. * PROC SYN *
  3267. * TAXTABLE; *
  3268. * BEGIN *
  3269. * XDEF *
  3270. * BEGIN *
  3271. * ARE WRITTEN ON THE PRESET FILE. *
  3272. * EXTERNAL REFERENCE: *
  3273. * 6RM MACROS OPENM, STORE, FETCH. SCOPE MACRO MEMORY. *
  3274. * DESCRIPTION: *
  3275. * THE BUFFERS FOR THE SYNTBLE AND TRACEM FILES ARE ALLOCATED AT EXE-*
  3276. * CUTION TIME. LFLAG IS CHECKED TO DETERMINE IF THE CROSS-REFERENCE *
  3277. * FILES ARE TO BE OPENED. TFLAG IS CHECKED TO SEE IF THE TRACEM FILE*
  3278. * IS TO BE OPENED. THE MEMORY MACRO IS USED TO GET THE NUMBER OF *
  3279. * WORDS IN SYNGEN"S FIELD LENGTH. CONTROL IS RETURNED TO SYNCNTRL. *
  3280. ************************************************************************
  3281. SYNOPEN DATA 0
  3282. SA1 INFILE GET INPUT FILE LFN PASSED BY SYNGEN.
  3283. SA2 OUTFILE GET PRESET LFN PASSED BY SYNGEN.
  3284. BX7 X1 OVERLAY THE LFN IN THE INPUT AND COMPILE
  3285. BX6 X2 FITS WITH THE LFNS IN INFILE AND OUTFILE.
  3286. SA7 INPUT
  3287. SA6 COMPILE
  3288. SA1 LSTFILE INSERT ALTERNATE NAME FOR LISTING FILE.
  3289. BX6 X1
  3290. SA6 OUTPUT
  3291. SA3 65B GET PTR TO LWA+1 OF LOADED CODE.
  3292. SX2 260 BUFFER FOR TRACEM
  3293. SX4 X3 ISOLATE ADDRESS OF NEXT AVAILABLE WORD.
  3294. IX6 X2+X3 INCREMENT PTR TO NEXT AVAILABLE WORD.
  3295. SA6 65B STORE NEW PTR, ALLOCATING THE 2 BUFFERS.
  3296. STORE TRACEM,FWB=X4 ASSIGN BUFFER FOR TRACEM.
  3297. OPENM INPUT,INPUT,N INPUT TO SYNGEN
  3298. OPENM OUTPUT,OUTPUT,N SYNGENS OUTPUT FILE
  3299. OPENM COMPILE,I-O,N SYNGENS PRESET FILE
  3300. SA1 LFLAG GET OUTPUT FLAG.
  3301. ZR X1,CKTRACE IF LFLAG=0 THEN THERE IS NO NEED TO OPEN
  3302. THE CROSS-REFERENCE FILES.
  3303. OPENM LXREF,I-O,N FILE THAT THE LABEL CROSS-REFERENCE LISTING
  3304. IS BUILT ON.
  3305. OPENM DXREF,I-O,N FILE THAT THE DIAGNOSTIC CROSS-REFERENCE
  3306. LISTING IS BUILT ON.
  3307. OPENM SXREF,I-O,N FILE THAT THE SUBROUTINE CROSS-REFERENCE
  3308. LISTING IS BUILT ON.
  3309. CKTRACE SA1 TFLAG GET TRACE FLAG
  3310. ZR X1,OPENEND IF TFLAG=0 THERE IS NO NEED TO OPEN THE
  3311. TRACE FILE.
  3312. OPENM TRACEM,I-O,N FILE THAT THE TRACE PRESET IS BUILT ON.
  3313. OPENEND MEMORY CM,SYNMEM,R GET FIELD LENGTH.
  3314. SA1 SYNMEM STORE FIELD LENGTH.
  3315. AX1 30 SHIFT TO THE RIGHT THE NUMBER OF CM WORDS.
  3316. BX7 X1
  3317. SA7 SYNIWSA PASS THE NUMBER OF CM WORDS BACK TO SYNCTRL
  3318. IN THE 1ST WORD OF THE INPUT WSA.
  3319. EQ SYNOPEN RETURN TO SYNCTRL.
  3320. ************************************************************************
  3321. *
  3322. * * SYNTIDA *
  3323. *
  3324. * USE SYSTEM MACROS TO INSERT TIME AND DATE IN HEADER LINE
  3325. *
  3326. SYNTIDA DATA 0
  3327. DATE HDRDATE
  3328. CLOCK HDRTIME
  3329. EQ SYNTIDA
  3330. ************************************************************************
  3331. * * S Y N R E A D * *
  3332. * *
  3333. * ENTRY CONDITIONS: *
  3334. * LFLAG IS SET TO INDICATE IF THE OUTPUT LISTINGS ARE ON OR OFF. *
  3335. * EXIT CONDITIONS: *
  3336. * THE INPUT RECORD IS STORED IN WORKING STORAGE AREA "SYNIWSA". THE *
  3337. * LENGTH OF THE INPUT RECORD IS STORED IN SYNIRL. SYNEOF IS SET TO *
  3338. * 1 IF AN END OF FILE CONDITION IS FOUND IN THE INPUT FILE. *
  3339. * EXTERNAL REFERENCES: *
  3340. * 6RM MACROS GET, PUT AND FETCH. *
  3341. * DESCRIPTION: *
  3342. * SYNREAD READS A RECORD FROM SYNGEN"S INPUT FILE AND STORES IT IN *
  3343. * THE WORKING STORAGE AREA SYNIWSA. IF LFLAG IS ON, THE ADDRESS OF *
  3344. * SYNIWSA IS PASSED TO THE PUT MACRO AND THE INPUT RECORD IS WRITTEN*
  3345. * ONTO THE OUTPUT FILE. THE LENGTH OF THE INPUT RECORD, IN CHARACT- *
  3346. * ERS, IS STORED SYNIRL BY MEANS OF THE FETCH MACRO. *
  3347. * *
  3348. * CHKSKIP IS CALLED TO RECOGNIZE SPECIAL COMPILER DIRECTIVES. TWO *
  3349. * FLAGS, DIRFLAG AND SKIPFLG, WILL BE SET BY CHKSKIP TO INDICATE *
  3350. * WHETHER OR NOT THE INPUT LINE IS TO BE PROCESSED BY THE COMPILER. *
  3351. * SYNREAD PERFORMS SPECIAL PROCESSING FOR THE FLAG VALUES: *
  3352. * *
  3353. * DIRFLAG = 1, THE INPUT LINE WAS A COMPILER DIRECTIVE, AND IS *
  3354. * NOT TO BE PROCESSED BY THE COMPILER. THE VALUE *
  3355. * OF SKIPFLG IS IRRELEVANT. *
  3356. * *
  3357. * DIRFLAG = 0, THE INPUT LINE WAS NOT A COMPILER DIRECTIVE, AND *
  3358. * THE VALUE OF SKIPFLG CONTROLS WHETHER OR NOT THE *
  3359. * LINE WILL BE PROCESSED BY THE COMPILER. *
  3360. * *
  3361. * SKIPFLG = 0, THE INPUT LINE IS NOT UNDER THE CONTROL OF *
  3362. * CONDITIONAL COMPILATION DIRECTIVES, AND SHOULD *
  3363. * BE PROCESSED BY THE COMPILER. *
  3364. * *
  3365. * SKIPFLG = 1, THE INPUT LINE IS BEING SKIPPED BY CONDITIONAL *
  3366. * COMPILATION DIRECTIVES, AND SHOULD NOT BE *
  3367. * PROCESSED BY THE COMPILER. *
  3368. * *
  3369. * SKIPFLG = -1, THE INPUT LINE IS BEING INCLUDED BY CONDITIONAL *
  3370. * COMPILATION DIRECTIVES, AND SHOULD BE PROCESSED *
  3371. * BY THE COMPILER. *
  3372. * *
  3373. ************************************************************************
  3374. SYNREAD JP *+400000B ENTRY/EXIT
  3375. SYNRD1 GET INPUT,SYNIWSA,90 MOVE 90 CHAR INPUT RECORD TO SYNIWSA
  3376. RJ =XCHKSKIP CHK IF COMPILER DIRECTIVE OR SKIPPING
  3377. FETCH INPUT,RL,X7 FETCH RECORD LENGTH FROM FIT INTO X7
  3378. SA7 SYNIRL SAVE IT FOR FUTURE USE
  3379. SA3 LFLAG LISTING FLAG. SHOULD WE WRITE OUTPUT
  3380. ZR X3,SYNRD5 IF NO LISTING...JUST CHECK FLAGS
  3381. SA3 =10H NULL NOTATION...LEADING BLANKS
  3382. SA4 DIRFLAG CHECK FOR A DIRECTIVE
  3383. ZR X4,SYNRD2 IF NOT A DIRECTIVE
  3384. SA3 =10H - NOTATION FOR A DIRECTIVE
  3385. EQ SYNRD4
  3386.  
  3387. SYNRD2 SA4 SKIPFLG CHECK THE SKIPPING FLAG
  3388. ZR X4,SYNRD4 IF NO SPECIAL SKIPPING
  3389. MI X4,SYNRD3 IF NOT SKIPPING ON AN -IFEQ-
  3390. SA3 =10H - NOTATION FOR SKIPPING
  3391. EQ SYNRD4
  3392.  
  3393. SYNRD3 SA3 =10H + NOTATION FOR IFEQ INCLUSION
  3394. SYNRD4 BX6 X3 (X3) HAS FIRST WORD FOR OUTPUT LINE
  3395. SA6 SYNWS STORE AS FIRST WORD OF LINE
  3396. SX7 X7+10 RECORD LENGTH + LEADING WORD
  3397. PUT OUTPUT,SYNWS,X7 PUT THE RECORD ON THE LISTING FILE
  3398. SYNRD5 SA3 SKIPFLG CHECK THE SKIPPING FLAG
  3399. SX3 X3-1 JUST WANT TO CHECK FOR SKIPFLG = 1
  3400. PL X3,SYNRD1 IF SKIPPING, GET NEXT RECORD
  3401. SA3 DIRFLAG CHECK DIRECTIVE FLAG
  3402. NZ X3,SYNRD1 IF SKIPPING, GET NEXT RECORD
  3403. EQ SYNREAD RETURN TO CALLER
  3404.  
  3405. ************************************************************************
  3406. * * S Y N P R N T * *
  3407. * *
  3408. * ENTRY CONDITION: *
  3409. * THE ADDRESS OF THE WORKING STORAGE AREA THAT CONTAINS THE RECORD *
  3410. * THAT IS TO BE WRITTEN ON THE OUTPUT FILE IS PASSED IN THE PARA- *
  3411. * METER LIST. THE LENGTH OF THE RECORD TO BE PRINTED IS PASSED IN *
  3412. * SYNORL *
  3413. * EXIT CONDITION: *
  3414. * RECORD IN THE WORKING STORAGE AREA PASSED TO SYNPRNT IS WRITTEN *
  3415. * ONTO THE OUTPUT FILE. *
  3416. * EXTERNAL REFERENCE: *
  3417. * 6RM MACRO PUT. *
  3418. * DESCRIPTION: *
  3419. * WRITES A RECORD CONTAINED IN A WORKING STORAGE AREA ON TO THE *
  3420. * OUTPUT FILE. *
  3421. ************************************************************************
  3422. SYNPRNT DATA 0
  3423. SA3 SYNORL LENGTH OF THE OUTPUT RECORD.
  3424. PUT OUTPUT,X1,X3 MOVE RECORD FROM WROKING STORAGE AREA,
  3425. * PASSED IN X1, TO THE OUTPUT FILE.
  3426. EQ SYNPRNT RETURN TO CALLER.
  3427. ************************************************************************
  3428. * * TRACEW * *
  3429. * *
  3430. * ENTRY CONDITION: *
  3431. * NONE. *
  3432. * EXIT CONDITION: *
  3433. * RECORD CONTAINED IN THE WORKING STORAGE AREA "SYTWSA" IS WRITTEN *
  3434. * TO THE TRACEM FILE. *
  3435. * EXTERNAL REFERENCE: *
  3436. * 6RM MACRO PUT. *
  3437. * DESCRIPTION: *
  3438. * WRITES THE RECORD CONTAINED IN THE WORKING STORAGE AREA "SYNTWSA" *
  3439. * ONTO THE TRACEM FILE. *
  3440. ************************************************************************
  3441. TRACEW DATA 0
  3442. PUT TRACEM,SYNTWSA,60 MOVE TRACE RECORD INTO THE TRACEM
  3443. * FILE.
  3444. EQ TRACEW RETURN TO CALLER.
  3445. ************************************************************************
  3446. * * LXREFW * *
  3447. * *
  3448. * ENTRY CONDITION: *
  3449. * NONE. *
  3450. * EXIT CONDITION: *
  3451. * RECORD CONTAINED IN THE WORKING STORAGE AREA "LXREFWS" IS WRITTEN *
  3452. * TO THE LXREF FILE. *
  3453. * EXTERNAL REFERENCE: *
  3454. * 6RM MACRO PUT. *
  3455. * *
  3456. * DESCRIPTION: *
  3457. * WRITES THE RECORD CONTAINED IN THE WORKING STORAGE AREA "LXREFWS" *
  3458. * ONTO THE LXREF FILE. *
  3459. ************************************************************************
  3460. LXREFW DATA 0
  3461. PUT LXREF,LXREFWS,10 MOVE LABEL CROSS-REFERENCE RECORD
  3462. * INTO THE LXREF FILE.
  3463. EQ LXREFW RETURN TO CALLER
  3464. ************************************************************************
  3465. * * DXREFW * *
  3466. * *
  3467. * ENTRY CONDITION: *
  3468. * NONE. *
  3469. * EXIT CONDITION: *
  3470. * RECORD CONTAINED IN THE WORKING STORAGE AREA "DXREFWS" IS WRITTEN *
  3471. * TO THE DXREF FILE. *
  3472. * EXTERNAL REFERENCE: *
  3473. * 6RM MACRO PUT. *
  3474. * DESCRIPTION: *
  3475. * WRITES THE RECORD CONTAINED IN THE WORKING STORAGE AREA "DXREFWS" *
  3476. * ONTO THE DXREF FILE. *
  3477. ************************************************************************
  3478. DXREFW DATA 0
  3479. PUT DXREF,DXREFWS,10 MOVE DIAGNOSTIC CROSS-REFERENCE
  3480. * RECORD INTO THE DXREF FILE.
  3481. EQ DXREFW RETURN TO CALLER.
  3482. ************************************************************************
  3483. * * SXREFW * *
  3484. * *
  3485. * ENTRY CONDITION: *
  3486. * NONE. *
  3487. * EXIT CONDITION: *
  3488. * RECORD CONTAINED IN THE WORKING STORAGE AREA "SXREFWS" IS WRITTEN *
  3489. * TO THE SXREF FILE. *
  3490. * EXTERNAL REFERENCE: *
  3491. * 6RM MACRO PUT. *
  3492. * DESCRIPTION: *
  3493. * WRITES THE RECORD CONTAINED IN THE WORKING STORAGE AREA "SXREFWS" *
  3494. * ONTO THE SXREF FILE. *
  3495. ************************************************************************
  3496. SXREFW DATA 0
  3497. PUT SXREF,SXREFWS,10 MOVE SUBROUTINE CROSS-REFERENCE
  3498. * RECORD INTO THE SXREF FILE.
  3499. EQ SXREFW RETURN TO CALLER.
  3500. ************************************************************************
  3501. * * SYNCOPY * *
  3502. * *
  3503. * ENTRY CONDITIONS: *
  3504. * LFLAG INDICATES IF THE OUTPUT LISTINGS ARE ON OR OFF. THE HEADER *
  3505. * OF THE TRACEM ARRAY IS STORED IN THE WORKING STORAGE AREA SYNIWSA.*
  3506. * EXIT CONDITIONS: *
  3507. * THE FILES "SYNTBLE" AND "TRACEM" ARE WRITTEN TO THE PRESET FILE *
  3508. * AND IF LFLAG = 1, THEY ARE WRITTEN TO THE OUTPUT FILE. RA + 65 IS *
  3509. * SET TO THE FIRST WORD OF THE SYNTBLE BUFFER (SYNBUF). *
  3510. * EXTERNAL REFERENCE: *
  3511. * 6RM MACROS GET,PUT,REWIND AND CLOSEM. *
  3512. * SYNIO ROUTINES SYNPRNT AND SYNCOM. *
  3513. * DESCRIPTION: *
  3514. * REWINDS THE FILES "SYNTBLE" AND "TRACEM". COPIES THE FILES TO THE *
  3515. * PRESET FILE, AND IF LFLAG = 1 COPIES THEM TO THE OUTPUT FILE. *
  3516. * AFTER THE FILES ARE COPIED, THE FILES ARE CLOSED. IN ORDER TO FREE*
  3517. * ENOUGH BUFFER SPACE FOR THE CROSS-REFERENCE SORTS BY SYNBUILD, THE*
  3518. * ADDRESS OF THE FIRST WORD OF THE SYNTBLE BUFFER IS STORED IN *
  3519. * RA + 65. *
  3520. ************************************************************************
  3521. SYNCOPY DATA 0
  3522. SA1 X1
  3523. SX6 X1-1
  3524. SA6 SYNORL SAVE NUMBER OF WORDS IN SYNTBLE.
  3525. SX6 -5 INITIALIZE WORD ADDRESS OF LAST RECORD READ
  3526. SA6 SYNIRL FROM SYNTBLE FILE AND SAVE IN SCRATCH WORD.
  3527. COPYTWO SA2 SYNIRL GET ADDRESS OF LAST RECORD READ.
  3528. SX3 6
  3529. IX6 X3+X2 INCREMENT TO GET WORD ADDRESS OF NEXT
  3530. SA6 A2 RECORD AND SAVE.
  3531. SA1 SCPARM
  3532. RJ =XSYNTBLR GO READ A RECORD FROM SYNBOL TABLE
  3533. SX1 SYNCWSA CKTFLAG.
  3534. RJ SYNCOM WRITE OUT THE RECORD.
  3535. SA1 SYNORL CHECK FOR EOF.
  3536. SX6 X1-6
  3537. ZR X6,CKTFLAG
  3538. SA6 A1
  3539. EQ COPYTWO COPY NEXT RECORD.
  3540. CKTFLAG SA3 TFLAG GET TRACE FLAG.
  3541. ZR X3,RA65 IF TFLAG IS OFF THERE IS NO TRACE TABLE,
  3542. * GOTO SET RA + 65 ROUTINE. IF TFLAG IS ON
  3543. REWINDM TRACEM COPY THE TRACEM FILE TO THE PRESET FILE.
  3544. REWTRAC SX1 SYNIWSA WRITE TRACEM HEADER OUT.
  3545. RJ SYNCOM
  3546. COPY2 GET TRACEM,SYNTWSA,60 COPY UNTILL END-OF-DATA, THEN GOTO
  3547. SX1 SYNTWSA DATA EXIT IN FILE MACRO.
  3548. RJ SYNCOM WRITE OUT THE RECORD.
  3549. EQ COPY2 COPY NEXT RECORD.
  3550. RA65 FETCH TRACEM,FWB,X6
  3551. SA3 65B
  3552. MX0 42
  3553. BX4 X3*X0
  3554. IX7 X6+X4
  3555. SA7 A3 STORE TRACEM BUFFER ADDRESS INTO RA+65.
  3556. SA3 TFLAG GET TRACE FLAG.
  3557. ZR X3,SYNCOPY IF TLFAG = 0 TRACEM FILE WAS NEVER OPENED,
  3558. REWINDM TRACEM
  3559. * FILE
  3560. EQ SYNCOPY RETURN TO CALLER.
  3561. SCPARM VFD 60/SYNCWSA
  3562. VFD 60/SYNIRL
  3563. ************************************************************************
  3564. * * LXREWR * *
  3565. * *
  3566. * ENTRY CONDITION: *
  3567. * ADDRESS OF THE WORKING STORAGE WHERE THE RECORD IS TO BE STORED *
  3568. * IS PASSED IN THE PARAMETER LIST. *
  3569. * EXIT CONDITION: *
  3570. * RECORD IS STORED IN THE WORKING STORAGE AREA PASSED TO LXREWR. *
  3571. * SYNEOF IS SET TO 1 WHEN END-OF-FILE OCCURS. *
  3572. * EXTERNAL REFERENCE: *
  3573. * 6RM MACROS GET AND FETCH. *
  3574. * DESCRIPTION: *
  3575. * GETS A RECORD FROM THE FILE LXREF AND STORES IT IN THE WORKING *
  3576. * STORAGE AREA PASSED TO LXREFR. A CHECK IS MADE TO DETERMINE IF AN *
  3577. * END-OF-SECTION OR END-OF-FILE HAS OCCURED. IF END-OF-SECTION READ *
  3578. * NEXT RECORD, IF END-OF-FILE SET SYNEOF TO 1. *
  3579. ************************************************************************
  3580. LXREFR DATA 0
  3581. SA1 X1
  3582. BX7 X1
  3583. SA7 SYNMEM SAVE ADDRESS.
  3584. LXRD SA1 SYNMEM
  3585. GET LXREF,X1,10 MOVE RECORD TO THE WORKING
  3586. STORAGE AREA PASSED TO LXREFR.
  3587. EQ LXREFR RETURN TO CALLER
  3588. ************************************************************************
  3589. * * DXREFR * *
  3590. * *
  3591. * ENTRY CONDITION: *
  3592. * ADDRESS OF THE WORKING STORAGE AREA WHERE THE RECORD IS TO BE *
  3593. * STORED IS PASSED IN THE PARAMETER LIST. *
  3594. * EXIT CONDITION: *
  3595. * RECORD IS STORE IN THE WORKING STORAGE AREA PASSED TO DXREFR. *
  3596. * SYNEOF IS SET TO 1 WHEN END-OF-FILE OCCURS. *
  3597. * EXTERNAL REFERENCE: *
  3598. * 6RM MACROS GET AND FETCH. *
  3599. * DESCRIPTION: *
  3600. * GETS A RECORD FROM THE DXREF FILE AND STORES IT IN THE WORKING *
  3601. * STORAGE AREA PASSED TO DXREFR. A CHECK IS MADE TO DETERMINE IF AN *
  3602. * END-OF-SECTION OR END-OF-FILE HAS OCCURED. IF END-OF-SECTION, READ*
  3603. * NEXT RECORD, IF END-OF-FILE SET SYNEOF TO 1. *
  3604. ************************************************************************
  3605. DXREFR DATA 0
  3606. SA1 X1
  3607. BX7 X1
  3608. SA7 SYNMEM SAVE ADDRESS.
  3609. DXRD SA1 SYNMEM
  3610. GET DXREF,X1,10 MOVE RECORD TO THE WORKING
  3611. * STORAGE AREA PASSED TO DXREFR. JUMPS TO
  3612. * ROUTINE SPECIFIED IN THE FILE MACRO WHEN
  3613. * END-OF-SECTION/END-OF-FILE OCCURS.
  3614. EQ DXREFR RETURN TO CALLER.
  3615. ************************************************************************
  3616. * * SXREFR * *
  3617. * *
  3618. * ENTRY CONDITION: *
  3619. * ADDRESS OF THE WORKING STORAGE AREA WHERE THE RECORD IS TO BE *
  3620. * STORED IS PASSED IN THE PARAMETER LIST. *
  3621. * EXIT CONDITION: *
  3622. * RECORED IS STORED IN THE WORKING STORAGE AREA PASSED TO SXREFR. *
  3623. * SYNEOF IS SET TO 1 WHEN END-OF-FILE OCCURS. *
  3624. * EXTERNAL REFERENCE: *
  3625. * 6RM MACROS GET AND FETCH. *
  3626. * DESCRIPTION: *
  3627. * GETS A RECORD FROM THE SXREF FILE AND STORES IT IN THE WORKING *
  3628. * STORAGE AREA PASSED TO SXREFR. A CHECK IS MADE TO DETERMINE IF AN *
  3629. * END-OF-SECTION OR END-OF-FILE HAS OCCURED. IF END-OF-SECTION, READ*
  3630. * NEXT RECORD, IF END-OF-FILE, SET SYNEOF TO 1. *
  3631. ************************************************************************
  3632. SXREFR DATA 0
  3633. SA1 X1
  3634. BX7 X1
  3635. SA7 SYNMEM SAVE ADDRESS.
  3636. SXRD SA1 SYNMEM
  3637. GET SXREF,X1,10 MOVE RECORD TO THE WORKING
  3638. * STORAGE AREA PASSED TO SXREFR. JUMPS TO
  3639. * ROUTINE SPECIFIED IN THE FILE MACRO WHEN
  3640. * END-OF-SECTION/END-OF-FILE OCCURS.
  3641. EQ SXREFR RETURN TO CALLER.
  3642. ************************************************************************
  3643. * * SYNCOM * *
  3644. * *
  3645. * ENTRY CONDITIONS: *
  3646. * LFLAG INDICATES IF THE OUTPUT LISTINGS ARE ON OR OFF. THE ADDRESS *
  3647. * OF THE WORKING STORAGE AREA IS PASSED IN THE PARAMETER LIST. *
  3648. * EXIT CONDITIONS: *
  3649. * RECORD CONTAINED IN THE WORKING STORAGE AREA PASSED TO SYNCON IS *
  3650. * WRITTEN TO THE PRESET FILE AND IF LFLAG = 1 IT IS WRITTEN TO THE *
  3651. * OUTPUT FILE. *
  3652. * EXTERNAL REFERENCE: *
  3653. * 6RM MACRO PUT. *
  3654. * DESCRIPTION: *
  3655. * GETS A RECORD FROM THE WORKING STORAGE AREA PASSED TO SYNCON AND *
  3656. * STORES IT IN THE PRESET FILE, AND IF LFLAG = 1 STORES IT IN THE *
  3657. * OUTPUT FILE. *
  3658. ************************************************************************
  3659. SYNCOM DATA 0
  3660. SA2 OUTLEN FETCH RECORD LENGTH TO WRITE
  3661. SYNCON1 PUT COMPILE,X1,X2 WRITE RECORD FROM WORKING STORAGE
  3662. * AREA PASSED IN THE PARAMETER LIST TO THE
  3663. * COMPILE FILE
  3664. EQ SYNCOM RETURN TO CALLER.
  3665. ************************************************************************
  3666. * * SYNABT * *
  3667. * *
  3668. * ENTRY CONDITION: *
  3669. * MESSAGE INDICATOR IS PASSED IN THE PARAMETER LIST: *
  3670. * 0 = INSUFFICIENT FIELD LENGTH *
  3671. * 1 = CONTROL CARD ERROR. *
  3672. * 2 = UNEXPECTED END OF FILE ON INPUT *
  3673. * 3 = ERROR LIMIT(100) EXCEEDED *
  3674. * 4 = INTERNAL ERROR (WALKCHAIN) *
  3675. * 5 = SOURCE ERRORS -- ABORT REQUESTED *
  3676. * EXIT CONDITION: *
  3677. * ABORTIVE MESSAGE WRITTEN TO THE DAYFILE AND ALL FILES THAT WERE *
  3678. * OPENED ARE CLOSED. *
  3679. * EXTERNAL REFERENCE: SCOPE MARCO MESSAGE. *
  3680. * DESCRIPTION: *
  3681. * CHECKS PARAMETER PASSED TO DETERMINE WHICH DIAGNOSTIC IS TO BE *
  3682. * WRITTEN TO THE DAYFILE. WRITES THE MESSAGE AND JUMPS TO SYNCLSE TO*
  3683. * CLOSE THE FILES THAT ARE OPEN. *
  3684. ************************************************************************
  3685. SYNABT DATA 0
  3686. SA1 X1 GET PARAMETER LIST ADDRESS.
  3687. ZR X1,SYNMSG2 CHECK MESSAGE INDICATOR.
  3688. SX2 3
  3689. IX2 X1-X2
  3690. ZR X2,SYNMSG5 CHECK MESSAGE INDICATOR
  3691. SX2 X1-4
  3692. ZR X2,SYNMSG6 IF ABORT CODE IS 4 (WALKCHAIN INTERNAL ERR)
  3693. SX2 X1-5
  3694. ZR X2,SYNMSG7 IF ABORT CODE IS 5 (SOURCE ERRORS ABORT)
  3695. LX1 58
  3696. NG X1,SYNMSG4
  3697. MESSAGE MSG1
  3698. ABORT
  3699. SYNMSG2 MESSAGE MSG2
  3700. CLOSEM OUTPUT,N CLOSE THE SYSTEM OUTPUT FILE TO FLUSH THE
  3701. BUFFER.
  3702. ABORT
  3703. SYNMSG4 MESSAGE MSG4
  3704. EQ SYNMSG2+2
  3705. SYNMSG5 MESSAGE MSG5
  3706. EQ SYNMSG2+2
  3707.  
  3708. SYNMSG6 MESSAGE MSG6
  3709. EQ SYNMSG2+2
  3710.  
  3711. SYNMSG7 MESSAGE MSG7
  3712. ABORT
  3713.  
  3714. ************************************************************************
  3715. * * SYNCLSE * *
  3716. * *
  3717. * ENTRY CONDITION: *
  3718. * LFLAG INDICATES IF THE OUTPUT LISTING IS ON OR OFF. REWIND IS SET *
  3719. * TO INDICATE HOW THE PRESET FILE IS TO BE CLOSED: 0 = NO REWIND *
  3720. * *
  3721. * *
  3722. * EXIT CONDITIONS: *
  3723. * ALL OF SYNGENS FILES ARE CLOSED. THE PRESET FILE MAY OR MAY NOT BE*
  3724. * REWOUND. *
  3725. * EXTERNAL REFERENCE: *
  3726. * 6RM MARCO: CLOSEM. *
  3727. * DESCRIPTION: *
  3728. * LFLAG IS CHECKED TO SEE IF THE LISTINGS ARE ON. IF IT IS ON, TERM-*
  3729. * INATING HEADERS ARE WRITTEN TO THE PRESET AND OUTPUT FILES, IF ITS*
  3730. * OFF THE HEADERS ARE WRITTEN TO THE PRESET FILE ONLY. IF LFLAG IS *
  3731. * ON THE CROSS REFERENCE FILES ARE CLOSED WITH THE INPUT AND OUTPUT *
  3732. * FILES. REWIND IS CHECKED TO INDICATE HOW THE PRESET FILE IS TO BE *
  3733. * CLOSED: 0 = NO REWIND, 1 = REWIND. *
  3734. ************************************************************************
  3735. SYNCLSE DATA 0
  3736. SA2 A1+1
  3737. SA3 X1 1ST PARAMETER IS DISPLAY-CODED DIAGNOSTIC
  3738. SA1 X2 COUNT AND 2ND PARAMETER IS DISPLAY-CODED
  3739. MX0 30 OCTAL VALUE OF CORE SIZE REQUIRED FOR THE
  3740. LX6 X3 CURRENT COMPILATION.
  3741. BX7 -X0*X1
  3742. SA2 MSG3+3
  3743. LX7 6
  3744. SX4 2
  3745. SA5 LFLAG
  3746. IX7 X4+X7
  3747. SA6 MSG3+5
  3748. BX7 X2+X7
  3749. SA7 A2
  3750. ZR X5,PUTLAST IF THE LISTING FLAG IS TURNED ON, THEN
  3751. CLOSEM SXREF,U CLOSE-UNLOAD CROSS REFERENCE FILES.
  3752. CLOSEM LXREF,U
  3753. CLOSEM DXREF,U
  3754. PUTLAST BSS 0
  3755. CLOSEM INPUT,N CLOSE THE INPUT FILE, NO REWIND.
  3756. CLOSEM OUTPUT,N CLOSE THE OUTPUT FILE. NO REWIND.
  3757. SA3 TFLAG
  3758. ZR X3,SYNCLS1
  3759. CLOSEM TRACEM,U
  3760. SYNCLS1 BSS 0
  3761. MESSAGE MSG3,,RECALL
  3762. SA2 REWIND GET THE ADDRESS OF THE REWIND INDICATOR.
  3763. ZR X2,REWPRST IF THEREWIND INDICATOR IS OFF, CLOSE THE
  3764. * PRESET FILE WITH NO REWIND, OTHERWISE CLOSE
  3765. * THE PRESET FILE WITH A REWIND.
  3766. CLOSEM COMPILE,R CLOSE WITH REWIND.
  3767. EQ SYNCLSE RETURN TO CALLER.
  3768. REWPRST CLOSEM COMPILE,N CLOSE, NO REWIND.
  3769. EQ SYNCLSE RETURN TO CALLER.
  3770. LXCK DATA 0
  3771. SX1 LXREF GET FIT ADDRESS.
  3772. RJ CKEOF CHECK FOR END-OF-FILE.
  3773. SA1 SYNEOF GET THE END-OF-FILE FLAG.
  3774. ZR X1,LXRD CHECK IF FLAG IS ON OR OFF.
  3775. EQ LXREFR RETURN TO CALLER. END-OF-FILE.
  3776. DXCK DATA 0
  3777. SX1 DXREF GET FIT ADDRESS.
  3778. RJ CKEOF CHECK FOR END-OF-FILE.
  3779. SA1 SYNEOF GET THE END-OF-FILE FLAG.
  3780. ZR X1,DXRD CHECK IF FLAG IS ON OR OFF.
  3781. EQ DXREFR RETURN TO CALLER. END-OF-FILE.
  3782. SXCK DATA 0
  3783. SX1 SXREF GET FIT ADDRESS.
  3784. RJ CKEOF CHECK FOR END-OF-FILE.
  3785. SA1 SYNEOF GET THE END-OF-FILE FLAG.
  3786. ZR X1,SXRD CHECK IF FLAG IS ON OR OFF.
  3787. EQ SXREFR END-OF-FILE, RETURN TO CALLER.
  3788. TRACECK DATA 0
  3789. SX1 TRACEM GET FIT ADDRESS.
  3790. RJ CKEOF CHECK FOR END-OF-FILE.
  3791. SA1 SYNEOF GET THE END-OF-FILE FLAG.
  3792. ZR X1,COPY2 CHECK IF FLAG IS ON.
  3793. SX7 0
  3794. SA7 SYNEOF RESET END-OF-FILE FLAG TO ZERO.
  3795. EQ RA65 RETURN TO SYNCOPY
  3796. CKEOF DATA 0
  3797. FETCH X1,FP,X2 FETCH STATUS OF THE FILE POSITION FIELD.
  3798. SB1 X2
  3799. SB2 64 END-OF-INFORMATION STATUS.
  3800. EQ B1,B2,SETEOF IF FP STATUS EQUALS END-OF-INFORMATION,
  3801. SET END-OF-FILE FLAG.
  3802. EQ CKEOF RETURN TO CALLER.
  3803. SETEOF SX7 1
  3804. SA7 SYNEOF SET END-OF-FILE FLAG ON.
  3805. EQ CKEOF RETURN TO CALLER.
  3806. INCK DATA 0 CHECK FOR END OF SYNGEN INPUT.
  3807. SX1 INPUT GET FIT ADDRESS.
  3808. RJ CKEOF
  3809. SA1 SYNEOF CHECK IF END-OF-FILE FLAG IS ON.
  3810. NZ X1,ENDIN EOF REACHED ON SYNGEN INPUT FILE.
  3811. INLFN SB2 8 END-OF-SECTION STATUS (7/8/9).
  3812. NE B1,B2,SYNRD2 NOT END OF SECTION SO READ ANOTHER CARD.
  3813. SX7 1
  3814. SA7 REALEOF
  3815. SA7 SYNEOF SET EOF FLAG.
  3816. ENDIN RJ ENDINP
  3817. EQ SYNREAD
  3818. ENTRY ENDINP
  3819. ENDINP DATA 0
  3820. SA1 LFLAG CHECK FOR LISTING REQUEST
  3821. ZR X1,ENDINP RETURN IF NO LISTING REQUESTED
  3822. REWINDM DXREF
  3823. REWINDM SXREF
  3824. REWINDM LXREF
  3825. EQ ENDINP RETURN TO CALLER
  3826. *THE BUFFERS FOR INPUT, OUTPUT, AND COMPILE ARE EXTRA-BIG IN CASE THEY *
  3827. *SHOULD BE REDEFINED AS I,W FILES BY THE USER. *
  3828. FILE LFN=INPUT,BFS=520,FWB=INBUF,WSA=SYNIWSA,DX=INCK,LT=UL,E
  3829. ,RL=1,BT=C,RT=Z,FL=90
  3830. FILE LFN=OUTPUT,BFS=520,FWB=OUTBUF,WSA=SYNOWSA,LT=UL,ERL=1,B
  3831. ,T=C,RT=Z,FL=137
  3832. FILE LFN=COMPILE,BFS=520,FWB=COMBUF,WSA=SYNCWSA,LT=UL,ERL=1,
  3833. ,BT=C,RT=Z,FL=90
  3834. FILE LFN=LXREF,BFS=260,FWB=LBUF,WSA=LXREFWS,LT=UL,RT=F,BT=C,
  3835. ,FL=10,DX=LXCK
  3836. FILE LFN=DXREF,BFS=260,FWB=DBUF,WSA=DXREFWS,LT=UL,RT=F,BT=C,
  3837. ,FL=10,DX=DXCK
  3838. FILE LFN=SXREF,BFS=260,FWB=SBUF,WSA=SXREFWS,LT=UL,RT=F,BT=C,
  3839. ,FL=10,DX=SXCK
  3840. FILE LFN=TRACEM,BFS=260,WSA=SYNTWSA,LT=UL,RT=F,BT=C,FL=60,DX
  3841. ,=TRACECK,FWB=TBUF
  3842. SQ STLD.RM USERT=(Z,F),USEBT=(C),USE=(OPENM,CLOSEM,GET,PUT,REWIND
  3843. ,M,FETCH,STORE),OMIT=CMM
  3844. SYNWS DATA 10H
  3845. SYNIWSA BSS 9 INPUT WORKING STORAGE AREA.
  3846. SYNOWSA DATA 40H
  3847. DATA 40H
  3848. SYNCWSA DATA 10H PRESET WORKING STORAGE AREA.
  3849. DATA 50H
  3850. LXREFWS BSSZ 1 LABEL CROSS-REFERENCE WORKING STORAGE AREA.
  3851. DXREFWS BSSZ 1 DIAG CROSS-REFERENCE WORKING STORAGE AREA.
  3852. SXREFWS BSSZ 1 SUBR CROSS-REFERENCE WORKING STORAGE AREA.
  3853. SYNTWSA BSSZ 6 TRACE CROSS-REFERENCE WORKING STORAGE AREA.
  3854. SYNIN BSSZ 10 INPUT FET.
  3855. SYNOUT BSSZ 10 OUTPUT FET.
  3856. SYNPRE BSSZ 10 PRESET FET.
  3857. SYNL BSSZ 10 LABEL CROSS-REF FET.
  3858. SYND BSSZ 10 IDAGNOSTIC CROSS-REF FET.
  3859. SYNS BSSZ 10 SUBROUTINE CROSS-REF FET.
  3860. SYNT BSSZ 10 TRACEM FET.
  3861. SYNIRL BSSZ 1 CONTAINS INPUT RECORD LENGTH.
  3862. LFLAG BSS 1 0=NO LISTING 1=LISTING (SYSTEM OUTPUT).
  3863. SKIPFLG BSSZ 1 FLAG FOR CONDITIONAL SKIPPING
  3864. DIRFLAG BSSZ 1 CONDITIONAL SKIP DIRECTIVE ON INPUT
  3865. TFLAG BSS 1
  3866. REWIND BSS 1 0=NO REWIND 1=REWIND (PRESET OUTPUT).
  3867. SYNORL BSSZ 1 CONTAINS OUTPUT RECORD LENGTH.
  3868. SYNEOF BSSZ 1 FLAG TO INDICATE END-OF-FILE.
  3869. SYNMEM BSSZ 1 CONTAINS FIELD LENGTH, RESULT FROM THE
  3870. OUTLEN BSSZ 1 LENGTH OF COMPILE RECORDS
  3871. REALEOF BSSZ 1 TRUE IF REALLY AT EOF ON *INPUT*
  3872. INBUF BSSZ 520 INPUT BUFFER.
  3873. OUTBUF BSSZ 520 OUTPUT BUFFER.
  3874. COMBUF BSSZ 520 PRESET OUTPUT BUFFER.
  3875. LBUF BSSZ 260 LABEL CROSS-REF BUFFER.
  3876. DBUF BSSZ 260 DIAGNOSTIC CROSS-REF BUFFER.
  3877. SBUF BSSZ 260 SUBROUTINE CROSS-REF BUFFER.
  3878. TBUF BSS 1 TRACEM BUFFER - BUFFER ACTUALLY ALLOCATED
  3879. * - EXECUTION TIME.
  3880. MSG3 DIS ,* SYNGEN COMPLETE. SCM USED = *
  3881. DIS ,* DIAGNOSTICS*
  3882. MSG1 DATA 28LCONTROL CARD ERROR *****
  3883. MSG2 DATA C* INSUFFICIENT FIELD LENGTH*
  3884. MSG4 DATA 28LUNEXPECTED EOF ON INPUT ****
  3885. MSG5 DATA 32LERROR LIMIT(100) EXCEEDED *****
  3886. MSG6 DATA C* INTERNAL ERROR (WALKCHAIN)*
  3887. MSG7 DATA C* SOURCE ERRORS -- ABORT REQUESTED*
  3888. CKLFNI DATA 5LINPUT
  3889. INFILE EQU SYNIWSA CONTAINS THE INPUT LFN.
  3890. OUTFILE EQU SYNIWSA+1 CONTAINS THE OUTPUT LFN.
  3891. LSTFILE EQU SYNIWSA+2 CONTAINS THE FILENAME FOR LISTINGS
  3892. END
cdc/nos2.source/nam5871/syngen.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator