User Tools

Site Tools


cdc:nos2.source:nam5871:dldirp

DLDIRP

Table Of Contents

  • [00011] PROC DLDIRP(FIRST$DIR,ERRCODE)
  • [00056] PROC DLABEND
  • [00057] PROC DLDIRC1
  • [00058] PROC DLRDO
  • [00059] PROC DLWRT

Source Code

DLDIRP.txt
  1. *DECK DLDIRP
  2. USETEXT DLFPDEF
  3. USETEXT ARGTBL
  4. USETEXT DIERR
  5. USETEXT DIRTBL
  6. USETEXT ICIOBB
  7. USETEXT IFETB
  8. USETEXT OCIOBB
  9. USETEXT OFETB
  10. USETEXT VDDIR
  11. PROC DLDIRP(FIRST$DIR,ERRCODE);# SCAN DIRECTIVE LINE #
  12. *IF DEF,IMS
  13. #
  14. *1DC DLDIRP
  15. *
  16. * 1. PROC NAME AUTHOR DATE.
  17. * DLDIRP P.C.TAM 78/09/21
  18. *
  19. * 2. FUNCTIONAL DESCRIPTION.
  20. * DIRECTIVE FILE SCANNER.
  21. *
  22. * 3. METHOD USED.
  23. * READ DIRECIVES INTO ARRAY DIRSY
  24. * LOOK FOR VALID KEYWORDS
  25. * IF FOUND, SET CORRESPONDING VALUE IN DIRTBL COMMON BLOCK
  26. * IF FOUND INVALID KEYWORD OR INVALID DIRECTIVE VALUE
  27. * CALL INVDIR TO PROCESS ERROR.
  28. *
  29. * 4. ENTRY PARAMETERS.
  30. * DIRECTIVE FILE.
  31. *
  32. * 5. EXIT PARAMETERS.
  33. * FIRST$DIR INPUT DIRECTIVE FLAG
  34. * ERRCODE ERROR RETURN CODE
  35. *
  36. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  37. * ARGTBL DIERR DIRTBL DLFPDEF
  38. * ICIOBB IFETB OCIOBB OFETB
  39. * VDDIR
  40. *
  41. * 7. ROUTINES CALLED.
  42. * DLABEND ABORT
  43. * DLDIRC1 INDIVIDUAL DIRECTIVE PROCESSOR
  44. * DLRDO READ A WORD FROM FILE
  45. * DLWRT WRITE WORDS INTO FILE
  46. *
  47. * 8. DAYFILE MESSAGES.
  48. * NONE.
  49.  #
  50. *ENDIF
  51. #
  52.   EXTERNAL VARIABLES
  53. #
  54. XREF
  55. BEGIN
  56. PROC DLABEND; # ABORT MAIN LINE #
  57. PROC DLDIRC1; # INDIVIDUAL DIRECTIVE POCESSOR #
  58. PROC DLRDO; # READ A WORD FROM FILE #
  59. PROC DLWRT; # WRITE WORDS INTO FILE #
  60. END
  61. #
  62.   LOCAL VARIABLES
  63. #
  64.  
  65.  
  66.  
  67.  
  68. BASED ARRAY DUMMY;
  69. ;
  70. ARRAY DIRMSG1 S(3);
  71. BEGIN
  72. ITEM DIRM1 C(0,0,18)=["1 DIRECTIVE INPUT-"];
  73. ITEM DIRM2 U(1,48,12)=[0];
  74. ITEM DIRM3 C(2,0,WC)=[" "];
  75. END
  76.  
  77. ARRAY DERRMS2 [1:20];
  78. BEGIN
  79. ITEM DERRCOD I(0);
  80. END
  81.  
  82. ITEM
  83. DERRIND I, # INDEX FOR TABLE DERRMS2 #
  84. COMAF B, # COMMA ALREADY EXISTS FLAG #
  85. ENDLF B, # TRUE WHEN A BUILD OF LONG DIR IS FIN #
  86. EQUF B, # TRUE IF A = SIGN HAS BEEN ENCOUNTERED #
  87. ERRCODE I, # ERROR CODE FOR DIFFERENT ERROR CONDITION#
  88. IEOR B, # END OF RECORD ON FILE #
  89. UNPWD U, # TEMPORARY SAVE AREA FOR UNPACKED CHARS #
  90. UNPTR I, # POINTER TO CHAR IN UNPWD #
  91. CHART U, # TEMPORARY SAVE AREA #
  92. CHARPTR I, # POINTER TO CHAR WORD #
  93. CHAR U, # CHARACTER SAVE AREA #
  94. FIRST$DIR B, # FIRST DIRECTIVE IN RECORD FLAG #
  95. I I; # LOOP VARIABLE #
  96.  
  97. #**********************************************************************#
  98.  
  99. BEGIN
  100. #
  101.   MODULE ONE READ DIRECTIVES
  102. #
  103. # PRESET LOCAL VARIABLES #
  104.  
  105. FOR I = 1 STEP 1 UNTIL DIRNO
  106. DO
  107. BEGIN
  108. DIRWD0[I] = 0; # ZERO DIRECTIVE VALUES #
  109. END
  110.  
  111. DERRIND = 0;
  112. COMAF = FALSE;
  113. FIRST$DIR = TRUE;
  114. EQUF = FALSE;
  115. ENDLF = FALSE;
  116. ERRCODE = 0;
  117. IEOR = FALSE;
  118. UNPWD = 0;
  119. UNPTR = 0;
  120. CHART = 0;
  121. CHARPTR = 0;
  122. CHAR = 0;
  123.  
  124. # WRITE HEADER FOR DIRECTIVE INPUT 80X80 LIST #
  125.  
  126. DLWRT(OFET, DIRMSG1, 3);
  127.  
  128. FOR CHARPTR = CHARPTR WHILE NOT IEOR
  129. DO
  130. BEGIN
  131. DLRDO(IFET, CHAR); # READ A WORD FROM DIRECTIVE FILE #
  132. DLWRT(OFET, CHAR, 1);# LIST DIRECTIVE INPUT #
  133.  
  134. # LOOP TO PROCESS EACH CHARACTER IN WORD #
  135. FOR CHARPTR = 0 STEP CL WHILE CHARPTR LQ WL-CL
  136. DO
  137. BEGIN
  138. CHART = B<CHARPTR, CL> CHAR;
  139. IF (O"01" LQ CHART AND CHART LQ O"44") OR # CHAR ALPHANUMERIC#
  140. CHART EQ O"54" # CHAR IS = #
  141. THEN
  142. BEGIN
  143. IF UNPTR GR WL-CL
  144. THEN
  145. BEGIN # DIRECTIVE EXPRESSION HAS MORE THAN 10 CH#
  146. ERRCODE = D$ERR1;
  147. END
  148. ELSE
  149. BEGIN # SAVE CHARACTER IN ASSEMBLY #
  150. B<UNPTR, CL>UNPWD = CHART;
  151. UNPTR = UNPTR + CL;
  152. IF EQUF
  153. THEN
  154. ENDLF = TRUE;
  155. IF CHART EQ O"54" # CHAR IS = #
  156. THEN
  157. EQUF = TRUE;
  158. END
  159. END
  160. ELSE
  161. IF CHART EQ O"55" OR # CHARACTER IS A SPACE #
  162. CHART EQ O"56" # CHARACTER IS A COMMA #
  163. THEN
  164. BEGIN
  165. IF UNPTR EQ 0 # NO WORD ASSEMBLED #
  166. THEN
  167. BEGIN
  168. IF CHART EQ O"56"
  169. THEN
  170. BEGIN # CHARACTER IS A COMMA #
  171. IF COMAF
  172. THEN
  173. ERRCODE = D$ERR2;# IT APPEARED MORE THAN ONCE #
  174. ELSE
  175. IF FIRST$DIR
  176. THEN
  177. ERRCODE = D$ERR3;# CANNOT HAVE LEADING COMMAS #
  178. END
  179. END
  180. ELSE
  181. BEGIN # SEPARATOR WITH WORD ASSEMBLED #
  182. IF UNPTR EQ CL OR # SHORT DIRECTIVE #
  183. ENDLF # LONG DIRECTIVE #
  184. THEN
  185. BEGIN
  186. DLDIRC1(UNPWD, ERRCODE);# PROCESS ASSEMBLED WORD #
  187. FIRST$DIR = FALSE;
  188. UNPWD = 0;
  189. UNPTR = 0;
  190. EQUF = FALSE;
  191. ENDLF = FALSE;
  192. COMAF = FALSE;
  193. END
  194. END
  195. IF CHART EQ O"56" # CHARACTER IS A COMMA #
  196. THEN
  197. COMAF = TRUE; # SET COMMA FOUND FLAG #
  198. END
  199. ELSE
  200. IF CHART NQ 0 # NOT END OF LINE MARKER #
  201. THEN
  202. BEGIN
  203. ERRCODE = D$ICHER;
  204. END
  205. IF ERRCODE NQ 0
  206. THEN
  207. BEGIN
  208. IF DERRIND NQ 20
  209. THEN
  210. BEGIN # ONLY LOG 1ST 20 ERR MSG #
  211. DERRIND = DERRIND + 1;
  212. DERRCOD[DERRIND] = ERRCODE;
  213. END
  214. ERRCODE = 0;
  215. END
  216. END
  217. IF B<48,12>CHAR EQ 0# END OF LINE CHECK #
  218. THEN
  219. BEGIN
  220. IEOR = TRUE; # NO MORE WORDS TO READ #
  221. IF UNPTR NQ 0
  222. THEN
  223. BEGIN # ONE MORE TO SAVE #
  224. DLDIRC1(UNPWD, ERRCODE); # PROCESS ASSEMBLED DIRECTIVE #
  225. FIRST$DIR = FALSE;
  226. IF ERRCODE NQ 0
  227. THEN
  228. BEGIN
  229. IF DERRIND NQ 20
  230. THEN
  231. BEGIN # ONLY LOG 1ST 20 ERR MSG #
  232. DERRIND = DERRIND + 1;
  233. DERRCOD[DERRIND] = ERRCODE;
  234. END
  235. ERRCODE = 0;
  236. END
  237. END
  238. END
  239. END
  240.  
  241. # CHECK IF DLDIRP FOUND ANY ERROR CONDTION #
  242.  
  243. IF DERRIND NQ 0
  244. THEN
  245. BEGIN
  246.  
  247. FOR I = 1 STEP 1 WHILE I LQ DERRIND
  248. DO
  249. BEGIN # OUTPUT ERROR MSG #
  250. P<DUMMY> = LOC(D$EM0[DERRCOD[I]]);
  251. DLWRT(OFET, DUMMY, 5);
  252. END
  253. IF ARGENTR[DOPTION] EQ 0
  254. THEN # DO NOT IGNORE ERROR #
  255. DLABEND; # ABORT #
  256. ERRCODE = DERRIND;
  257. END
  258.  
  259. END
  260. TERM
cdc/nos2.source/nam5871/dldirp.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator