pmodules.pas 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364
  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 loadsystemunit;
  24. procedure proc_unit;
  25. procedure proc_program(islibrary : boolean);
  26. implementation
  27. uses
  28. cobjects,verbose,comphook,systems,globals,
  29. symtable,aasm,hcodegen,
  30. link,assemble,import,gendef
  31. {$ifndef OLDPPU}
  32. ,ppu
  33. {$endif OLDPPU}
  34. {$ifdef i386}
  35. ,i386
  36. {$endif}
  37. {$ifdef m68k}
  38. ,m68k
  39. {$endif}
  40. ,scanner,pbase,psystem,pdecl,psub,parser;
  41. procedure create_objectfile;
  42. begin
  43. { create the .s file and assemble it }
  44. GenerateAsm;
  45. { When creating a library call the linker. And insert the output
  46. of the linker files }
  47. if (cs_create_staticlib in aktmoduleswitches) then
  48. Linker.MakeStaticLibrary(SmartLinkFilesCnt)
  49. else
  50. if (cs_create_sharedlib in aktmoduleswitches) then
  51. Linker.MakeSharedLibrary;
  52. { add the files for the linker from current_module }
  53. Linker.AddModuleFiles(current_module);
  54. end;
  55. procedure insertobjectfile;
  56. { Insert the used object file for this unit in the used list for this unit }
  57. begin
  58. if (cs_create_staticlib in aktmoduleswitches) then
  59. current_module^.linkstaticlibs.insert(current_module^.staticlibfilename^)
  60. else
  61. if (cs_create_sharedlib in aktmoduleswitches) then
  62. current_module^.linksharedlibs.insert(current_module^.sharedlibfilename^)
  63. else
  64. current_module^.linkofiles.insert(current_module^.objfilename^);
  65. end;
  66. procedure insertsegment;
  67. procedure fixseg(p:paasmoutput;sec:tsection);
  68. begin
  69. p^.insert(new(pai_section,init(sec)));
  70. if (cs_smartlink in aktmoduleswitches) then
  71. p^.insert(new(pai_cut,init));
  72. p^.concat(new(pai_section,init(sec_none)));
  73. end;
  74. begin
  75. {Insert Ident of the compiler}
  76. if (not (cs_smartlink in aktmoduleswitches))
  77. {$ifndef EXTDEBUG}
  78. and (not current_module^.is_unit)
  79. {$endif}
  80. then
  81. begin
  82. datasegment^.insert(new(pai_align,init(4)));
  83. datasegment^.insert(new(pai_string,init('FPC '+version_string+' for '+target_string+' - '+target_info.short_name)));
  84. end;
  85. { Insert start and end of sections }
  86. fixseg(codesegment,sec_code);
  87. fixseg(datasegment,sec_data);
  88. fixseg(bsssegment,sec_bss);
  89. fixseg(consts,sec_data);
  90. end;
  91. procedure insertheap;
  92. begin
  93. if (cs_smartlink in aktmoduleswitches) then
  94. begin
  95. bsssegment^.concat(new(pai_cut,init));
  96. datasegment^.concat(new(pai_cut,init));
  97. end;
  98. { On the Macintosh Classic M68k Architecture
  99. The Heap variable is simply a POINTER to the
  100. real HEAP. The HEAP must be set up by the RTL
  101. and must store the pointer in this value.
  102. On OS/2 the heap is also intialized by the RTL. We do
  103. not output a pointer }
  104. case target_info.target of
  105. {$ifdef i386}
  106. target_OS2 : ;
  107. {$endif i386}
  108. {$ifdef m68k}
  109. target_Mac68K : bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
  110. {$endif m68k}
  111. else
  112. bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize)));
  113. end;
  114. {$ifdef i386}
  115. datasegment^.concat(new(pai_symbol,init_global('HEAPSIZE')));
  116. {$endif i386}
  117. {$ifdef m68k}
  118. datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
  119. {$endif m68k}
  120. datasegment^.concat(new(pai_const,init_32bit(heapsize)));
  121. end;
  122. procedure inserttargetspecific;
  123. begin
  124. {$ifdef i386}
  125. case target_info.target of
  126. target_GO32V2 : begin
  127. { stacksize can be specified }
  128. datasegment^.concat(new(pai_symbol,init_global('__stklen')));
  129. datasegment^.concat(new(pai_const,init_32bit(stacksize)));
  130. end;
  131. target_WIN32 : begin
  132. { Generate an external entry to be sure that _mainCRTStarup will be
  133. linked, can't use concat_external because those aren't written for
  134. asw (PFV) }
  135. datasegment^.concat(new(pai_const,init_symbol('_mainCRTStartup')));
  136. end;
  137. end;
  138. {$endif i386}
  139. end;
  140. {$ifndef OLDPPU}
  141. function loadunit(const s : string;compile_system:boolean) : pmodule;forward;
  142. procedure load_usedunits(compile_system:boolean);
  143. var
  144. pu : pused_unit;
  145. loaded_unit : pmodule;
  146. nextmapentry : longint;
  147. begin
  148. { init the map }
  149. new(current_module^.map);
  150. nextmapentry:=1;
  151. { load the used units from interface }
  152. pu:=pused_unit(current_module^.used_units.first);
  153. while assigned(pu) do
  154. begin
  155. if (not pu^.loaded) and (pu^.in_interface) then
  156. begin
  157. loaded_unit:=loadunit(pu^.name^,false);
  158. if current_module^.compiled then
  159. exit;
  160. { register unit in used units }
  161. pu^.u:=loaded_unit;
  162. pu^.loaded:=true;
  163. { need to recompile the current unit ? }
  164. if loaded_unit^.crc<>pu^.checksum then
  165. begin
  166. current_module^.do_compile:=true;
  167. exit;
  168. end;
  169. { setup the map entry for deref }
  170. current_module^.map^[nextmapentry]:=loaded_unit^.symtable;
  171. inc(nextmapentry);
  172. if nextmapentry>maxunits then
  173. Message(unit_f_too_much_units);
  174. end;
  175. pu:=pused_unit(pu^.next);
  176. end;
  177. { ok, now load the unit }
  178. current_module^.symtable:=new(punitsymtable,loadasunit);
  179. { if this is the system unit insert the intern symbols }
  180. if compile_system then
  181. begin
  182. make_ref:=false;
  183. insertinternsyms(psymtable(current_module^.symtable));
  184. make_ref:=true;
  185. end;
  186. { now only read the implementation part }
  187. current_module^.in_implementation:=true;
  188. { load the used units from implementation }
  189. pu:=pused_unit(current_module^.used_units.first);
  190. while assigned(pu) do
  191. begin
  192. if (not pu^.loaded) and (not pu^.in_interface) then
  193. begin
  194. loaded_unit:=loadunit(pu^.name^,false);
  195. if current_module^.compiled then
  196. exit;
  197. { register unit in used units }
  198. pu^.u:=loaded_unit;
  199. pu^.loaded:=true;
  200. {$ifdef TEST_IMPL}
  201. { need to recompile the current unit ? }
  202. if loaded_unit^.crc<>pu^.checksum then
  203. begin
  204. current_module^.do_compile:=true;
  205. exit;
  206. end;
  207. { setup the map entry for deref }
  208. current_module^.map^[nextmapentry]:=loaded_unit^.symtable;
  209. inc(nextmapentry);
  210. if nextmapentry>maxunits then
  211. Message(unit_f_too_much_units);
  212. {$endif TEST_IMPL}
  213. end;
  214. pu:=pused_unit(pu^.next);
  215. end;
  216. { remove the map, it's not needed anymore }
  217. dispose(current_module^.map);
  218. current_module^.map:=nil;
  219. end;
  220. function loadunit(const s : string;compile_system:boolean) : pmodule;
  221. var
  222. st : punitsymtable;
  223. old_current_ppu : pppufile;
  224. old_current_module,hp : pmodule;
  225. procedure loadppufile;
  226. begin
  227. { load interface section }
  228. if not current_module^.do_compile then
  229. load_interface;
  230. { only load units when we don't recompile }
  231. if not current_module^.do_compile then
  232. load_usedunits(compile_system);
  233. { recompile if set }
  234. if current_module^.do_compile then
  235. begin
  236. { we needn't the ppufile }
  237. if assigned(current_module^.ppufile) then
  238. begin
  239. dispose(current_module^.ppufile,done);
  240. current_module^.ppufile:=nil;
  241. end;
  242. { recompile the unit or give a fatal error if sources not available }
  243. if not(current_module^.sources_avail) then
  244. Message1(unit_f_cant_compile_unit,current_module^.modulename^)
  245. else
  246. begin
  247. current_scanner^.close;
  248. compile(current_module^.mainsource^,compile_system);
  249. if (not old_current_module^.compiled) then
  250. current_scanner^.reopen;
  251. end;
  252. end
  253. else
  254. begin
  255. { only reassemble ? }
  256. if (current_module^.do_assemble) then
  257. OnlyAsm;
  258. { add the files for the linker }
  259. Linker.AddModuleFiles(current_module);
  260. end;
  261. if assigned(current_module^.ppufile) then
  262. begin
  263. dispose(current_module^.ppufile,done);
  264. current_module^.ppufile:=nil;
  265. end;
  266. end;
  267. begin
  268. old_current_module:=current_module;
  269. old_current_ppu:=current_ppu;
  270. { be sure not to mix lines from different files }
  271. { update_line; }
  272. { unit not found }
  273. st:=nil;
  274. { search all loaded units }
  275. hp:=pmodule(loaded_units.first);
  276. while assigned(hp) do
  277. begin
  278. if hp^.modulename^=s then
  279. begin
  280. { the unit is already registered }
  281. { and this means that the unit }
  282. { is already compiled }
  283. { else there is a cyclic unit use }
  284. if assigned(hp^.symtable) then
  285. st:=punitsymtable(hp^.symtable)
  286. else
  287. begin
  288. { recompile the unit ? }
  289. if (not current_module^.in_implementation) and (hp^.in_implementation) then
  290. Message(unit_f_circular_unit_reference);
  291. end;
  292. break;
  293. end;
  294. { the next unit }
  295. hp:=pmodule(hp^.next);
  296. end;
  297. { the unit is not in the symtable stack }
  298. if (not assigned(st)) then
  299. begin
  300. { if the unit is loaded remove it first }
  301. if assigned(hp) then
  302. begin
  303. { remove the old unit }
  304. loaded_units.remove(hp);
  305. dispose(hp,done);
  306. end;
  307. { generates a new unit info record }
  308. current_module:=new(pmodule,init(s,true));
  309. current_ppu:=current_module^.ppufile;
  310. { now we can register the unit }
  311. loaded_units.insert(current_module);
  312. { now realy load the ppu }
  313. loadppufile;
  314. { set compiled flag }
  315. current_module^.compiled:=true;
  316. { register the unit _once_ }
  317. usedunits.concat(new(pused_unit,init(current_module,true)));
  318. { load return pointer }
  319. hp:=current_module;
  320. end;
  321. { set the old module }
  322. current_ppu:=old_current_ppu;
  323. current_module:=old_current_module;
  324. loadunit:=hp;
  325. end;
  326. {$else OLDPPU}
  327. {*****************************************************************************
  328. Old PPU
  329. *****************************************************************************}
  330. function loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;forward;
  331. procedure load_ppu(oldhp,hp : pmodule;compile_system : boolean);
  332. var
  333. loaded_unit : pmodule;
  334. b : byte;
  335. checksum,
  336. count,
  337. nextmapentry : longint;
  338. hs : string;
  339. begin
  340. { init the map }
  341. new(hp^.map);
  342. nextmapentry:=1;
  343. { load the used units from interface }
  344. hp^.ppufile^.read_data(b,1,count);
  345. while (b=ibloadunit) do
  346. begin
  347. { read unit name }
  348. hp^.ppufile^.read_data(hs[0],1,count);
  349. hp^.ppufile^.read_data(hs[1],byte(hs[0]),count);
  350. hp^.ppufile^.read_data(checksum,4,count);
  351. loaded_unit:=loadunit(hs,false,false);
  352. if hp^.compiled then
  353. exit;
  354. { if the crc of a used unit is the same as }
  355. { written to the PPU file, we needn't to }
  356. { recompile the current unit }
  357. if (loaded_unit^.crc<>checksum) then
  358. begin
  359. { we have to compile the current unit }
  360. { remove stuff which isn't needed }
  361. { forget the map }
  362. dispose(hp^.map);
  363. hp^.map:=nil;
  364. hp^.ppufile^.close;
  365. dispose(hp^.ppufile,done);
  366. hp^.ppufile:=nil;
  367. if not(hp^.sources_avail) then
  368. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  369. else
  370. begin
  371. if assigned(oldhp^.current_inputfile) then
  372. oldhp^.current_inputfile^.tempclose;
  373. compile(hp^.mainsource^,compile_system);
  374. if (not oldhp^.compiled) and assigned(oldhp^.current_inputfile) then
  375. oldhp^.current_inputfile^.tempreopen;
  376. end;
  377. exit;
  378. end;
  379. { setup the map entry for deref }
  380. hp^.map^[nextmapentry]:=loaded_unit^.symtable;
  381. inc(nextmapentry);
  382. if nextmapentry>maxunits then
  383. Message(unit_f_too_much_units);
  384. { read until ibend }
  385. hp^.ppufile^.read_data(b,1,count);
  386. end;
  387. { ok, now load the unit }
  388. hp^.symtable:=new(punitsymtable,load(hp^.modulename^));
  389. { if this is the system unit insert the intern }
  390. { symbols }
  391. make_ref:=false;
  392. if compile_system then
  393. insertinternsyms(psymtable(hp^.symtable));
  394. make_ref:=true;
  395. { now only read the implementation part }
  396. hp^.in_implementation:=true;
  397. { load the used units from implementation }
  398. hp^.ppufile^.read_data(b,1,count);
  399. while (b<>ibend) and (b=ibloadunit) do
  400. begin
  401. { read unit name }
  402. hp^.ppufile^.read_data(hs[0],1,count);
  403. hp^.ppufile^.read_data(hs[1],byte(hs[0]),count);
  404. hp^.ppufile^.read_data(checksum,4,count);
  405. loaded_unit:=loadunit(hs,false,false);
  406. if hp^.compiled then exit;
  407. { if the crc of a used unit is the same as }
  408. { written to the PPU file, we needn't to }
  409. { recompile the current unit }
  410. { but for the implementation part }
  411. { the written crc is false, because }
  412. { not defined when writing the ppufile !! }
  413. {$ifdef TEST_IMPL}
  414. if (checksum<>0) and (loaded_unit^.crc<>checksum) then
  415. begin
  416. { we have to compile the current unit }
  417. { remove stuff which isn't needed }
  418. { forget the map }
  419. dispose(hp^.map);
  420. hp^.map:=nil;
  421. hp^.ppufile^.close;
  422. dispose(hp^.ppufile,done);
  423. hp^.ppufile:=nil;
  424. if not(hp^.sources_avail) then
  425. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  426. else
  427. begin
  428. oldhp^.current_inputfile^.tempclose;
  429. compile(hp^.mainsource^,compile_system);
  430. oldhp^.current_inputfile^.tempclose;
  431. end;
  432. exit;
  433. end;
  434. {$endif TEST_IMPL}
  435. { read until ibend }
  436. hp^.ppufile^.read_data(b,1,count);
  437. end;
  438. hp^.ppufile^.close;
  439. dispose(hp^.map);
  440. hp^.map:=nil;
  441. end;
  442. function loadunit(const s : string;compile_system, in_uses : boolean) : pmodule;
  443. var
  444. st : punitsymtable;
  445. old_current_module,hp,nextmodule : pmodule;
  446. pu : pused_unit;
  447. hs : pstring;
  448. begin
  449. old_current_module:=current_module;
  450. { be sure not to mix lines from different files }
  451. { update_line; }
  452. { unit not found }
  453. st:=nil;
  454. { search all loaded units }
  455. hp:=pmodule(loaded_units.first);
  456. while assigned(hp) do
  457. begin
  458. if hp^.modulename^=s then
  459. begin
  460. { the unit is already registered }
  461. { and this means that the unit }
  462. { is already compiled }
  463. { else there is a cyclic unit use }
  464. if assigned(hp^.symtable) then
  465. st:=punitsymtable(hp^.symtable)
  466. else
  467. begin
  468. { recompile the unit ? }
  469. if (not current_module^.in_implementation) and (hp^.in_implementation) then
  470. Message(unit_f_circular_unit_reference);
  471. end;
  472. break;
  473. end;
  474. { the next unit }
  475. hp:=pmodule(hp^.next);
  476. end;
  477. { no error and the unit isn't loaded }
  478. if not(assigned(hp)) and (st=nil) then
  479. begin
  480. { generates a new unit info record }
  481. hp:=new(pmodule,init(s,true));
  482. { now we can register the unit }
  483. loaded_units.insert(hp);
  484. current_module:=hp;
  485. { force build ? }
  486. if (hp^.do_compile) or (hp^.sources_avail and do_build) then
  487. begin
  488. { we needn't the ppufile }
  489. if assigned(hp^.ppufile) then
  490. begin
  491. dispose(hp^.ppufile,done);
  492. hp^.ppufile:=nil;
  493. end;
  494. if not(hp^.sources_avail) then
  495. Message1(unit_f_cant_compile_unit,hp^.modulename^)
  496. else
  497. begin
  498. if assigned(old_current_module^.current_inputfile) then
  499. old_current_module^.current_inputfile^.tempclose;
  500. compile(hp^.mainsource^,compile_system);
  501. if (not old_current_module^.compiled) and assigned(old_current_module^.current_inputfile) then
  502. old_current_module^.current_inputfile^.tempreopen;
  503. end;
  504. end
  505. else
  506. begin
  507. { only reassemble ? }
  508. if (hp^.do_assemble) then
  509. OnlyAsm(hp^.asmfilename^);
  510. { we should know there the PPU file else it's an error and
  511. we can't load the unit }
  512. if hp^.ppufile^.name^<>'' then
  513. load_ppu(old_current_module,hp,compile_system);
  514. { add the files for the linker }
  515. addlinkerfiles(hp);
  516. end;
  517. { register the unit _once_ }
  518. usedunits.concat(new(pused_unit,init(hp,0)));
  519. { the unit is written, so we can set the symtable type }
  520. { to unitsymtable, else we get some dupid errors }
  521. { this is not the right place because of the }
  522. { ready label }
  523. { psymtable(hp^.symtable)^.symtabletype:=unitsymtable; }
  524. { placed at this end of proc_unit }
  525. psymtable(hp^.symtable)^.unitid:=0;
  526. { reset the unitnumbers for the other units }
  527. pu:=pused_unit(old_current_module^.used_units.first);
  528. while assigned(pu) do
  529. begin
  530. psymtable(pu^.u^.symtable)^.unitid:=pu^.unitid;
  531. pu:=pused_unit(pu^.next);
  532. end;
  533. end
  534. else
  535. if assigned(hp) and (st=nil) then
  536. begin
  537. { we have to compile the unit again, but it is already inserted !!}
  538. { we may have problem with the lost symtable !! }
  539. current_module:=hp;
  540. { we must preserve the unit chain }
  541. nextmodule:=pmodule(hp^.next);
  542. { we have to cleanup a little }
  543. hp^.special_done;
  544. new(hs);
  545. hs^:=hp^.mainsource^;
  546. hp^.init(hs^,true);
  547. dispose(hs);
  548. { we must preserve the unit chain }
  549. hp^.next:=nextmodule;
  550. if assigned(hp^.ppufile) then
  551. load_ppu(old_current_module,hp,compile_system)
  552. else
  553. begin
  554. {$ifdef UseBrowser}
  555. { here we need to remove the names ! }
  556. hp^.sourcefiles.done;
  557. hp^.sourcefiles.init;
  558. {$endif UseBrowser}
  559. if assigned(old_current_module^.current_inputfile) then
  560. old_current_module^.current_inputfile^.tempclose;
  561. Message1(parser_d_compiling_second_time,hp^.mainsource^);
  562. compile(hp^.mainsource^,compile_system);
  563. if (not old_current_module^.compiled) and assigned(old_current_module^.current_inputfile) then
  564. old_current_module^.current_inputfile^.tempreopen;
  565. end;
  566. current_module^.compiled:=true;
  567. end;
  568. { set the old module }
  569. current_module:=old_current_module;
  570. { the current module uses the unit hp }
  571. current_module^.used_units.concat(new(pused_unit,init(hp,0)));
  572. pused_unit(current_module^.used_units.last)^.in_uses:=in_uses;
  573. if in_uses and not current_module^.in_implementation then
  574. pused_unit(current_module^.used_units.last)^.in_interface:=true;
  575. loadunit:=hp;
  576. end;
  577. {$endif OLDPPU}
  578. procedure loadsystemunit;
  579. var
  580. hp : pmodule;
  581. begin
  582. { if the current file isn't a system unit the the system unit
  583. will be loaded }
  584. if not(cs_compilesystem in aktmoduleswitches) then
  585. begin
  586. {$ifndef OLDPPU}
  587. hp:=loadunit(upper(target_info.system_unit),true);
  588. systemunit:=hp^.symtable;
  589. { add to the used units }
  590. current_module^.used_units.concat(new(pused_unit,init(hp,true)));
  591. {$else OLDPPU}
  592. hp:=loadunit(upper(target_info.system_unit),true,true);
  593. systemunit:=hp^.symtable;
  594. { add to the used units }
  595. current_module^.used_units.concat(new(pused_unit,init(hp,0)));
  596. {$endif OLDPPU}
  597. { read default constant definitions }
  598. make_ref:=false;
  599. readconstdefs;
  600. { we could try to overload caret by default }
  601. symtablestack:=systemunit;
  602. { if POWER is defined in the RTL then use it for starstar overloading }
  603. getsym('POWER',false);
  604. if assigned(srsym) and (srsym^.typ=procsym) and
  605. (overloaded_operators[STARSTAR]=nil) then
  606. overloaded_operators[STARSTAR]:=pprocsym(srsym);
  607. make_ref:=true;
  608. end
  609. else
  610. begin
  611. createconstdefs;
  612. systemunit:=nil;
  613. end;
  614. end;
  615. procedure loadunits;
  616. var
  617. s : stringid;
  618. hp : pused_unit;
  619. hp2 : pmodule;
  620. hp3 : psymtable;
  621. oldprocsym:Pprocsym;
  622. begin
  623. oldprocsym:=aktprocsym;
  624. consume(_USES);
  625. {$ifdef DEBUG}
  626. test_symtablestack;
  627. {$endif DEBUG}
  628. repeat
  629. s:=pattern;
  630. consume(ID);
  631. {$ifndef OLDPPU}
  632. hp2:=loadunit(s,false);
  633. { the current module uses the unit hp2 }
  634. current_module^.used_units.concat(new(pused_unit,init(hp2,not current_module^.in_implementation)));
  635. pused_unit(current_module^.used_units.last)^.in_uses:=true;
  636. {$else OLDPPU}
  637. hp2:=loadunit(s,false,true);
  638. {$endif OLDPPU}
  639. if current_module^.compiled then
  640. exit;
  641. refsymtable^.insert(new(punitsym,init(s,hp2^.symtable)));
  642. if token=COMMA then
  643. begin
  644. pattern:='';
  645. consume(COMMA);
  646. end
  647. else
  648. break;
  649. until false;
  650. consume(SEMICOLON);
  651. { set the symtable to systemunit so it gets reorderd correctly }
  652. symtablestack:=systemunit;
  653. { now insert the units in the symtablestack }
  654. hp:=pused_unit(current_module^.used_units.first);
  655. while assigned(hp) do
  656. begin
  657. {$IfDef GDB}
  658. if (cs_debuginfo in aktmoduleswitches) and
  659. not hp^.is_stab_written then
  660. begin
  661. punitsymtable(hp^.u^.symtable)^.concattypestabto(debuglist);
  662. hp^.is_stab_written:=true;
  663. hp^.unitid:=psymtable(hp^.u^.symtable)^.unitid;
  664. end;
  665. {$EndIf GDB}
  666. if hp^.in_uses then
  667. begin
  668. hp3:=symtablestack;
  669. while assigned(hp3) do
  670. begin
  671. { insert units only once ! }
  672. if hp^.u^.symtable=hp3 then
  673. break;
  674. hp3:=hp3^.next;
  675. { unit isn't inserted }
  676. if hp3=nil then
  677. begin
  678. psymtable(hp^.u^.symtable)^.next:=symtablestack;
  679. symtablestack:=psymtable(hp^.u^.symtable);
  680. {$ifdef CHAINPROCSYMS}
  681. symtablestack^.chainprocsyms;
  682. {$endif CHAINPROCSYMS}
  683. {$ifdef DEBUG}
  684. test_symtablestack;
  685. {$endif DEBUG}
  686. end;
  687. end;
  688. end;
  689. hp:=pused_unit(hp^.next);
  690. end;
  691. aktprocsym:=oldprocsym;
  692. end;
  693. procedure parse_implementation_uses(symt:Psymtable);
  694. var
  695. old_module_in_implementation : boolean;
  696. begin
  697. if token=_USES then
  698. begin
  699. old_module_in_implementation:=module_in_implementation;
  700. module_in_implementation:=true;
  701. current_module^.in_implementation:=true;
  702. symt^.symtabletype:=unitsymtable;
  703. loadunits;
  704. symt^.symtabletype:=globalsymtable;
  705. {$ifdef DEBUG}
  706. test_symtablestack;
  707. {$endif DEBUG}
  708. module_in_implementation:=old_module_in_implementation;
  709. end;
  710. end;
  711. procedure proc_unit;
  712. var
  713. { unitname : stringid; }
  714. names : Tstringcontainer;
  715. p : psymtable;
  716. unitst : punitsymtable;
  717. pu : pused_unit;
  718. i : longint;
  719. s1,s2 : ^string; {Saves stack space}
  720. begin
  721. consume(_UNIT);
  722. if token=ID then
  723. begin
  724. { create filenames and unit name }
  725. current_module^.SetFileName(current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^);
  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. s2^:=upper(current_scanner^.inputfile^.name^);
  733. { strip extension, there could only be one dot }
  734. i:=pos('.',s2^);
  735. if i>0 then
  736. s2^:=Copy(s2^,1,i-1);
  737. if (cs_compilesystem in aktmoduleswitches) then
  738. begin
  739. if (cs_check_unit_name in aktglobalswitches) and
  740. ((length(current_module^.modulename^)>8) or
  741. (current_module^.modulename^<>s1^) or
  742. (current_module^.modulename^<>s2^)) then
  743. Message1(unit_e_illegal_unit_name,s1^);
  744. end
  745. else
  746. if (current_module^.modulename^=s1^) then
  747. Message(unit_w_switch_us_missed);
  748. dispose(s2);
  749. dispose(s1);
  750. end;
  751. consume(ID);
  752. consume(SEMICOLON);
  753. consume(_INTERFACE);
  754. { update status }
  755. status.currentmodule:=current_module^.modulename^;
  756. { this should be placed after uses !!}
  757. {$ifndef UseNiceNames}
  758. procprefix:='_'+current_module^.modulename^+'$$';
  759. {$else UseNiceNames}
  760. procprefix:='_'+tostr(length(current_module^.unitname^))+lowercase(current_module^.unitname^)+'_';
  761. {$endif UseNiceNames}
  762. parse_only:=true;
  763. { generate now the global symboltable }
  764. p:=new(punitsymtable,init(globalsymtable,current_module^.modulename^));
  765. refsymtable:=p;
  766. unitst:=punitsymtable(p);
  767. { the unit name must be usable as a unit specifier }
  768. { inside the unit itself (PM) }
  769. { this also forbids to have another symbol }
  770. { with the same name as the unit }
  771. refsymtable^.insert(new(punitsym,init(current_module^.modulename^,unitst)));
  772. { set the symbol table for the current unit }
  773. { this must be set later for interdependency }
  774. { current_module^.symtable:=psymtable(p); }
  775. { a unit compiled at command line must be inside the loaded_unit list }
  776. if (compile_level=1) then
  777. loaded_units.insert(current_module);
  778. { insert qualifier for the system unit (allows system.writeln) }
  779. if not(cs_compilesystem in aktmoduleswitches) then
  780. begin
  781. { insert the system unit }
  782. { it is allways the first }
  783. systemunit^.next:=nil;
  784. symtablestack:=systemunit;
  785. refsymtable^.insert(new(punitsym,init('SYSTEM',systemunit)));
  786. if token=_USES then
  787. begin
  788. unitst^.symtabletype:=unitsymtable;
  789. loadunits;
  790. { has it been compiled at a higher level ?}
  791. if current_module^.compiled then
  792. exit;
  793. unitst^.symtabletype:=globalsymtable;
  794. end;
  795. { ... but insert the symbol table later }
  796. p^.next:=symtablestack;
  797. symtablestack:=p;
  798. end
  799. else
  800. { while compiling a system unit, some types are directly inserted }
  801. begin
  802. p^.next:=symtablestack;
  803. symtablestack:=p;
  804. insert_intern_types(p);
  805. end;
  806. { displaced for inter-dependency considerations }
  807. current_module^.symtable:=psymtable(p);
  808. constsymtable:=symtablestack;
  809. { ... parse the declarations }
  810. read_interface_declarations;
  811. consume(_IMPLEMENTATION);
  812. parse_only:=false;
  813. {$ifdef GDB}
  814. { add all used definitions even for implementation}
  815. if (cs_debuginfo in aktmoduleswitches) then
  816. begin
  817. { all types }
  818. punitsymtable(refsymtable)^.concattypestabto(debuglist);
  819. { and all local symbols}
  820. refsymtable^.concatstabto(debuglist);
  821. end;
  822. {$endif GDB}
  823. { generates static symbol table }
  824. p:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  825. {Generate a procsym.}
  826. make_ref:=false;
  827. aktprocsym:=new(Pprocsym,init(current_module^.modulename^+'_init'));
  828. aktprocsym^.definition:=new(Pprocdef,init);
  829. aktprocsym^.definition^.options:=aktprocsym^.definition^.options or pounitinit;
  830. aktprocsym^.definition^.setmangledname(current_module^.modulename^+'_init');
  831. make_ref:=true;
  832. {The generated procsym has a local symtable. Discard it and turn
  833. it into the static one.}
  834. dispose(aktprocsym^.definition^.localst,done);
  835. aktprocsym^.definition^.localst:=p;
  836. { remove the globalsymtable from the symtable stack }
  837. { to reinsert it after loading the implementation units }
  838. symtablestack:=unitst^.next;
  839. { number the definitions, so a deref from other units works }
  840. refsymtable^.number_defs;
  841. { Read the implementation units }
  842. parse_implementation_uses(unitst);
  843. numberunits;
  844. { now we can change refsymtable }
  845. refsymtable:=p;
  846. { but reinsert the global symtable as lasts }
  847. unitst^.next:=symtablestack;
  848. symtablestack:=unitst;
  849. {$ifdef DEBUG}
  850. test_symtablestack;
  851. {$endif DEBUG}
  852. constsymtable:=symtablestack;
  853. {$ifdef Splitheap}
  854. if testsplit then
  855. begin
  856. Split_Heap;
  857. allow_special:=true;
  858. Switch_to_temp_heap;
  859. end;
  860. { it will report all crossings }
  861. allow_special:=false;
  862. {$endif Splitheap}
  863. { set some informations }
  864. procinfo.retdef:=voiddef;
  865. procinfo._class:=nil;
  866. procinfo.call_offset:=8;
  867. { for temporary values }
  868. procinfo.framepointer:=frame_pointer;
  869. { clear flags }
  870. procinfo.flags:=0;
  871. { Create a new procedure }
  872. codegen_newprocedure;
  873. { Compile the unit }
  874. names.init;
  875. names.insert(current_module^.modulename^+'_init');
  876. names.insert('INIT$$'+current_module^.modulename^);
  877. compile_proc_body(names,true,false);
  878. names.done;
  879. { Shutdown the codegen for this procedure }
  880. codegen_doneprocedure;
  881. {$ifdef dummy}
  882. if token=_FINALIZATION then
  883. begin
  884. current_module^.flags:=current_module^.flags or uf_finalize;
  885. { clear flags }
  886. procinfo.flags:=0;
  887. {Reset the codegenerator.}
  888. codegen_newprocedure;
  889. names.init;
  890. names.insert(current_module^.modulename^+'_finalize');
  891. names.insert('FINALIZE$$'+current_module^.modulename^);
  892. compile_proc_body(names,true,false);
  893. names.done;
  894. codegen_doneprocedure;
  895. end;
  896. {$endif dummy}
  897. consume(POINT);
  898. { size of the static data }
  899. datasize:=symtablestack^.datasize;
  900. { unsed static symbols ? }
  901. symtablestack^.allsymbolsused;
  902. {$ifdef GDB}
  903. { add all used definitions even for implementation}
  904. if (cs_debuginfo in aktmoduleswitches) then
  905. begin
  906. { all types }
  907. punitsymtable(symtablestack)^.concattypestabto(debuglist);
  908. { and all local symbols}
  909. symtablestack^.concatstabto(debuglist);
  910. end;
  911. {$endif GDB}
  912. current_module^.in_implementation:=false;
  913. { deletes all symtables generated in the implementation part }
  914. while symtablestack^.symtabletype<>globalsymtable do
  915. dellexlevel;
  916. { tests, if all forwards are resolved }
  917. symtablestack^.check_forwards;
  918. symtablestack^.symtabletype:=unitsymtable;
  919. punitsymtable(symtablestack)^.is_stab_written:=false;
  920. { insert own objectfile }
  921. insertobjectfile;
  922. {Write out the unit if the compile was succesfull.}
  923. if status.errorcount=0 then
  924. writeunitas(current_module^.ppufilename^,punitsymtable(symtablestack));
  925. pu:=pused_unit(usedunits.first);
  926. while assigned(pu) do
  927. begin
  928. punitsymtable(pu^.u^.symtable)^.is_stab_written:=false;
  929. pu:=pused_unit(pu^.next);
  930. end;
  931. inc(datasize,symtablestack^.datasize);
  932. { leave when we got an error }
  933. if status.errorcount>0 then
  934. exit;
  935. { generate imports }
  936. if current_module^.uses_imports then
  937. importlib^.generatelib;
  938. { finish asmlist by adding segment starts }
  939. insertsegment;
  940. { assemble }
  941. create_objectfile;
  942. end;
  943. procedure proc_program(islibrary : boolean);
  944. var
  945. st : psymtable;
  946. names : Tstringcontainer;
  947. begin
  948. parse_only:=false;
  949. if islibrary then
  950. begin
  951. consume(_LIBRARY);
  952. stringdispose(current_module^.modulename);
  953. current_module^.modulename:=stringdup(pattern);
  954. consume(ID);
  955. consume(SEMICOLON);
  956. end
  957. else
  958. { is there an program head ? }
  959. if token=_PROGRAM then
  960. begin
  961. consume(_PROGRAM);
  962. stringdispose(current_module^.modulename);
  963. current_module^.modulename:=stringdup(pattern);
  964. consume(ID);
  965. if token=LKLAMMER then
  966. begin
  967. consume(LKLAMMER);
  968. idlist;
  969. consume(RKLAMMER);
  970. end;
  971. consume(SEMICOLON);
  972. end;
  973. { insert after the unit symbol tables the static symbol table }
  974. { of the program }
  975. st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  976. {Generate a procsym.}
  977. make_ref:=false;
  978. aktprocsym:=new(Pprocsym,init('main'));
  979. aktprocsym^.definition:=new(Pprocdef,init);
  980. aktprocsym^.definition^.options:=aktprocsym^.definition^.options or poproginit;
  981. aktprocsym^.definition^.setmangledname(target_os.Cprefix+'main');
  982. make_ref:=true;
  983. {The localst is a local symtable. Change it into the static
  984. symtable.}
  985. dispose(aktprocsym^.definition^.localst,done);
  986. aktprocsym^.definition^.localst:=st;
  987. refsymtable:=st;
  988. { necessary for browser }
  989. loaded_units.insert(current_module);
  990. {Insert the symbols of the system unit into the stack of symbol
  991. tables.}
  992. symtablestack:=systemunit;
  993. systemunit^.next:=nil;
  994. refsymtable^.insert(new(punitsym,init('SYSTEM',systemunit)));
  995. {Load the units used by the program we compile.}
  996. if token=_USES then
  997. loadunits;
  998. {Insert the name of the main program into the symbol table.}
  999. if current_module^.modulename^<>'' then
  1000. st^.insert(new(pprogramsym,init(current_module^.modulename^)));
  1001. { ...is also constsymtable, this is the symtable where }
  1002. { the elements of enumeration types are inserted }
  1003. constsymtable:=st;
  1004. { set some informations about the main program }
  1005. with procinfo do
  1006. begin
  1007. retdef:=voiddef;
  1008. _class:=nil;
  1009. call_offset:=8;
  1010. framepointer:=frame_pointer;
  1011. flags:=0;
  1012. end;
  1013. procprefix:='';
  1014. in_except_block:=false;
  1015. codegen_newprocedure;
  1016. {The program intialization needs an alias, so it can be called
  1017. from the bootstrap code.}
  1018. names.init;
  1019. names.insert('program_init');
  1020. names.insert('PASCALMAIN');
  1021. names.insert(target_os.cprefix+'main');
  1022. compile_proc_body(names,true,false);
  1023. names.done;
  1024. codegen_doneprocedure;
  1025. consume(POINT);
  1026. { leave when we got an error }
  1027. if status.errorcount>0 then
  1028. exit;
  1029. { insert heap }
  1030. insertheap;
  1031. { generate imports }
  1032. if current_module^.uses_imports then
  1033. importlib^.generatelib;
  1034. inserttargetspecific;
  1035. datasize:=symtablestack^.datasize;
  1036. { finish asmlist by adding segment starts }
  1037. insertsegment;
  1038. { insert own objectfile }
  1039. insertobjectfile;
  1040. { assemble and link }
  1041. create_objectfile;
  1042. { create the executable when we are at level 1 }
  1043. if (compile_level=1) then
  1044. begin
  1045. if (cs_link_deffile in aktglobalswitches) then
  1046. deffile.writefile;
  1047. if (not current_module^.is_unit) then
  1048. Linker.MakeExecutable;
  1049. end;
  1050. end;
  1051. end.
  1052. {
  1053. $Log$
  1054. Revision 1.40 1998-08-17 09:17:50 peter
  1055. * static/shared linking updates
  1056. Revision 1.39 1998/08/14 21:56:37 peter
  1057. * setting the outputfile using -o works now to create static libs
  1058. Revision 1.38 1998/08/10 14:50:13 peter
  1059. + localswitches, moduleswitches, globalswitches splitting
  1060. Revision 1.37 1998/08/10 10:18:31 peter
  1061. + Compiler,Comphook unit which are the new interface units to the
  1062. compiler
  1063. Revision 1.36 1998/07/14 14:46:54 peter
  1064. * released NEWINPUT
  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. }