pmodules.pas 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. Handles the parsing and loading of the modules (ppufiles)
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit pmodules;
  19. {define TEST_IMPL does not work well }
  20. interface
  21. uses
  22. files;
  23. procedure addlinkerfiles(hp:pmodule);
  24. procedure loadsystemunit;
  25. procedure proc_unit;
  26. procedure proc_program(islibrary : boolean);
  27. implementation
  28. uses
  29. cobjects,verbose,systems,globals,
  30. symtable,aasm,hcodegen,
  31. link,assemble,import
  32. {$ifndef OLDPPU}
  33. ,ppu
  34. {$endif OLDPPU}
  35. {$ifdef i386}
  36. ,i386
  37. {$endif}
  38. {$ifdef m68k}
  39. ,m68k
  40. {$endif}
  41. ,scanner,pbase,psystem,pdecl,psub,parser;
  42. procedure addlinkerfiles(hp:pmodule);
  43. begin
  44. with hp^ do
  45. begin
  46. while not linkofiles.empty do
  47. Linker.AddObject(linkofiles.Get);
  48. while not linksharedlibs.empty do
  49. Linker.AddSharedLibrary(linksharedlibs.Get);
  50. while not linkstaticlibs.empty do
  51. Linker.AddStaticLibrary(linkstaticlibs.Get);
  52. end;
  53. end;
  54. procedure insertsegment;
  55. procedure fixseg(p:paasmoutput;sec:tsection);
  56. begin
  57. p^.insert(new(pai_section,init(sec)));
  58. if (cs_smartlink in aktswitches) then
  59. p^.insert(new(pai_cut,init));
  60. p^.concat(new(pai_section,init(sec_none)));
  61. end;
  62. begin
  63. {Insert Ident of the compiler}
  64. if (not (cs_smartlink in aktswitches))
  65. {$ifndef EXTDEBUG}
  66. and (not current_module^.is_unit)
  67. {$endif}
  68. then
  69. begin
  70. datasegment^.insert(new(pai_align,init(4)));
  71. datasegment^.insert(new(pai_string,init('FPC '+version_string+' for '+target_string+' - '+target_info.short_name)));
  72. end;
  73. { Insert start and end of sections }
  74. fixseg(codesegment,sec_code);
  75. fixseg(datasegment,sec_data);
  76. fixseg(bsssegment,sec_bss);
  77. fixseg(consts,sec_data);
  78. end;
  79. procedure insertheap;
  80. begin
  81. if (cs_smartlink in aktswitches) then
  82. begin
  83. bsssegment^.concat(new(pai_cut,init));
  84. datasegment^.concat(new(pai_cut,init));
  85. end;
  86. { On the Macintosh Classic M68k Architecture
  87. The Heap variable is simply a POINTER to the
  88. real HEAP. The HEAP must be set up by the RTL
  89. and must store the pointer in this value.
  90. On OS/2 the heap is also intialized by the RTL. We do
  91. not output a pointer }
  92. case target_info.target of
  93. {$ifdef i386}
  94. target_OS2 : ;
  95. {$endif i386}
  96. {$ifdef m68k}
  97. target_Mac68K : bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
  98. {$endif m68k}
  99. else
  100. bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize)));
  101. end;
  102. {$ifdef i386}
  103. datasegment^.concat(new(pai_symbol,init_global('HEAPSIZE')));
  104. {$endif i386}
  105. {$ifdef m68k}
  106. datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
  107. {$endif m68k}
  108. datasegment^.concat(new(pai_const,init_32bit(heapsize)));
  109. end;
  110. procedure inserttargetspecific;
  111. begin
  112. {$ifdef i386}
  113. case target_info.target of
  114. target_GO32V2 : begin
  115. { stacksize can be specified }
  116. datasegment^.concat(new(pai_symbol,init_global('__stklen')));
  117. datasegment^.concat(new(pai_const,init_32bit(stacksize)));
  118. end;
  119. target_WIN32 : begin
  120. { Generate an external entry to be sure that _mainCRTStarup will be
  121. linked, can't use concat_external because those aren't written for
  122. asw (PFV) }
  123. datasegment^.concat(new(pai_const,init_symbol('_mainCRTStartup')));
  124. end;
  125. end;
  126. {$endif i386}
  127. end;
  128. {$ifndef OLDPPU}
  129. function loadunit(const s : string;compile_system:boolean) : pmodule;forward;
  130. procedure load_usedunits(compile_system:boolean);
  131. var
  132. pu : pused_unit;
  133. loaded_unit : pmodule;
  134. nextmapentry : longint;
  135. begin
  136. { init the map }
  137. new(current_module^.map);
  138. nextmapentry:=1;
  139. { load the used units from interface }
  140. pu:=pused_unit(current_module^.used_units.first);
  141. while assigned(pu) do
  142. begin
  143. if (not pu^.loaded) and (pu^.in_interface) then
  144. begin
  145. loaded_unit:=loadunit(pu^.name^,false);
  146. if current_module^.compiled then
  147. exit;
  148. { register unit in used units }
  149. pu^.u:=loaded_unit;
  150. pu^.loaded:=true;
  151. { need to recompile the current unit ? }
  152. if loaded_unit^.crc<>pu^.checksum then
  153. begin
  154. current_module^.do_compile:=true;
  155. exit;
  156. end;
  157. { setup the map entry for deref }
  158. current_module^.map^[nextmapentry]:=loaded_unit^.symtable;
  159. inc(nextmapentry);
  160. if nextmapentry>maxunits then
  161. Message(unit_f_too_much_units);
  162. end;
  163. pu:=pused_unit(pu^.next);
  164. end;
  165. { ok, now load the unit }
  166. current_module^.symtable:=new(punitsymtable,loadasunit);
  167. { if this is the system unit insert the intern symbols }
  168. if compile_system then
  169. begin
  170. make_ref:=false;
  171. insertinternsyms(psymtable(current_module^.symtable));
  172. make_ref:=true;
  173. end;
  174. { now only read the implementation part }
  175. current_module^.in_implementation:=true;
  176. { load the used units from implementation }
  177. pu:=pused_unit(current_module^.used_units.first);
  178. while assigned(pu) do
  179. begin
  180. if (not pu^.loaded) and (not pu^.in_interface) then
  181. begin
  182. loaded_unit:=loadunit(pu^.name^,false);
  183. if current_module^.compiled then
  184. exit;
  185. { register unit in used units }
  186. pu^.u:=loaded_unit;
  187. pu^.loaded:=true;
  188. {$ifdef TEST_IMPL}
  189. { need to recompile the current unit ? }
  190. if loaded_unit^.crc<>pu^.checksum then
  191. begin
  192. current_module^.do_compile:=true;
  193. exit;
  194. end;
  195. { setup the map entry for deref }
  196. current_module^.map^[nextmapentry]:=loaded_unit^.symtable;
  197. inc(nextmapentry);
  198. if nextmapentry>maxunits then
  199. Message(unit_f_too_much_units);
  200. {$endif TEST_IMPL}
  201. end;
  202. pu:=pused_unit(pu^.next);
  203. end;
  204. { remove the map, it's not needed anymore }
  205. dispose(current_module^.map);
  206. current_module^.map:=nil;
  207. end;
  208. function loadunit(const s : string;compile_system:boolean) : pmodule;
  209. var
  210. st : punitsymtable;
  211. old_current_ppu : pppufile;
  212. old_current_module,hp : pmodule;
  213. procedure loadppufile;
  214. begin
  215. { load interface section }
  216. if not current_module^.do_compile then
  217. load_interface;
  218. { only load units when we don't recompile }
  219. if not current_module^.do_compile then
  220. load_usedunits(compile_system);
  221. { recompile if set }
  222. if current_module^.do_compile then
  223. begin
  224. { we needn't the ppufile }
  225. if assigned(current_module^.ppufile) then
  226. begin
  227. dispose(current_module^.ppufile,done);
  228. current_module^.ppufile:=nil;
  229. end;
  230. { recompile the unit or give a fatal error if sources not available }
  231. if not(current_module^.sources_avail) then
  232. Message1(unit_f_cant_compile_unit,current_module^.modulename^)
  233. else
  234. begin
  235. {$ifdef NEWINPUT}
  236. current_scanner^.close;
  237. compile(current_module^.mainsource^,compile_system);
  238. if (not old_current_module^.compiled) then
  239. current_scanner^.reopen;
  240. {$else}
  241. if assigned(old_current_module^.current_inputfile) then
  242. old_current_module^.current_inputfile^.tempclose;
  243. compile(current_module^.mainsource^,compile_system);
  244. if (not old_current_module^.compiled) and assigned(old_current_module^.current_inputfile) then
  245. old_current_module^.current_inputfile^.tempreopen;
  246. {$endif}
  247. end;
  248. end
  249. else
  250. begin
  251. { only reassemble ? }
  252. if (current_module^.do_assemble) then
  253. OnlyAsm(current_module^.asmfilename^);
  254. { add the files for the linker }
  255. addlinkerfiles(current_module);
  256. end;
  257. if assigned(current_module^.ppufile) then
  258. begin
  259. dispose(current_module^.ppufile,done);
  260. current_module^.ppufile:=nil;
  261. end;
  262. end;
  263. begin
  264. old_current_module:=current_module;
  265. old_current_ppu:=current_ppu;
  266. { be sure not to mix lines from different files }
  267. { update_line; }
  268. { unit not found }
  269. st:=nil;
  270. { search all loaded units }
  271. hp:=pmodule(loaded_units.first);
  272. while assigned(hp) do
  273. begin
  274. if hp^.modulename^=s then
  275. begin
  276. { the unit is already registered }
  277. { and this means that the unit }
  278. { is already compiled }
  279. { else there is a cyclic unit use }
  280. if assigned(hp^.symtable) then
  281. st:=punitsymtable(hp^.symtable)
  282. else
  283. begin
  284. { recompile the unit ? }
  285. if (not current_module^.in_implementation) and (hp^.in_implementation) then
  286. Message(unit_f_circular_unit_reference);
  287. end;
  288. break;
  289. end;
  290. { the next unit }
  291. hp:=pmodule(hp^.next);
  292. end;
  293. { the unit is not in the symtable stack }
  294. if (not assigned(st)) then
  295. begin
  296. { if the unit is loaded remove it first }
  297. if assigned(hp) then
  298. begin
  299. { remove the old unit }
  300. loaded_units.remove(hp);
  301. dispose(hp,done);
  302. end;
  303. { generates a new unit info record }
  304. current_module:=new(pmodule,init(s,true));
  305. current_ppu:=current_module^.ppufile;
  306. { now we can register the unit }
  307. loaded_units.insert(current_module);
  308. { now realy load the ppu }
  309. loadppufile;
  310. { set compiled flag }
  311. current_module^.compiled:=true;
  312. { register the unit _once_ }
  313. usedunits.concat(new(pused_unit,init(current_module,true)));
  314. { load return pointer }
  315. hp:=current_module;
  316. end;
  317. { set the old module }
  318. current_ppu:=old_current_ppu;
  319. current_module:=old_current_module;
  320. loadunit:=hp;
  321. end;
  322. {$else OLDPPU}
  323. {*****************************************************************************
  324. Old PPU
  325. *****************************************************************************}
  326. function loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;forward;
  327. procedure load_ppu(oldhp,hp : pmodule;compile_system : boolean);
  328. var
  329. loaded_unit : pmodule;
  330. b : byte;
  331. checksum,
  332. count,
  333. nextmapentry : longint;
  334. hs : string;
  335. begin
  336. { init the map }
  337. new(hp^.map);
  338. nextmapentry:=1;
  339. { load the used units from interface }
  340. hp^.ppufile^.read_data(b,1,count);
  341. while (b=ibloadunit) do
  342. begin
  343. { read unit name }
  344. hp^.ppufile^.read_data(hs[0],1,count);
  345. hp^.ppufile^.read_data(hs[1],byte(hs[0]),count);
  346. hp^.ppufile^.read_data(checksum,4,count);
  347. loaded_unit:=loadunit(hs,false,false);
  348. if hp^.compiled then
  349. exit;
  350. { if the crc of a used unit is the same as }
  351. { written to the PPU file, we needn't to }
  352. { recompile the current unit }
  353. if (loaded_unit^.crc<>checksum) then
  354. begin
  355. { we have to compile the current unit }
  356. { remove stuff which isn't needed }
  357. { forget the map }
  358. dispose(hp^.map);
  359. hp^.map:=nil;
  360. hp^.ppufile^.close;
  361. dispose(hp^.ppufile,done);
  362. hp^.ppufile:=nil;
  363. if not(hp^.sources_avail) then
  364. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  365. else
  366. begin
  367. if assigned(oldhp^.current_inputfile) then
  368. oldhp^.current_inputfile^.tempclose;
  369. compile(hp^.mainsource^,compile_system);
  370. if (not oldhp^.compiled) and assigned(oldhp^.current_inputfile) then
  371. oldhp^.current_inputfile^.tempreopen;
  372. end;
  373. exit;
  374. end;
  375. { setup the map entry for deref }
  376. hp^.map^[nextmapentry]:=loaded_unit^.symtable;
  377. inc(nextmapentry);
  378. if nextmapentry>maxunits then
  379. Message(unit_f_too_much_units);
  380. { read until ibend }
  381. hp^.ppufile^.read_data(b,1,count);
  382. end;
  383. { ok, now load the unit }
  384. hp^.symtable:=new(punitsymtable,load(hp^.modulename^));
  385. { if this is the system unit insert the intern }
  386. { symbols }
  387. make_ref:=false;
  388. if compile_system then
  389. insertinternsyms(psymtable(hp^.symtable));
  390. make_ref:=true;
  391. { now only read the implementation part }
  392. hp^.in_implementation:=true;
  393. { load the used units from implementation }
  394. hp^.ppufile^.read_data(b,1,count);
  395. while (b<>ibend) and (b=ibloadunit) do
  396. begin
  397. { read unit name }
  398. hp^.ppufile^.read_data(hs[0],1,count);
  399. hp^.ppufile^.read_data(hs[1],byte(hs[0]),count);
  400. hp^.ppufile^.read_data(checksum,4,count);
  401. loaded_unit:=loadunit(hs,false,false);
  402. if hp^.compiled then exit;
  403. { if the crc of a used unit is the same as }
  404. { written to the PPU file, we needn't to }
  405. { recompile the current unit }
  406. { but for the implementation part }
  407. { the written crc is false, because }
  408. { not defined when writing the ppufile !! }
  409. {$ifdef TEST_IMPL}
  410. if (checksum<>0) and (loaded_unit^.crc<>checksum) then
  411. begin
  412. { we have to compile the current unit }
  413. { remove stuff which isn't needed }
  414. { forget the map }
  415. dispose(hp^.map);
  416. hp^.map:=nil;
  417. hp^.ppufile^.close;
  418. dispose(hp^.ppufile,done);
  419. hp^.ppufile:=nil;
  420. if not(hp^.sources_avail) then
  421. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  422. else
  423. begin
  424. oldhp^.current_inputfile^.tempclose;
  425. compile(hp^.mainsource^,compile_system);
  426. oldhp^.current_inputfile^.tempclose;
  427. end;
  428. exit;
  429. end;
  430. {$endif TEST_IMPL}
  431. { read until ibend }
  432. hp^.ppufile^.read_data(b,1,count);
  433. end;
  434. hp^.ppufile^.close;
  435. dispose(hp^.map);
  436. hp^.map:=nil;
  437. end;
  438. function loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;
  439. var
  440. st : punitsymtable;
  441. old_current_module,hp,nextmodule : pmodule;
  442. pu : pused_unit;
  443. hs : pstring;
  444. begin
  445. old_current_module:=current_module;
  446. { be sure not to mix lines from different files }
  447. { update_line; }
  448. { unit not found }
  449. st:=nil;
  450. { search all loaded units }
  451. hp:=pmodule(loaded_units.first);
  452. while assigned(hp) do
  453. begin
  454. if hp^.modulename^=s then
  455. begin
  456. { the unit is already registered }
  457. { and this means that the unit }
  458. { is already compiled }
  459. { else there is a cyclic unit use }
  460. if assigned(hp^.symtable) then
  461. st:=punitsymtable(hp^.symtable)
  462. else
  463. begin
  464. { recompile the unit ? }
  465. if (not current_module^.in_implementation) and (hp^.in_implementation) then
  466. Message(unit_f_circular_unit_reference);
  467. end;
  468. break;
  469. end;
  470. { the next unit }
  471. hp:=pmodule(hp^.next);
  472. end;
  473. { no error and the unit isn't loaded }
  474. if not(assigned(hp)) and (st=nil) then
  475. begin
  476. { generates a new unit info record }
  477. hp:=new(pmodule,init(s,true));
  478. { now we can register the unit }
  479. loaded_units.insert(hp);
  480. current_module:=hp;
  481. { force build ? }
  482. if (hp^.do_compile) or (hp^.sources_avail and do_build) then
  483. begin
  484. { we needn't the ppufile }
  485. if assigned(hp^.ppufile) then
  486. begin
  487. dispose(hp^.ppufile,done);
  488. hp^.ppufile:=nil;
  489. end;
  490. if not(hp^.sources_avail) then
  491. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  492. else
  493. begin
  494. if assigned(old_current_module^.current_inputfile) then
  495. old_current_module^.current_inputfile^.tempclose;
  496. compile(hp^.mainsource^,compile_system);
  497. if (not old_current_module^.compiled) and assigned(old_current_module^.current_inputfile) then
  498. old_current_module^.current_inputfile^.tempreopen;
  499. end;
  500. end
  501. else
  502. begin
  503. { only reassemble ? }
  504. if (hp^.do_assemble) then
  505. OnlyAsm(hp^.asmfilename^);
  506. { we should know there the PPU file else it's an error and
  507. we can't load the unit }
  508. if hp^.ppufile^.name^<>'' then
  509. load_ppu(old_current_module,hp,compile_system);
  510. { add the files for the linker }
  511. addlinkerfiles(hp);
  512. end;
  513. { register the unit _once_ }
  514. usedunits.concat(new(pused_unit,init(hp,0)));
  515. { the unit is written, so we can set the symtable type }
  516. { to unitsymtable, else we get some dupid errors }
  517. { this is not the right place because of the }
  518. { ready label }
  519. { psymtable(hp^.symtable)^.symtabletype:=unitsymtable; }
  520. { placed at this end of proc_unit }
  521. psymtable(hp^.symtable)^.unitid:=0;
  522. { reset the unitnumbers for the other units }
  523. pu:=pused_unit(old_current_module^.used_units.first);
  524. while assigned(pu) do
  525. begin
  526. psymtable(pu^.u^.symtable)^.unitid:=pu^.unitid;
  527. pu:=pused_unit(pu^.next);
  528. end;
  529. end
  530. else
  531. if assigned(hp) and (st=nil) then
  532. begin
  533. { we have to compile the unit again, but it is already inserted !!}
  534. { we may have problem with the lost symtable !! }
  535. current_module:=hp;
  536. { we must preserve the unit chain }
  537. nextmodule:=pmodule(hp^.next);
  538. { we have to cleanup a little }
  539. hp^.special_done;
  540. new(hs);
  541. hs^:=hp^.mainsource^;
  542. hp^.init(hs^,true);
  543. dispose(hs);
  544. { we must preserve the unit chain }
  545. hp^.next:=nextmodule;
  546. if assigned(hp^.ppufile) then
  547. load_ppu(old_current_module,hp,compile_system)
  548. else
  549. begin
  550. {$ifdef UseBrowser}
  551. { here we need to remove the names ! }
  552. hp^.sourcefiles.done;
  553. hp^.sourcefiles.init;
  554. {$endif UseBrowser}
  555. if assigned(old_current_module^.current_inputfile) then
  556. old_current_module^.current_inputfile^.tempclose;
  557. Message1(parser_d_compiling_second_time,hp^.mainsource^);
  558. compile(hp^.mainsource^,compile_system);
  559. if (not old_current_module^.compiled) and assigned(old_current_module^.current_inputfile) then
  560. old_current_module^.current_inputfile^.tempreopen;
  561. end;
  562. current_module^.compiled:=true;
  563. end;
  564. { set the old module }
  565. current_module:=old_current_module;
  566. { the current module uses the unit hp }
  567. current_module^.used_units.concat(new(pused_unit,init(hp,0)));
  568. pused_unit(current_module^.used_units.last)^.in_uses:=in_uses;
  569. if in_uses and not current_module^.in_implementation then
  570. pused_unit(current_module^.used_units.last)^.in_interface:=true;
  571. loadunit:=hp;
  572. end;
  573. {$endif OLDPPU}
  574. procedure loadsystemunit;
  575. var
  576. hp : pmodule;
  577. begin
  578. { if the current file isn't a system unit the the system unit
  579. will be loaded }
  580. if not(cs_compilesystem in aktswitches) then
  581. begin
  582. {$ifndef OLDPPU}
  583. hp:=loadunit(upper(target_info.system_unit),true);
  584. systemunit:=hp^.symtable;
  585. { add to the used units }
  586. current_module^.used_units.concat(new(pused_unit,init(hp,true)));
  587. {$else OLDPPU}
  588. hp:=loadunit(upper(target_info.system_unit),true,true);
  589. systemunit:=hp^.symtable;
  590. { add to the used units }
  591. current_module^.used_units.concat(new(pused_unit,init(hp,0)));
  592. {$endif OLDPPU}
  593. { read default constant definitions }
  594. make_ref:=false;
  595. readconstdefs;
  596. { we could try to overload caret by default }
  597. symtablestack:=systemunit;
  598. { if POWER is defined in the RTL then use it for starstar overloading }
  599. getsym('POWER',false);
  600. if assigned(srsym) and (srsym^.typ=procsym) and
  601. (overloaded_operators[STARSTAR]=nil) then
  602. overloaded_operators[STARSTAR]:=pprocsym(srsym);
  603. make_ref:=true;
  604. end
  605. else
  606. begin
  607. createconstdefs;
  608. systemunit:=nil;
  609. end;
  610. end;
  611. procedure loadunits;
  612. var
  613. s : stringid;
  614. hp : pused_unit;
  615. hp2 : pmodule;
  616. hp3 : psymtable;
  617. oldprocsym:Pprocsym;
  618. begin
  619. oldprocsym:=aktprocsym;
  620. consume(_USES);
  621. {$ifdef DEBUG}
  622. test_symtablestack;
  623. {$endif DEBUG}
  624. repeat
  625. s:=pattern;
  626. consume(ID);
  627. {$ifndef OLDPPU}
  628. hp2:=loadunit(s,false);
  629. { the current module uses the unit hp2 }
  630. current_module^.used_units.concat(new(pused_unit,init(hp2,not current_module^.in_implementation)));
  631. pused_unit(current_module^.used_units.last)^.in_uses:=true;
  632. {$else OLDPPU}
  633. hp2:=loadunit(s,false,true);
  634. {$endif OLDPPU}
  635. if current_module^.compiled then
  636. exit;
  637. refsymtable^.insert(new(punitsym,init(s,hp2^.symtable)));
  638. if token=COMMA then
  639. begin
  640. pattern:='';
  641. consume(COMMA);
  642. end
  643. else
  644. break;
  645. until false;
  646. consume(SEMICOLON);
  647. { set the symtable to systemunit so it gets reorderd correctly }
  648. symtablestack:=systemunit;
  649. { now insert the units in the symtablestack }
  650. hp:=pused_unit(current_module^.used_units.first);
  651. while assigned(hp) do
  652. begin
  653. {$IfDef GDB}
  654. if (cs_debuginfo in aktswitches) and
  655. not hp^.is_stab_written then
  656. begin
  657. punitsymtable(hp^.u^.symtable)^.concattypestabto(debuglist);
  658. hp^.is_stab_written:=true;
  659. hp^.unitid:=psymtable(hp^.u^.symtable)^.unitid;
  660. end;
  661. {$EndIf GDB}
  662. if hp^.in_uses then
  663. begin
  664. hp3:=symtablestack;
  665. while assigned(hp3) do
  666. begin
  667. { insert units only once ! }
  668. if hp^.u^.symtable=hp3 then
  669. break;
  670. hp3:=hp3^.next;
  671. { unit isn't inserted }
  672. if hp3=nil then
  673. begin
  674. psymtable(hp^.u^.symtable)^.next:=symtablestack;
  675. symtablestack:=psymtable(hp^.u^.symtable);
  676. {$ifdef CHAINPROCSYMS}
  677. symtablestack^.chainprocsyms;
  678. {$endif CHAINPROCSYMS}
  679. {$ifdef DEBUG}
  680. test_symtablestack;
  681. {$endif DEBUG}
  682. end;
  683. end;
  684. end;
  685. hp:=pused_unit(hp^.next);
  686. end;
  687. aktprocsym:=oldprocsym;
  688. end;
  689. procedure parse_implementation_uses(symt:Psymtable);
  690. var
  691. old_module_in_implementation : boolean;
  692. begin
  693. if token=_USES then
  694. begin
  695. old_module_in_implementation:=module_in_implementation;
  696. module_in_implementation:=true;
  697. current_module^.in_implementation:=true;
  698. symt^.symtabletype:=unitsymtable;
  699. loadunits;
  700. symt^.symtabletype:=globalsymtable;
  701. {$ifdef DEBUG}
  702. test_symtablestack;
  703. {$endif DEBUG}
  704. module_in_implementation:=old_module_in_implementation;
  705. end;
  706. end;
  707. procedure proc_unit;
  708. var
  709. { unitname : stringid; }
  710. names : Tstringcontainer;
  711. p : psymtable;
  712. unitst : punitsymtable;
  713. pu : pused_unit;
  714. i : longint;
  715. s1,s2 : ^string; {Saves stack space}
  716. begin
  717. consume(_UNIT);
  718. if token=ID then
  719. begin
  720. { create filenames and unit name }
  721. {$ifdef NEWINPUT}
  722. current_module^.SetFileName(current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^);
  723. {$else}
  724. current_module^.SetFileName(current_module^.current_inputfile^.path^+current_module^.current_inputfile^.name^);
  725. {$endif}
  726. stringdispose(current_module^.modulename);
  727. current_module^.modulename:=stringdup(upper(pattern));
  728. { check for system unit }
  729. new(s1);
  730. new(s2);
  731. s1^:=upper(target_info.system_unit);
  732. {$ifdef NEWINPUT}
  733. s2^:=upper(current_scanner^.inputfile^.name^);
  734. { strip extension, there could only be one dot }
  735. i:=pos('.',s2^);
  736. if i>0 then
  737. s2^:=Copy(s2^,1,i-1);
  738. {$else}
  739. s2^:=upper(current_module^.current_inputfile^.name^);
  740. {$endif}
  741. if (cs_compilesystem in aktswitches) then
  742. begin
  743. if (cs_check_unit_name in aktswitches) and
  744. ((length(current_module^.modulename^)>8) or
  745. (current_module^.modulename^<>s1^) or
  746. (current_module^.modulename^<>s2^)) then
  747. Message1(unit_e_illegal_unit_name,s1^);
  748. end
  749. else
  750. if (current_module^.modulename^=s1^) then
  751. Message(unit_w_switch_us_missed);
  752. dispose(s2);
  753. dispose(s1);
  754. { Add Object File }
  755. if (cs_smartlink in aktswitches) then
  756. current_module^.linkstaticlibs.insert(current_module^.libfilename^)
  757. else
  758. current_module^.linkofiles.insert(current_module^.objfilename^);
  759. end;
  760. consume(ID);
  761. consume(SEMICOLON);
  762. consume(_INTERFACE);
  763. { update status }
  764. status.currentmodule:=current_module^.modulename^;
  765. { this should be placed after uses !!}
  766. {$ifndef UseNiceNames}
  767. procprefix:='_'+current_module^.modulename^+'$$';
  768. {$else UseNiceNames}
  769. procprefix:='_'+tostr(length(current_module^.unitname^))+lowercase(current_module^.unitname^)+'_';
  770. {$endif UseNiceNames}
  771. parse_only:=true;
  772. { generate now the global symboltable }
  773. p:=new(punitsymtable,init(globalsymtable,current_module^.modulename^));
  774. refsymtable:=p;
  775. unitst:=punitsymtable(p);
  776. { the unit name must be usable as a unit specifier }
  777. { inside the unit itself (PM) }
  778. { this also forbids to have another symbol }
  779. { with the same name as the unit }
  780. refsymtable^.insert(new(punitsym,init(current_module^.modulename^,unitst)));
  781. { set the symbol table for the current unit }
  782. { this must be set later for interdependency }
  783. { current_module^.symtable:=psymtable(p); }
  784. { a unit compiled at command line must be inside the loaded_unit list }
  785. if (compile_level=1) then
  786. begin
  787. loaded_units.insert(current_module);
  788. if cs_unit_to_lib in initswitches then
  789. begin
  790. current_module^.flags:=current_module^.flags or uf_in_library;
  791. if cs_shared_lib in initswitches then
  792. current_module^.flags:=current_module^.flags or uf_shared_library;
  793. end;
  794. end;
  795. { insert qualifier for the system unit (allows system.writeln) }
  796. if not(cs_compilesystem in aktswitches) then
  797. begin
  798. { insert the system unit }
  799. { it is allways the first }
  800. systemunit^.next:=nil;
  801. symtablestack:=systemunit;
  802. refsymtable^.insert(new(punitsym,init('SYSTEM',systemunit)));
  803. if token=_USES then
  804. begin
  805. unitst^.symtabletype:=unitsymtable;
  806. loadunits;
  807. { has it been compiled at a higher level ?}
  808. if current_module^.compiled then
  809. exit;
  810. unitst^.symtabletype:=globalsymtable;
  811. end;
  812. { ... but insert the symbol table later }
  813. p^.next:=symtablestack;
  814. symtablestack:=p;
  815. end
  816. else
  817. { while compiling a system unit, some types are directly inserted }
  818. begin
  819. p^.next:=symtablestack;
  820. symtablestack:=p;
  821. insert_intern_types(p);
  822. end;
  823. { displaced for inter-dependency considerations }
  824. current_module^.symtable:=psymtable(p);
  825. constsymtable:=symtablestack;
  826. { ... parse the declarations }
  827. read_interface_declarations;
  828. consume(_IMPLEMENTATION);
  829. parse_only:=false;
  830. {$ifdef GDB}
  831. { add all used definitions even for implementation}
  832. if (cs_debuginfo in aktswitches) then
  833. begin
  834. { all types }
  835. punitsymtable(refsymtable)^.concattypestabto(debuglist);
  836. { and all local symbols}
  837. refsymtable^.concatstabto(debuglist);
  838. end;
  839. {$endif GDB}
  840. { generates static symbol table }
  841. p:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  842. {Generate a procsym.}
  843. make_ref:=false;
  844. aktprocsym:=new(Pprocsym,init(current_module^.modulename^+'_init'));
  845. aktprocsym^.definition:=new(Pprocdef,init);
  846. aktprocsym^.definition^.options:=aktprocsym^.definition^.options or pounitinit;
  847. aktprocsym^.definition^.setmangledname(current_module^.modulename^+'_init');
  848. make_ref:=true;
  849. {The generated procsym has a local symtable. Discard it and turn
  850. it into the static one.}
  851. dispose(aktprocsym^.definition^.localst,done);
  852. aktprocsym^.definition^.localst:=p;
  853. { remove the globalsymtable from the symtable stack }
  854. { to reinsert it after loading the implementation units }
  855. symtablestack:=unitst^.next;
  856. { number the definitions, so a deref from other units works }
  857. refsymtable^.number_defs;
  858. { Read the implementation units }
  859. parse_implementation_uses(unitst);
  860. numberunits;
  861. { now we can change refsymtable }
  862. refsymtable:=p;
  863. { but reinsert the global symtable as lasts }
  864. unitst^.next:=symtablestack;
  865. symtablestack:=unitst;
  866. {$ifdef DEBUG}
  867. test_symtablestack;
  868. {$endif DEBUG}
  869. constsymtable:=symtablestack;
  870. {$ifdef Splitheap}
  871. if testsplit then
  872. begin
  873. Split_Heap;
  874. allow_special:=true;
  875. Switch_to_temp_heap;
  876. end;
  877. { it will report all crossings }
  878. allow_special:=false;
  879. {$endif Splitheap}
  880. { set some informations }
  881. procinfo.retdef:=voiddef;
  882. procinfo._class:=nil;
  883. procinfo.call_offset:=8;
  884. { for temporary values }
  885. procinfo.framepointer:=frame_pointer;
  886. { clear flags }
  887. procinfo.flags:=0;
  888. { Create a new procedure }
  889. codegen_newprocedure;
  890. { Compile the unit }
  891. names.init;
  892. names.insert(current_module^.modulename^+'_init');
  893. names.insert('INIT$$'+current_module^.modulename^);
  894. compile_proc_body(names,true,false);
  895. names.done;
  896. { Shutdown the codegen for this procedure }
  897. codegen_doneprocedure;
  898. {$ifdef dummy}
  899. if token=_FINALIZATION then
  900. begin
  901. current_module^.flags:=current_module^.flags or uf_finalize;
  902. { clear flags }
  903. procinfo.flags:=0;
  904. {Reset the codegenerator.}
  905. codegen_newprocedure;
  906. names.init;
  907. names.insert(current_module^.modulename^+'_finalize');
  908. names.insert('FINALIZE$$'+current_module^.modulename^);
  909. compile_proc_body(names,true,false);
  910. names.done;
  911. codegen_doneprocedure;
  912. end;
  913. {$endif dummy}
  914. consume(POINT);
  915. { size of the static data }
  916. datasize:=symtablestack^.datasize;
  917. { unsed static symbols ? }
  918. symtablestack^.allsymbolsused;
  919. {$ifdef GDB}
  920. { add all used definitions even for implementation}
  921. if (cs_debuginfo in aktswitches) then
  922. begin
  923. { all types }
  924. punitsymtable(symtablestack)^.concattypestabto(debuglist);
  925. { and all local symbols}
  926. symtablestack^.concatstabto(debuglist);
  927. end;
  928. {$endif GDB}
  929. current_module^.in_implementation:=false;
  930. { deletes all symtables generated in the implementation part }
  931. while symtablestack^.symtabletype<>globalsymtable do
  932. dellexlevel;
  933. { tests, if all forwards are resolved }
  934. symtablestack^.check_forwards;
  935. symtablestack^.symtabletype:=unitsymtable;
  936. punitsymtable(symtablestack)^.is_stab_written:=false;
  937. {Write out the unit if the compile was succesfull.}
  938. if status.errorcount=0 then
  939. writeunitas(current_module^.ppufilename^,punitsymtable(symtablestack));
  940. pu:=pused_unit(usedunits.first);
  941. while assigned(pu) do
  942. begin
  943. punitsymtable(pu^.u^.symtable)^.is_stab_written:=false;
  944. pu:=pused_unit(pu^.next);
  945. end;
  946. inc(datasize,symtablestack^.datasize);
  947. { generate imports }
  948. if current_module^.uses_imports then
  949. importlib^.generatelib;
  950. { finish asmlist by adding segment starts }
  951. insertsegment;
  952. end;
  953. procedure proc_program(islibrary : boolean);
  954. var
  955. st : psymtable;
  956. names : Tstringcontainer;
  957. begin
  958. { Trying to compile the system unit... }
  959. { if no unit defined... then issue a }
  960. { fatal error (avoids pointer problems)}
  961. { when referencing the non-existant }
  962. { system unit. }
  963. { System Unit should be compiled using proc_unit !! (PFV) }
  964. { if (cs_compilesystem in aktswitches) then
  965. Begin
  966. if token<>_UNIT then
  967. Message1(scan_f_syn_expected,'UNIT');
  968. consume(_UNIT);
  969. end;}
  970. parse_only:=false;
  971. if islibrary then
  972. begin
  973. consume(_LIBRARY);
  974. stringdispose(current_module^.modulename);
  975. current_module^.modulename:=stringdup(pattern);
  976. consume(ID);
  977. consume(SEMICOLON);
  978. end
  979. else
  980. { is there an program head ? }
  981. if token=_PROGRAM then
  982. begin
  983. consume(_PROGRAM);
  984. stringdispose(current_module^.modulename);
  985. current_module^.modulename:=stringdup(pattern);
  986. consume(ID);
  987. if token=LKLAMMER then
  988. begin
  989. consume(LKLAMMER);
  990. idlist;
  991. consume(RKLAMMER);
  992. end;
  993. consume(SEMICOLON);
  994. end;
  995. { insert after the unit symbol tables the static symbol table }
  996. { of the program }
  997. st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  998. {Generate a procsym.}
  999. make_ref:=false;
  1000. aktprocsym:=new(Pprocsym,init('main'));
  1001. aktprocsym^.definition:=new(Pprocdef,init);
  1002. aktprocsym^.definition^.options:=aktprocsym^.definition^.options or poproginit;
  1003. aktprocsym^.definition^.setmangledname(target_os.Cprefix+'main');
  1004. make_ref:=true;
  1005. {The localst is a local symtable. Change it into the static
  1006. symtable.}
  1007. dispose(aktprocsym^.definition^.localst,done);
  1008. aktprocsym^.definition^.localst:=st;
  1009. refsymtable:=st;
  1010. { necessary for browser }
  1011. loaded_units.insert(current_module);
  1012. {Insert the symbols of the system unit into the stack of symbol
  1013. tables.}
  1014. symtablestack:=systemunit;
  1015. systemunit^.next:=nil;
  1016. refsymtable^.insert(new(punitsym,init('SYSTEM',systemunit)));
  1017. {Load the units used by the program we compile.}
  1018. if token=_USES then
  1019. loadunits;
  1020. {Insert the name of the main program into the symbol table.}
  1021. if current_module^.modulename^<>'' then
  1022. st^.insert(new(pprogramsym,init(current_module^.modulename^)));
  1023. { ...is also constsymtable, this is the symtable where }
  1024. { the elements of enumeration types are inserted }
  1025. constsymtable:=st;
  1026. { set some informations about the main program }
  1027. with procinfo do
  1028. begin
  1029. retdef:=voiddef;
  1030. _class:=nil;
  1031. call_offset:=8;
  1032. framepointer:=frame_pointer;
  1033. flags:=0;
  1034. end;
  1035. procprefix:='';
  1036. in_except_block:=false;
  1037. codegen_newprocedure;
  1038. {The program intialization needs an alias, so it can be called
  1039. from the bootstrap code.}
  1040. names.init;
  1041. names.insert('program_init');
  1042. names.insert('PASCALMAIN');
  1043. names.insert(target_os.cprefix+'main');
  1044. compile_proc_body(names,true,false);
  1045. names.done;
  1046. codegen_doneprocedure;
  1047. consume(POINT);
  1048. if (cs_smartlink in aktswitches) then
  1049. current_module^.linkstaticlibs.insert(current_module^.libfilename^)
  1050. else
  1051. current_module^.linkofiles.insert(current_module^.objfilename^);
  1052. { insert heap }
  1053. insertheap;
  1054. { generate imports }
  1055. if current_module^.uses_imports then
  1056. importlib^.generatelib;
  1057. inserttargetspecific;
  1058. datasize:=symtablestack^.datasize;
  1059. { finish asmlist by adding segment starts }
  1060. insertsegment;
  1061. end;
  1062. end.
  1063. {
  1064. $Log$
  1065. Revision 1.35 1998-07-08 12:39:38 peter
  1066. * heap_size for m68k
  1067. Revision 1.34 1998/07/07 11:20:03 peter
  1068. + NEWINPUT for a better inputfile and scanner object
  1069. Revision 1.33 1998/06/25 11:15:34 pierre
  1070. * ppu files where not closed in newppu !!
  1071. second compilation was impossible due to too many opened files
  1072. (not visible in 'make cycle' as we remove all the ppu files)
  1073. Revision 1.32 1998/06/25 08:48:16 florian
  1074. * first version of rtti support
  1075. Revision 1.31 1998/06/24 14:48:35 peter
  1076. * ifdef newppu -> ifndef oldppu
  1077. Revision 1.30 1998/06/17 14:10:16 peter
  1078. * small os2 fixes
  1079. * fixed interdependent units with newppu (remake3 under linux works now)
  1080. Revision 1.29 1998/06/16 08:56:25 peter
  1081. + targetcpu
  1082. * cleaner pmodules for newppu
  1083. Revision 1.28 1998/06/13 00:10:10 peter
  1084. * working browser and newppu
  1085. * some small fixes against crashes which occured in bp7 (but not in
  1086. fpc?!)
  1087. Revision 1.27 1998/06/11 13:58:08 peter
  1088. * small fix to let newppu compile
  1089. Revision 1.26 1998/06/09 16:01:47 pierre
  1090. + added procedure directive parsing for procvars
  1091. (accepted are popstack cdecl and pascal)
  1092. + added C vars with the following syntax
  1093. var C calias 'true_c_name';(can be followed by external)
  1094. reason is that you must add the Cprefix
  1095. which is target dependent
  1096. Revision 1.25 1998/06/08 22:59:49 peter
  1097. * smartlinking works for win32
  1098. * some defines to exclude some compiler parts
  1099. Revision 1.24 1998/06/08 13:13:44 pierre
  1100. + temporary variables now in temp_gen.pas unit
  1101. because it is processor independent
  1102. * mppc68k.bat modified to undefine i386 and support_mmx
  1103. (which are defaults for i386)
  1104. Revision 1.23 1998/06/05 17:47:29 peter
  1105. * some better uses clauses
  1106. Revision 1.22 1998/06/05 14:37:34 pierre
  1107. * fixes for inline for operators
  1108. * inline procedure more correctly restricted
  1109. Revision 1.21 1998/06/04 23:51:53 peter
  1110. * m68k compiles
  1111. + .def file creation moved to gendef.pas so it could also be used
  1112. for win32
  1113. Revision 1.20 1998/06/04 09:55:42 pierre
  1114. * demangled name of procsym reworked to become independant of the mangling scheme
  1115. Revision 1.19 1998/06/03 23:40:38 peter
  1116. + unlimited file support, release tempclose
  1117. Revision 1.18 1998/06/03 22:49:00 peter
  1118. + wordbool,longbool
  1119. * rename bis,von -> high,low
  1120. * moved some systemunit loading/creating to psystem.pas
  1121. Revision 1.17 1998/05/28 14:40:25 peter
  1122. * fixes for newppu, remake3 works now with it
  1123. Revision 1.16 1998/05/27 19:45:06 peter
  1124. * symtable.pas splitted into includefiles
  1125. * symtable adapted for $ifdef NEWPPU
  1126. Revision 1.15 1998/05/23 01:21:22 peter
  1127. + aktasmmode, aktoptprocessor, aktoutputformat
  1128. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1129. + $LIBNAME to set the library name where the unit will be put in
  1130. * splitted cgi386 a bit (codeseg to large for bp7)
  1131. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1132. Revision 1.14 1998/05/20 09:42:35 pierre
  1133. + UseTokenInfo now default
  1134. * unit in interface uses and implementation uses gives error now
  1135. * only one error for unknown symbol (uses lastsymknown boolean)
  1136. the problem came from the label code !
  1137. + first inlined procedures and function work
  1138. (warning there might be allowed cases were the result is still wrong !!)
  1139. * UseBrower updated gives a global list of all position of all used symbols
  1140. with switch -gb
  1141. Revision 1.13 1998/05/12 10:47:00 peter
  1142. * moved printstatus to verb_def
  1143. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1144. prefix like error: warning: and is included in V_Default
  1145. * fixed some messages
  1146. * first time parameter scan is only for -v and -T
  1147. - removed old style messages
  1148. Revision 1.12 1998/05/11 13:07:56 peter
  1149. + $ifdef NEWPPU for the new ppuformat
  1150. + $define GDB not longer required
  1151. * removed all warnings and stripped some log comments
  1152. * no findfirst/findnext anymore to remove smartlink *.o files
  1153. Revision 1.11 1998/05/06 18:36:53 peter
  1154. * tai_section extended with code,data,bss sections and enumerated type
  1155. * ident 'compiled by FPC' moved to pmodules
  1156. * small fix for smartlink
  1157. Revision 1.10 1998/05/04 17:54:28 peter
  1158. + smartlinking works (only case jumptable left todo)
  1159. * redesign of systems.pas to support assemblers and linkers
  1160. + Unitname is now also in the PPU-file, increased version to 14
  1161. Revision 1.9 1998/05/01 16:38:45 florian
  1162. * handling of private and protected fixed
  1163. + change_keywords_to_tp implemented to remove
  1164. keywords which aren't supported by tp
  1165. * break and continue are now symbols of the system unit
  1166. + widestring, longstring and ansistring type released
  1167. Revision 1.8 1998/04/30 15:59:41 pierre
  1168. * GDB works again better :
  1169. correct type info in one pass
  1170. + UseTokenInfo for better source position
  1171. * fixed one remaining bug in scanner for line counts
  1172. * several little fixes
  1173. Revision 1.7 1998/04/29 10:33:59 pierre
  1174. + added some code for ansistring (not complete nor working yet)
  1175. * corrected operator overloading
  1176. * corrected nasm output
  1177. + started inline procedures
  1178. + added starstarn : use ** for exponentiation (^ gave problems)
  1179. + started UseTokenInfo cond to get accurate positions
  1180. Revision 1.6 1998/04/27 23:10:28 peter
  1181. + new scanner
  1182. * $makelib -> if smartlink
  1183. * small filename fixes pmodule.setfilename
  1184. * moved import from files.pas -> import.pas
  1185. Revision 1.5 1998/04/14 23:27:03 florian
  1186. + exclude/include with constant second parameter added
  1187. Revision 1.4 1998/04/10 14:41:43 peter
  1188. * removed some Hints
  1189. * small speed optimization for AsmLn
  1190. Revision 1.3 1998/04/03 09:51:00 daniel
  1191. * Fixed heap allocation for OS/2.
  1192. }