pmodules.pas 47 KB

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