IMPORTER.LST 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. Listing:
  2. 1 MODULE Importer;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1990 PMI
  8. 7 * Green Bay, WI
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 *)
  13. 12
  14. 13 IMPORT EnvironUtils;
  15. 14 IMPORT ErrorManager;
  16. 15 IMPORT GenLists;
  17. 16 IMPORT ImpLists;
  18. 17 IMPORT KbdInput;
  19. 18 IMPORT ListUtils;
  20. 19 IMPORT LowLevel;
  21. 20 IMPORT M2Strings;
  22. 21 IMPORT Numbers;
  23. 22 IMPORT Parser;
  24. 23 IMPORT PosUtils;
  25. 24 IMPORT StrEdit;
  26. 25 IMPORT StringIO;
  27. 26 IMPORT SYSTEM;
  28. 27 IMPORT InitCompilerMods;
  29. 28
  30. 29 (*# call(reg_param => (),
  31. 30 near_call => off,
  32. 31 ds_eq_ss => off) *)
  33. 32 (*# data(near_ptr => off) *)
  34. 33
  35. 34 VAR
  36. 35 x, fname1, fname2, CurrentWord, LastWord: ARRAY [0..79] OF CHAR;
  37. ***** ^ not supported yet
  38. ***** ^ not supported yet
  39. 36 Terminator: CHAR;
  40. 37 StartOfImpList, EndOfImpList, LineCnt, ColCnt: CARDINAL;
  41. 38 TextList, TmpList, Imports: GenLists.GenList;
  42. ***** ^ not supported yet
  43. 39 cnt, FoundSpot, dumc: CARDINAL;
  44. 40 Sorting, Unqualifying, Qualifying : BOOLEAN;
  45. 41 Dumstr: ARRAY [0..0] OF CHAR;
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. 42
  49. 43
  50. 44
  51. 45 PROCEDURE yes( TheQuestion: ARRAY OF CHAR ): BOOLEAN;
  52. ***** ^ not supported yet
  53. 46 VAR
  54. 47 tmpkey: CARDINAL;
  55. 48 BEGIN
  56. 49 StringIO.WriteEol( StringIO.outp, '' );
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. 50 StringIO.WriteStr( StringIO.outp, TheQuestion );
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. ***** ^ not supported yet
  68. 51 tmpkey := KbdInput.CAPkey( KbdInput.KeyHit( KbdInput.YorN ) );
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 52 IF ORD('Y') = tmpkey THEN
  76. ***** ^ undeclared identifier
  77. ***** ^ not supported yet
  78. 53 StringIO.WriteStr( StringIO.outp, 'yes' );
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. 54 RETURN TRUE;
  85. 55 ELSIF ORD('Q') = tmpkey THEN
  86. ***** ^ undeclared identifier
  87. ***** ^ not supported yet
  88. 56 ErrorManager.StraightToDOS('');
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. 57 END;
  93. 58 StringIO.WriteStr( StringIO.outp, 'no' );
  94. ***** ^ not supported yet
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 59 RETURN FALSE;
  100. 60 END yes;
  101. ***** ^ not supported yet
  102. 61
  103. 62 PROCEDURE NextWord( VAR TheStr: ARRAY OF CHAR );
  104. ***** ^ not supported yet
  105. 63 BEGIN
  106. 64 Parser.GetNextWord( TextList, LineCnt, ColCnt, TheStr, Terminator );
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. 65 M2Strings.Assign( CurrentWord, LastWord );
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 66 M2Strings.Assign( TheStr, CurrentWord );
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. 67 END NextWord;
  123. ***** ^ not supported yet
  124. 68
  125. 69
  126. 70 PROCEDURE StrInList( TheStr: ARRAY OF CHAR; TheList: GenLists.GenList ):
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 71 BOOLEAN;
  130. 72 VAR
  131. 73 ListEnd, cnt: CARDINAL;
  132. 74 tmpstr: ARRAY [0..79] OF CHAR;
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 75 BEGIN
  136. 76 ListEnd := GenLists.ListLength(TheList);
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. 77 FOR cnt := 1 TO ListEnd DO
  141. 78 ListUtils.GetStr( TheList, cnt, tmpstr );
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. 79 IF PosUtils.Equal( tmpstr, TheStr ) THEN
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. 80 RETURN TRUE;
  152. 81 END;
  153. 82 END;
  154. 83 RETURN FALSE;
  155. 84 END StrInList;
  156. ***** ^ not supported yet
  157. 85
  158. 86
  159. 87 PROCEDURE InsertElmts( ToBeInserted: GenLists.GenList; VAR IntoThis:
  160. ***** ^ not supported yet
  161. 88 GenLists.GenList; AtThisSpot: CARDINAL );
  162. ***** ^ not supported yet
  163. 89 VAR
  164. 90 lngth1, tmpsize, cnt, TypeCode: CARDINAL;
  165. 91 tmpadr: SYSTEM.ADDRESS;
  166. ***** ^ not supported yet
  167. 92 BEGIN
  168. 93 lngth1 := GenLists.ListLength( ToBeInserted );
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. 94 FOR cnt := lngth1 TO 1 BY -1 DO
  173. 95 (* it's simpler to insert backwards *)
  174. 96 GenLists.GetElmtAdr( ToBeInserted, cnt, tmpadr, tmpsize, TypeCode );
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. ***** ^ not supported yet
  180. 97 GenLists.ListInsertAdr( tmpadr, tmpsize, TypeCode, IntoThis, AtThisSpot );
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 98 END;
  187. 99 END InsertElmts;
  188. ***** ^ not supported yet
  189. 100
  190. 101
  191. 102 PROCEDURE Alphabetize( adr1: SYSTEM.ADDRESS; size1: CARDINAL; adr2:
  192. ***** ^ not supported yet
  193. 103 SYSTEM.ADDRESS; size2: CARDINAL ): INTEGER;
  194. ***** ^ not supported yet
  195. 104 VAR
  196. 105 tmp1, tmp2: ARRAY [0..79] OF CHAR;
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 106 BEGIN
  200. 107 LowLevel.Move( adr1, SYSTEM.ADR(tmp1), Numbers.Min(size1, 79) );
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 108 tmp1[Numbers.Min(size1, 79)] := 0C;
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. 109 LowLevel.Move( adr2, SYSTEM.ADR(tmp2), Numbers.Min(size2, 79) );
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 110 tmp2[Numbers.Min(size2, 79)] := 0C;
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. 111 StrEdit.CAPstr( tmp1 );
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. 112 StrEdit.CAPstr( tmp2 );
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 113 RETURN M2Strings.CompareStr( tmp1, tmp2 );
  239. ***** ^ not supported yet
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 114 END Alphabetize;
  244. ***** ^ not supported yet
  245. 115
  246. 116
  247. 117 PROCEDURE MakeSortedImpList( TopList: GenLists.GenList; VAR OutList: GenLists.GenList );
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. 118 VAR
  251. 119 SubList: GenLists.GenList;
  252. ***** ^ not supported yet
  253. 120 TopListEnd, TopListCount: CARDINAL;
  254. 121 SubListCount: CARDINAL;
  255. 122 x: ARRAY [0..31] OF CHAR;
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. 123 WorkStr: ARRAY [0..1023] OF CHAR;
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. 124 BEGIN
  262. 125 TopListCount := 0;
  263. 126 TopListEnd := GenLists.ListLength(TopList);
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. ***** ^ not supported yet
  267. 127 IF TopListEnd < 2 THEN
  268. 128 RETURN;
  269. 129 END;
  270. 130 GenLists.NewList( OutList );
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. 131 REPEAT
  275. 132 WorkStr := '';
  276. ***** ^ not supported yet
  277. ***** ^ incompatible assignment
  278. 133 INC( TopListCount );
  279. ***** ^ undeclared identifier
  280. ***** ^ not supported yet
  281. 134 ListUtils.GetStr( TopList, TopListCount, x );
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. 135 (* x now ought to contain a module name *)
  287. 136 INC( TopListCount );
  288. ***** ^ undeclared identifier
  289. ***** ^ not supported yet
  290. 137 GenLists.GetChildList( TopList, TopListCount, SubList );
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. 138 IF GenLists.Initialized( SubList ) THEN
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. 139 GenLists.SortList( SubList, Alphabetize );
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. 140 StrEdit.Append( WorkStr, 'FROM ' );
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. ***** ^ not supported yet
  309. 141 StrEdit.Append( WorkStr, x );
  310. ***** ^ not supported yet
  311. ***** ^ not supported yet
  312. ***** ^ not supported yet
  313. ***** ^ not supported yet
  314. 142 StrEdit.Append( WorkStr, ' IMPORT ' );
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 143 SubListCount := 1;
  320. 144 LOOP
  321. 145 ListUtils.GetStr( SubList, SubListCount, x );
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. 146 StrEdit.Append( WorkStr, x );
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. 147 INC( SubListCount );
  332. ***** ^ undeclared identifier
  333. ***** ^ not supported yet
  334. 148 IF SubListCount > GenLists.ListLength(SubList) THEN
  335. ***** ^ not supported yet
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 149 StrEdit.Append( WorkStr, ';' );
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. 150 EXIT;
  344. 151 ELSE
  345. 152 StrEdit.Append( WorkStr, ', ' );
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 153 END;
  351. 154 END;
  352. 155 ELSE
  353. 156 (* This is a FromLess import *)
  354. 157 StrEdit.Append( WorkStr, 'IMPORT ' );
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. 158 StrEdit.Append( WorkStr, x );
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. ***** ^ not supported yet
  364. 159 StrEdit.Append( WorkStr, ';' );
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. ***** ^ not supported yet
  369. 160 END;
  370. 161 GenLists.ListInsert( WorkStr, GenLists.StrCode, OutList, 65535 );
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. 162 UNTIL TopListCount = TopListEnd;
  379. 163 GenLists.SortList( OutList, Alphabetize );
  380. ***** ^ not supported yet
  381. ***** ^ not supported yet
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. 164 ListUtils.CheckLength( OutList, 5, 75 );
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. 165 END MakeSortedImpList;
  390. ***** ^ not supported yet
  391. 166
  392. 167
  393. 168 PROCEDURE InImportList( VAR TheWord: ARRAY OF CHAR; ImportList:
  394. ***** ^ not supported yet
  395. 169 GenLists.GenList; VAR ModuleName: ARRAY OF CHAR ): BOOLEAN;
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 170 VAR
  399. 171 SubList: GenLists.GenList;
  400. ***** ^ not supported yet
  401. 172 TopListCount: CARDINAL;
  402. 173 BEGIN
  403. 174 TopListCount := 0;
  404. 175 REPEAT
  405. 176 INC( TopListCount );
  406. ***** ^ undeclared identifier
  407. ***** ^ not supported yet
  408. 177 ListUtils.GetStr( ImportList, TopListCount, ModuleName );
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. 178 INC( TopListCount );
  414. ***** ^ undeclared identifier
  415. ***** ^ not supported yet
  416. 179 GenLists.GetChildList( ImportList, TopListCount, SubList );
  417. ***** ^ not supported yet
  418. ***** ^ not supported yet
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. 180 IF GenLists.Initialized( SubList ) AND StrInList(TheWord, SubList) THEN
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. 181 RETURN TRUE;
  429. 182 END;
  430. 183 UNTIL TopListCount = GenLists.ListLength(ImportList);
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. 184 RETURN FALSE;
  435. 185 END InImportList;
  436. ***** ^ not supported yet
  437. 186
  438. 187
  439. 188 PROCEDURE IsModuleName( ModuleName: ARRAY OF CHAR; ImportList:
  440. ***** ^ not supported yet
  441. 189 GenLists.GenList; VAR SubList: GenLists.GenList ): BOOLEAN;
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. 190 VAR
  445. 191 TopListCount: CARDINAL;
  446. 192 tmpstr: ARRAY [0..79] OF CHAR;
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. 193 BEGIN
  450. 194 TopListCount := 0;
  451. 195 GenLists.NilList( SubList );
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. 196 REPEAT
  456. 197 INC( TopListCount );
  457. ***** ^ undeclared identifier
  458. ***** ^ not supported yet
  459. 198 ListUtils.GetStr( ImportList, TopListCount, tmpstr );
  460. ***** ^ not supported yet
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. 199 INC( TopListCount );
  465. ***** ^ undeclared identifier
  466. ***** ^ not supported yet
  467. 200 IF PosUtils.Equal( ModuleName, tmpstr ) THEN
  468. ***** ^ not supported yet
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. ***** ^ not supported yet
  472. 201 GenLists.GetChildList( ImportList, TopListCount, SubList );
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. 202 RETURN TRUE;
  478. 203 END;
  479. 204 UNTIL TopListCount = GenLists.ListLength(ImportList);
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. ***** ^ not supported yet
  483. 205 RETURN FALSE;
  484. 206 END IsModuleName;
  485. ***** ^ not supported yet
  486. 207
  487. 208
  488. 209 PROCEDURE QualifyAll();
  489. 210 VAR
  490. 211 TopListCount: CARDINAL;
  491. 212 tmpstr: ARRAY [0..79] OF CHAR;
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. 213 ModuleName: ARRAY [0..31] OF CHAR;
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. 214 TextEnd, ImportsEnd, LastLine : CARDINAL;
  498. 215 LocalNilList, SubList: GenLists.GenList;
  499. ***** ^ not supported yet
  500. 216 BEGIN
  501. 217 LastLine := 0;
  502. 218 TextEnd := GenLists.ListLength(TextList);
  503. ***** ^ not supported yet
  504. ***** ^ not supported yet
  505. ***** ^ not supported yet
  506. 219 ImportsEnd := GenLists.ListLength(Imports);
  507. ***** ^ not supported yet
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. 220 REPEAT
  511. 221 NextWord( CurrentWord );
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. 222 IF InImportList( CurrentWord, Imports, ModuleName ) THEN
  515. ***** ^ not supported yet
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. ***** ^ not supported yet
  519. 223 M2Strings.Insert( '.', Parser.TheLine, Parser.LastIndex );
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. ***** ^ not supported yet
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. ***** ^ not supported yet
  526. 224 M2Strings.Insert( ModuleName, Parser.TheLine, Parser.LastIndex );
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 225 GenLists.ListReplace( Parser.TheLine, GenLists.StrCode, TextList, LineCnt );
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. ***** ^ not supported yet
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. 226 INC( ColCnt, M2Strings.Length(ModuleName) + 1 );
  544. ***** ^ undeclared identifier
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. 227 END;
  550. 228 IF LineCnt > LastLine THEN
  551. 229 StringIO.WriteStr( StringIO.outp, '.' );
  552. ***** ^ not supported yet
  553. ***** ^ not supported yet
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. 230 LastLine := LineCnt;
  558. 231 END;
  559. 232 UNTIL LineCnt >= TextEnd;
  560. 233 TopListCount := 0;
  561. 234 GenLists.NilList( LocalNilList );
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. 235 REPEAT
  566. 236 INC( TopListCount, 2 );
  567. ***** ^ undeclared identifier
  568. ***** ^ not supported yet
  569. 237 GenLists.ListReplace( LocalNilList, GenLists.ListCode, Imports, TopListCount );
  570. ***** ^ not supported yet
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. 238 (*ListReplace takes care of deallocating the old list.
  578. 239 Note that we don't do GetChildList's and
  579. 240 DisposeList's because that wouldn't nil out the copy
  580. 241 of the pointer that's in the Imports list.*)
  581. 242 UNTIL TopListCount >= ImportsEnd;
  582. 243 END QualifyAll;
  583. ***** ^ not supported yet
  584. 244
  585. 245
  586. 246 PROCEDURE UnqualifyAll();
  587. 247 VAR
  588. 248 ModuleName, tmpstr: ARRAY [0..31] OF CHAR;
  589. ***** ^ not supported yet
  590. ***** ^ not supported yet
  591. 249 SubList: GenLists.GenList;
  592. ***** ^ not supported yet
  593. 250 LastLine : CARDINAL;
  594. 251 BEGIN
  595. 252 LastLine := 0;
  596. 253 REPEAT
  597. 254 NextWord( CurrentWord );
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. 255 IF IsModuleName( CurrentWord, Imports, SubList ) AND
  601. ***** ^ not supported yet
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. 256 (Terminator = '.') THEN
  606. 257 M2Strings.Assign( CurrentWord, ModuleName );
  607. ***** ^ not supported yet
  608. ***** ^ not supported yet
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 258 NextWord( CurrentWord );
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. 259 IF NOT GenLists.Initialized( SubList ) THEN
  615. ***** ^ not supported yet
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. 260 GenLists.NewList( SubList );
  619. ***** ^ not supported yet
  620. ***** ^ not supported yet
  621. ***** ^ not supported yet
  622. 261 GenLists.ListReplace( SubList, GenLists.ListCode, Imports,
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 262 GenLists.ElmtNow(Imports) );
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. ***** ^ not supported yet
  633. 263 END;
  634. 264 IF NOT StrInList( CurrentWord, SubList ) THEN
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. 265 GenLists.ListInsert( CurrentWord, GenLists.StrCode, SubList, 65535 );
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. 266 END;
  647. 267 StrEdit.Append( ModuleName, '.' );
  648. ***** ^ not supported yet
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. ***** ^ not supported yet
  652. 268 StrEdit.ReplaceStr( ModuleName, '', Parser.TheLine );
  653. ***** ^ not supported yet
  654. ***** ^ not supported yet
  655. ***** ^ not supported yet
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. 269 GenLists.ListReplace( Parser.TheLine, GenLists.StrCode, TextList, LineCnt );
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. ***** ^ not supported yet
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. 270 DEC( ColCnt, M2Strings.Length(ModuleName) + 1 );
  668. ***** ^ undeclared identifier
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. 271 END;
  674. 272 IF LineCnt > LastLine THEN
  675. 273 StringIO.WriteStr( StringIO.outp, '.' );
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. 274 LastLine := LineCnt;
  682. 275 END;
  683. 276 UNTIL LineCnt >= GenLists.ListLength(TextList);
  684. ***** ^ not supported yet
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. 277 END UnqualifyAll;
  688. ***** ^ not supported yet
  689. 278
  690. 279
  691. 280 BEGIN
  692. 281 IF NOT EnvironUtils.ParsedParam( 1, fname1 ) THEN
  693. ***** ^ not supported yet
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. 282 StringIO.WriteStr( StringIO.outp, 'File name: ' );
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 283 StringIO.ReadStr( StringIO.inp, fname1 );
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. 284 IF M2Strings.Length(fname1) = 0 THEN
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 285 RETURN;
  713. ***** ^ bad RETURN
  714. 286 END;
  715. 287 END;
  716. 288 PosUtils.CaseSensitive := FALSE;
  717. ***** ^ not supported yet
  718. ***** ^ not supported yet
  719. 289 IF NOT PosUtils.Present( '.', fname1 ) THEN
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. 290 StrEdit.Append( fname1, '.mod' );
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. 291 END;
  729. 292 PosUtils.CaseSensitive := TRUE;
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. 293 IF NOT EnvironUtils.ParsedParam( 2, Dumstr ) THEN
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 294 Qualifying := yes( 'Qualify all imported identifiers? ');
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. 295 IF Qualifying THEN
  740. 296 Unqualifying := FALSE;
  741. 297 Sorting := FALSE;
  742. 298 ELSE
  743. 299 Unqualifying := yes( 'Unqualify all qualified identifiers? ');
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 300 IF Unqualifying THEN
  747. 301 Sorting := FALSE;
  748. 302 ELSE
  749. 303 Sorting := yes( 'Sort identifiers in present import list? ');
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. 304 END;
  753. 305 END;
  754. 306 ELSE
  755. 307 Sorting := CAP(Dumstr[0]) = 'S';
  756. ***** ^ undeclared identifier
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. 308 Qualifying := CAP(Dumstr[0]) = 'Q';
  760. ***** ^ undeclared identifier
  761. ***** ^ not supported yet
  762. ***** ^ not supported yet
  763. 309 Unqualifying := CAP(Dumstr[0]) = 'U';
  764. ***** ^ undeclared identifier
  765. ***** ^ not supported yet
  766. ***** ^ not supported yet
  767. 310 END;
  768. 311
  769. 312 LineCnt := 1;
  770. 313 ColCnt := 0;
  771. 314 StartOfImpList := 0;
  772. 315 EndOfImpList := 0;
  773. 316 GenLists.NewList( TextList );
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. 317 StringIO.PrintMessage( ListUtils.TextFileToList( fname1, TextList ) );
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. 318 LastWord := '';
  785. ***** ^ not supported yet
  786. ***** ^ incompatible assignment
  787. 319 CurrentWord := '';
  788. ***** ^ not supported yet
  789. ***** ^ incompatible assignment
  790. 320
  791. 321 ImpLists.ExtractImportList( TextList, Imports, StartOfImpList, EndOfImpList );
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. ***** ^ not supported yet
  797. 322
  798. 323 IF Qualifying THEN
  799. 324 QualifyAll();
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. 325 ELSIF Unqualifying THEN
  803. 326 UnqualifyAll();
  804. ***** ^ not supported yet
  805. ***** ^ not supported yet
  806. 327 END;
  807. 328 IF StartOfImpList > 0 THEN
  808. 329 MakeSortedImpList( Imports, TmpList );
  809. ***** ^ not supported yet
  810. ***** ^ not supported yet
  811. ***** ^ not supported yet
  812. 330 GenLists.DisposeList( Imports );
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. ***** ^ not supported yet
  816. 331 GenLists.ListDelete( TextList, StartOfImpList, EndOfImpList -
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. 332 StartOfImpList + 1 );
  821. ***** ^ not supported yet
  822. 333 GenLists.ListInsert( '', GenLists.StrCode, TextList, StartOfImpList );
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. ***** ^ not supported yet
  826. ***** ^ not supported yet
  827. ***** ^ not supported yet
  828. ***** ^ not supported yet
  829. 334 (* insert a blank line to separate imports from rest of
  830. 335 program *)
  831. 336 InsertElmts( TmpList, TextList, StartOfImpList );
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. ***** ^ not supported yet
  835. ***** ^ not supported yet
  836. 337 GenLists.DisposeList( TmpList );
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. ***** ^ not supported yet
  840. 338 END;
  841. 339 StringIO.PrintMessage( ListUtils.TextListToFile( TextList, fname1 ) );
  842. ***** ^ not supported yet
  843. ***** ^ not supported yet
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. ***** ^ not supported yet
  848. 340 GenLists.DisposeList( TextList );
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. 341 END Importer.
  853. 510 errors