parser.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. This unit does the parsing process
  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. {$ifdef tp}
  19. {$E+,N+,D+,F+}
  20. {$endif}
  21. unit parser;
  22. { Use exception catching so the compiler goes futher after a Stop }
  23. {$ifdef i386}
  24. {$define USEEXCEPT}
  25. {$endif}
  26. {$ifdef TP}
  27. {$ifdef DPMI}
  28. {$undef USEEXCEPT}
  29. {$endif}
  30. {$endif}
  31. interface
  32. procedure compile(const filename:string;compile_system:boolean);
  33. procedure initparser;
  34. procedure doneparser;
  35. implementation
  36. uses
  37. globtype,version,tokens,systems,
  38. cobjects,globals,verbose,
  39. symtable,files,aasm,hcodegen,
  40. assemble,link,script,gendef,
  41. {$ifdef BrowserLog}
  42. browlog,
  43. {$endif BrowserLog}
  44. {$ifdef BrowserCol}
  45. browcol,
  46. {$endif BrowserCol}
  47. {$ifdef UseExcept}
  48. tpexcept,compiler,
  49. {$endif UseExcept}
  50. {$ifdef newcg}
  51. cgobj,
  52. cgcpu,
  53. {$endif newcg}
  54. comphook,tree,scanner,pbase,pdecl,psystem,pmodules,cresstr;
  55. procedure initparser;
  56. begin
  57. forwardsallowed:=false;
  58. { ^M means a string or a char, because we don't parse a }
  59. { type declaration }
  60. ignore_equal:=false;
  61. { we didn't parse a object or class declaration }
  62. { and no function header }
  63. testcurobject:=0;
  64. { a long time, this was forgotten }
  65. aktprocsym:=nil;
  66. current_module:=nil;
  67. loaded_units.init;
  68. usedunits.init;
  69. { global switches }
  70. aktglobalswitches:=initglobalswitches;
  71. { scanner }
  72. c:=#0;
  73. pattern:='';
  74. orgpattern:='';
  75. current_scanner:=nil;
  76. { memory sizes }
  77. if heapsize=0 then
  78. heapsize:=target_info.heapsize;
  79. if maxheapsize=0 then
  80. maxheapsize:=target_info.maxheapsize;
  81. if stacksize=0 then
  82. stacksize:=target_info.stacksize;
  83. { open assembler response }
  84. AsmRes.Init(outputexedir+'ppas');
  85. { open deffile }
  86. DefFile.Init(outputexedir+inputfile+target_os.defext);
  87. end;
  88. procedure doneparser;
  89. begin
  90. { unload units }
  91. loaded_units.done;
  92. usedunits.done;
  93. { close ppas and deffile }
  94. asmres.done;
  95. deffile.done;
  96. end;
  97. procedure default_macros;
  98. var
  99. hp : pstring_item;
  100. begin
  101. { commandline }
  102. hp:=pstring_item(initdefines.first);
  103. while assigned(hp) do
  104. begin
  105. def_macro(hp^.str^);
  106. hp:=pstring_item(hp^.next);
  107. end;
  108. { set macros for version checking }
  109. set_macro('FPC_VERSION',version_nr);
  110. set_macro('FPC_RELEASE',release_nr);
  111. set_macro('FPC_PATCH',patch_nr);
  112. end;
  113. procedure compile(const filename:string;compile_system:boolean);
  114. var
  115. { scanner }
  116. oldidtoken,
  117. oldtoken : ttoken;
  118. oldtokenpos : tfileposinfo;
  119. oldc : char;
  120. oldpattern,
  121. oldorgpattern : string;
  122. old_block_type : tblock_type;
  123. oldcurrent_scanner,prev_scanner,
  124. scanner : pscannerfile;
  125. { symtable }
  126. oldmacros,
  127. oldrefsymtable,
  128. oldsymtablestack : psymtable;
  129. oldprocprefix : string;
  130. oldaktprocsym : pprocsym;
  131. { cg }
  132. oldnextlabelnr : longint;
  133. oldparse_only : boolean;
  134. { asmlists }
  135. oldimports,
  136. oldexports,
  137. oldresource,
  138. oldrttilist,
  139. oldresourcestringlist,
  140. oldbsssegment,
  141. olddatasegment,
  142. oldcodesegment,
  143. oldexprasmlist,
  144. olddebuglist,
  145. oldconsts : paasmoutput;
  146. oldasmsymbollist : pasmsymbollist;
  147. { akt.. things }
  148. oldaktlocalswitches : tlocalswitches;
  149. oldaktmoduleswitches : tmoduleswitches;
  150. oldaktfilepos : tfileposinfo;
  151. oldaktpackrecords : tpackrecords;
  152. oldaktoutputformat : tasm;
  153. oldaktoptprocessor : tprocessors;
  154. oldaktasmmode : tasmmode;
  155. oldaktmodeswitches : tmodeswitches;
  156. prev_name : pstring;
  157. {$ifdef USEEXCEPT}
  158. recoverpos : jmp_buf;
  159. oldrecoverpos : pjmp_buf;
  160. {$endif useexcept}
  161. {$ifdef newcg}
  162. oldcg : pcg;
  163. {$endif newcg}
  164. begin
  165. inc(compile_level);
  166. prev_name:=stringdup(parser_current_file);
  167. parser_current_file:=filename;
  168. { save symtable state }
  169. oldsymtablestack:=symtablestack;
  170. oldrefsymtable:=refsymtable;
  171. oldmacros:=macros;
  172. oldprocprefix:=procprefix;
  173. oldaktprocsym:=aktprocsym;
  174. { save scanner state }
  175. oldc:=c;
  176. oldpattern:=pattern;
  177. oldorgpattern:=orgpattern;
  178. oldtoken:=token;
  179. oldidtoken:=idtoken;
  180. old_block_type:=block_type;
  181. oldtokenpos:=tokenpos;
  182. oldcurrent_scanner:=current_scanner;
  183. { save cg }
  184. oldnextlabelnr:=nextlabelnr;
  185. oldparse_only:=parse_only;
  186. { save assembler lists }
  187. olddatasegment:=datasegment;
  188. oldbsssegment:=bsssegment;
  189. oldcodesegment:=codesegment;
  190. olddebuglist:=debuglist;
  191. oldconsts:=consts;
  192. oldrttilist:=rttilist;
  193. oldexprasmlist:=exprasmlist;
  194. oldimports:=importssection;
  195. oldexports:=exportssection;
  196. oldresource:=resourcesection;
  197. oldresourcestringlist:=resourcestringlist;
  198. oldasmsymbollist:=asmsymbollist;
  199. { save akt... state }
  200. oldaktlocalswitches:=aktlocalswitches;
  201. oldaktmoduleswitches:=aktmoduleswitches;
  202. oldaktpackrecords:=aktpackrecords;
  203. oldaktoutputformat:=aktoutputformat;
  204. oldaktoptprocessor:=aktoptprocessor;
  205. oldaktasmmode:=aktasmmode;
  206. oldaktfilepos:=aktfilepos;
  207. oldaktmodeswitches:=aktmodeswitches;
  208. {$ifdef newcg}
  209. oldcg:=cg;
  210. {$endif newcg}
  211. { show info }
  212. Message1(parser_i_compiling,filename);
  213. { reset symtable }
  214. symtablestack:=nil;
  215. defaultsymtablestack:=nil;
  216. systemunit:=nil;
  217. objpasunit:=nil;
  218. refsymtable:=nil;
  219. aktprocsym:=nil;
  220. procprefix:='';
  221. registerdef:=true;
  222. { macros }
  223. macros:=new(psymtable,init(macrosymtable));
  224. macros^.name:=stringdup('Conditionals for '+filename);
  225. default_macros;
  226. { reset the unit or create a new program }
  227. if assigned(current_module) then
  228. begin
  229. {current_module^.reset this is wrong !! }
  230. scanner:=current_module^.scanner;
  231. current_module^.reset;
  232. current_module^.scanner:=scanner;
  233. end
  234. else
  235. begin
  236. current_module:=new(pmodule,init(filename,false));
  237. main_module:=current_module;
  238. end;
  239. current_module^.in_compile:=true;
  240. { Load current state from the init values }
  241. aktlocalswitches:=initlocalswitches;
  242. aktmoduleswitches:=initmoduleswitches;
  243. aktmodeswitches:=initmodeswitches;
  244. aktpackrecords:=initpackrecords;
  245. aktpackenum:=initpackenum;
  246. aktoutputformat:=initoutputformat;
  247. aktoptprocessor:=initoptprocessor;
  248. aktasmmode:=initasmmode;
  249. { we need this to make the system unit }
  250. if compile_system then
  251. aktmoduleswitches:=aktmoduleswitches+[cs_compilesystem];
  252. { startup scanner, and save in current_module }
  253. current_scanner:=new(pscannerfile,Init(filename));
  254. current_scanner^.readtoken;
  255. prev_scanner:=current_module^.scanner;
  256. current_module^.scanner:=current_scanner;
  257. { init code generator for a new module }
  258. codegen_newmodule;
  259. {$ifdef newcg}
  260. {$ifdef i386}
  261. cg:=new(pcg386,init);
  262. {$endif i386}
  263. {$ifdef alpha}
  264. cg:=new(pcgalpha,init);
  265. {$endif alpha}
  266. {$ifdef powerpc}
  267. cg:=new(pcgppc,init);
  268. {$endif powerpc}
  269. {$endif newcg}
  270. { If the compile level > 1 we get a nice "unit expected" error
  271. message if we are trying to use a program as unit.}
  272. {$ifdef USEEXCEPT}
  273. if setjmp(recoverpos)=0 then
  274. begin
  275. oldrecoverpos:=recoverpospointer;
  276. recoverpospointer:=@recoverpos;
  277. {$endif USEEXCEPT}
  278. if (token=_UNIT) or (compile_level>1) then
  279. begin
  280. current_module^.is_unit:=true;
  281. proc_unit;
  282. end
  283. else
  284. proc_program(token=_LIBRARY);
  285. {$ifdef USEEXCEPT}
  286. recoverpospointer:=oldrecoverpos;
  287. end
  288. else
  289. begin
  290. recoverpospointer:=oldrecoverpos;
  291. longjump_used:=true;
  292. end;
  293. {$endif USEEXCEPT}
  294. { clear memory }
  295. {$ifdef Splitheap}
  296. if testsplit then
  297. begin
  298. { temp heap should be empty after that !!!}
  299. codegen_donemodule;
  300. Releasetempheap;
  301. end;
  302. {$endif Splitheap}
  303. { restore old state, close trees, > 0.99.5 has heapblocks, so
  304. it's the default to release the trees }
  305. codegen_donemodule;
  306. {$ifdef newcg}
  307. dispose(cg,done);
  308. {$endif newcg}
  309. { free ppu }
  310. if assigned(current_module^.ppufile) then
  311. begin
  312. dispose(current_module^.ppufile,done);
  313. current_module^.ppufile:=nil;
  314. end;
  315. { free scanner }
  316. dispose(current_scanner,done);
  317. { restore previous scanner !! }
  318. current_module^.scanner:=prev_scanner;
  319. if assigned(prev_scanner) then
  320. prev_scanner^.invalid:=true;
  321. { free macros }
  322. {!!! No check for unused macros yet !!! }
  323. dispose(macros,done);
  324. if (compile_level>1) then
  325. begin
  326. {$ifdef newcg}
  327. cg:=oldcg;
  328. {$endif newcg}
  329. { restore scanner }
  330. c:=oldc;
  331. pattern:=oldpattern;
  332. orgpattern:=oldorgpattern;
  333. token:=oldtoken;
  334. idtoken:=oldidtoken;
  335. tokenpos:=oldtokenpos;
  336. block_type:=old_block_type;
  337. current_scanner:=oldcurrent_scanner;
  338. { restore cg }
  339. nextlabelnr:=oldnextlabelnr;
  340. parse_only:=oldparse_only;
  341. { restore asmlists }
  342. exprasmlist:=oldexprasmlist;
  343. datasegment:=olddatasegment;
  344. bsssegment:=oldbsssegment;
  345. codesegment:=oldcodesegment;
  346. consts:=oldconsts;
  347. debuglist:=olddebuglist;
  348. importssection:=oldimports;
  349. exportssection:=oldexports;
  350. resourcesection:=oldresource;
  351. rttilist:=oldrttilist;
  352. resourcestringlist:=oldresourcestringlist;
  353. asmsymbollist:=oldasmsymbollist;
  354. { restore symtable state }
  355. refsymtable:=oldrefsymtable;
  356. symtablestack:=oldsymtablestack;
  357. macros:=oldmacros;
  358. aktprocsym:=oldaktprocsym;
  359. procprefix:=oldprocprefix;
  360. aktlocalswitches:=oldaktlocalswitches;
  361. aktmoduleswitches:=oldaktmoduleswitches;
  362. aktpackrecords:=oldaktpackrecords;
  363. aktoutputformat:=oldaktoutputformat;
  364. aktoptprocessor:=oldaktoptprocessor;
  365. aktasmmode:=oldaktasmmode;
  366. aktfilepos:=oldaktfilepos;
  367. aktmodeswitches:=oldaktmodeswitches;
  368. end;
  369. { Shut down things when the last file is compiled }
  370. if (compile_level=1) then
  371. begin
  372. { Close script }
  373. if (not AsmRes.Empty) then
  374. begin
  375. Message1(exec_i_closing_script,AsmRes.Fn);
  376. AsmRes.WriteToDisk;
  377. end;
  378. {$ifdef USEEXCEPT}
  379. if not longjump_used then
  380. {$endif USEEXCEPT}
  381. { do not create browsers on errors !! }
  382. if status.errorcount=0 then
  383. begin
  384. {$ifdef BrowserLog}
  385. { Write Browser Log }
  386. if (cs_browser_log in aktglobalswitches) and
  387. (cs_browser in aktmoduleswitches) then
  388. begin
  389. if browserlog.elements_to_list^.empty then
  390. begin
  391. Message1(parser_i_writing_browser_log,browserlog.Fname);
  392. WriteBrowserLog;
  393. end
  394. else
  395. browserlog.list_elements;
  396. end;
  397. {$endif BrowserLog}
  398. {$ifdef BrowserCol}
  399. { Write Browser Collections }
  400. if (cs_browser in aktmoduleswitches) then
  401. CreateBrowserCol;
  402. {$endif}
  403. end;
  404. if current_module^.in_second_compile then
  405. begin
  406. current_module^.in_second_compile:=false;
  407. current_module^.in_compile:=true;
  408. end
  409. else
  410. current_module^.in_compile:=false;
  411. (* Obsolete code aktprocsym
  412. is disposed by the localsymtable disposal (PM)
  413. { Free last aktprocsym }
  414. if assigned(aktprocsym) and (aktprocsym^.owner=nil) then
  415. begin
  416. { init parts are not needed in units !! }
  417. if current_module^.is_unit then
  418. aktprocsym^.definition^.forwarddef:=false;
  419. dispose(aktprocsym,done);
  420. end; *)
  421. end;
  422. dec(compile_level);
  423. parser_current_file:=prev_name^;
  424. stringdispose(prev_name);
  425. {$ifdef USEEXCEPT}
  426. if longjump_used then
  427. longjmp(recoverpospointer^,1);
  428. {$endif USEEXCEPT}
  429. end;
  430. end.
  431. {
  432. $Log$
  433. Revision 1.83 1999-08-31 15:51:11 pierre
  434. * in_second_compile cleaned up, in_compile and in_second_load added
  435. Revision 1.82 1999/08/26 20:24:41 michael
  436. + Hopefuly last fixes for resourcestrings
  437. Revision 1.81 1999/08/04 13:02:48 jonas
  438. * all tokens now start with an underscore
  439. * PowerPC compiles!!
  440. Revision 1.80 1999/08/03 17:09:37 florian
  441. * the alpha compiler can be compiled now
  442. Revision 1.79 1999/08/01 23:36:40 florian
  443. * some changes to compile the new code generator
  444. Revision 1.78 1999/07/24 16:22:18 michael
  445. + Improved resourcestring handling
  446. Revision 1.77 1999/07/23 16:05:22 peter
  447. * alignment is now saved in the symtable
  448. * C alignment added for records
  449. * PPU version increased to solve .12 <-> .13 probs
  450. Revision 1.76 1999/07/22 09:37:49 florian
  451. + resourcestring implemented
  452. + start of longstring support
  453. Revision 1.75 1999/06/15 13:23:48 pierre
  454. * don't generate browser if errors during compilation
  455. Revision 1.74 1999/05/27 19:44:41 peter
  456. * removed oldasm
  457. * plabel -> pasmlabel
  458. * -a switches to source writing automaticly
  459. * assembler readers OOPed
  460. * asmsymbol automaticly external
  461. * jumptables and other label fixes for asm readers
  462. Revision 1.73 1999/05/18 22:35:52 pierre
  463. * double dispose of aktprocsym removed
  464. Revision 1.72 1999/04/26 13:31:36 peter
  465. * release storenumber,double_checksum
  466. Revision 1.71 1999/03/26 00:05:33 peter
  467. * released valintern
  468. + deffile is now removed when compiling is finished
  469. * ^( compiles now correct
  470. + static directive
  471. * shrd fixed
  472. Revision 1.70 1999/03/24 23:17:10 peter
  473. * fixed bugs 212,222,225,227,229,231,233
  474. Revision 1.69 1999/02/25 21:02:40 peter
  475. * ag386bin updates
  476. + coff writer
  477. Revision 1.68 1999/02/02 16:39:41 peter
  478. * reset c,pattern,orgpattern also at startup
  479. Revision 1.67 1999/01/27 13:05:44 pierre
  480. * give include file name on error
  481. Revision 1.66 1999/01/23 23:29:35 florian
  482. * first running version of the new code generator
  483. * when compiling exceptions under Linux fixed
  484. Revision 1.65 1999/01/22 12:19:31 pierre
  485. + currently compiled file name added on errors
  486. Revision 1.64 1999/01/12 14:25:29 peter
  487. + BrowserLog for browser.log generation
  488. + BrowserCol for browser info in TCollections
  489. * released all other UseBrowser
  490. Revision 1.63 1998/12/11 00:03:26 peter
  491. + globtype,tokens,version unit splitted from globals
  492. Revision 1.62 1998/12/01 12:51:21 peter
  493. * fixed placing of ppas.sh and link.res when using -FE
  494. Revision 1.61 1998/11/10 10:09:11 peter
  495. * va_list -> array of const
  496. Revision 1.60 1998/10/28 18:26:14 pierre
  497. * removed some erros after other errors (introduced by useexcept)
  498. * stabs works again correctly (for how long !)
  499. Revision 1.59 1998/10/26 17:15:18 pierre
  500. + added two level of longjump to
  501. allow clean freeing of used memory on errors
  502. Revision 1.58 1998/10/16 08:50:02 peter
  503. * reset_gdb_info -> reset_global_def becuase it also resets rangenr !
  504. Revision 1.57 1998/10/08 17:17:23 pierre
  505. * current_module old scanner tagged as invalid if unit is recompiled
  506. + added ppheap for better info on tracegetmem of heaptrc
  507. (adds line column and file index)
  508. * several memory leaks removed ith help of heaptrc !!
  509. Revision 1.56 1998/10/08 13:48:45 peter
  510. * fixed memory leaks for do nothing source
  511. * fixed unit interdependency
  512. Revision 1.55 1998/10/06 17:16:53 pierre
  513. * some memory leaks fixed (thanks to Peter for heaptrc !)
  514. Revision 1.54 1998/10/05 21:33:23 peter
  515. * fixed 161,165,166,167,168
  516. Revision 1.53 1998/09/30 16:43:36 peter
  517. * fixed unit interdependency with circular uses
  518. Revision 1.52 1998/09/28 16:57:22 pierre
  519. * changed all length(p^.value_str^) into str_length(p)
  520. to get it work with and without ansistrings
  521. * changed sourcefiles field of tmodule to a pointer
  522. Revision 1.51 1998/09/26 17:45:30 peter
  523. + idtoken and only one token table
  524. Revision 1.50 1998/09/24 23:49:08 peter
  525. + aktmodeswitches
  526. Revision 1.49 1998/09/23 15:39:07 pierre
  527. * browser bugfixes
  528. was adding a reference when looking for the symbol
  529. if -bSYM_NAME was used
  530. Revision 1.48 1998/09/22 17:13:48 pierre
  531. + browsing updated and developed
  532. records and objects fields are also stored
  533. Revision 1.47 1998/09/21 09:00:18 peter
  534. * reset_gdb_info only when debuginfo is set
  535. Revision 1.46 1998/09/21 08:45:12 pierre
  536. + added vmt_offset in tobjectdef.write for fututre use
  537. (first steps to have objects without vmt if no virtual !!)
  538. + added fpu_used field for tabstractprocdef :
  539. sets this level to 2 if the functions return with value in FPU
  540. (is then set to correct value at parsing of implementation)
  541. THIS MIGHT refuse some code with FPU expression too complex
  542. that were accepted before and even in some cases
  543. that don't overflow in fact
  544. ( like if f : float; is a forward that finally in implementation
  545. only uses one fpu register !!)
  546. Nevertheless I think that it will improve security on
  547. FPU operations !!
  548. * most other changes only for UseBrowser code
  549. (added symtable references for record and objects)
  550. local switch for refs to args and local of each function
  551. (static symtable still missing)
  552. UseBrowser still not stable and probably broken by
  553. the definition hash array !!
  554. Revision 1.45 1998/09/18 08:01:35 pierre
  555. + improvement on the usebrowser part
  556. (does not work correctly for now)
  557. Revision 1.44 1998/09/10 15:25:34 daniel
  558. + Added maxheapsize.
  559. * Corrected semi-bug in calling the assembler and the linker
  560. Revision 1.43 1998/09/09 15:33:06 peter
  561. * fixed in_global to allow directives also after interface token
  562. Revision 1.42 1998/09/04 08:41:59 peter
  563. * updated some error messages
  564. Revision 1.41 1998/09/01 12:53:24 peter
  565. + aktpackenum
  566. Revision 1.40 1998/09/01 07:54:19 pierre
  567. * UseBrowser a little updated (might still be buggy !!)
  568. * bug in psub.pas in function specifier removed
  569. * stdcall allowed in interface and in implementation
  570. (FPC will not yet complain if it is missing in either part
  571. because stdcall is only a dummy !!)
  572. Revision 1.39 1998/08/26 10:07:09 peter
  573. * dispose trees is now default for all > 0.99.5 compiles
  574. Revision 1.38 1998/08/18 20:52:20 peter
  575. * renamed in_main to in_global which is more logical
  576. Revision 1.37 1998/08/17 09:17:49 peter
  577. * static/shared linking updates
  578. Revision 1.36 1998/08/14 21:56:36 peter
  579. * setting the outputfile using -o works now to create static libs
  580. Revision 1.35 1998/08/12 19:22:09 peter
  581. * reset also the link* lists when recompiling an existing unit
  582. Revision 1.34 1998/08/10 23:58:56 peter
  583. * fixed asmlist dispose for 0.99.5
  584. Revision 1.33 1998/08/10 14:50:07 peter
  585. + localswitches, moduleswitches, globalswitches splitting
  586. Revision 1.32 1998/08/10 10:18:28 peter
  587. + Compiler,Comphook unit which are the new interface units to the
  588. compiler
  589. Revision 1.31 1998/07/14 21:46:46 peter
  590. * updated messages file
  591. Revision 1.30 1998/07/14 14:46:49 peter
  592. * released NEWINPUT
  593. Revision 1.29 1998/07/07 11:19:59 peter
  594. + NEWINPUT for a better inputfile and scanner object
  595. Revision 1.28 1998/06/25 11:15:33 pierre
  596. * ppu files where not closed in newppu !!
  597. second compilation was impossible due to too many opened files
  598. (not visible in 'make cycle' as we remove all the ppu files)
  599. Revision 1.27 1998/06/17 14:10:15 peter
  600. * small os2 fixes
  601. * fixed interdependent units with newppu (remake3 under linux works now)
  602. Revision 1.26 1998/06/16 08:56:23 peter
  603. + targetcpu
  604. * cleaner pmodules for newppu
  605. Revision 1.25 1998/06/15 15:38:07 pierre
  606. * small bug in systems.pas corrected
  607. + operators in different units better hanlded
  608. Revision 1.24 1998/06/13 00:10:08 peter
  609. * working browser and newppu
  610. * some small fixes against crashes which occured in bp7 (but not in
  611. fpc?!)
  612. Revision 1.23 1998/06/08 22:59:48 peter
  613. * smartlinking works for win32
  614. * some defines to exclude some compiler parts
  615. Revision 1.22 1998/06/05 17:47:28 peter
  616. * some better uses clauses
  617. Revision 1.21 1998/06/04 23:51:49 peter
  618. * m68k compiles
  619. + .def file creation moved to gendef.pas so it could also be used
  620. for win32
  621. Revision 1.20 1998/06/03 22:48:55 peter
  622. + wordbool,longbool
  623. * rename bis,von -> high,low
  624. * moved some systemunit loading/creating to psystem.pas
  625. Revision 1.19 1998/05/27 19:45:04 peter
  626. * symtable.pas splitted into includefiles
  627. * symtable adapted for $ifdef NEWPPU
  628. Revision 1.18 1998/05/23 01:21:15 peter
  629. + aktasmmode, aktoptprocessor, aktoutputformat
  630. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  631. + $LIBNAME to set the library name where the unit will be put in
  632. * splitted cgi386 a bit (codeseg to large for bp7)
  633. * nasm, tasm works again. nasm moved to ag386nsm.pas
  634. Revision 1.17 1998/05/20 09:42:34 pierre
  635. + UseTokenInfo now default
  636. * unit in interface uses and implementation uses gives error now
  637. * only one error for unknown symbol (uses lastsymknown boolean)
  638. the problem came from the label code !
  639. + first inlined procedures and function work
  640. (warning there might be allowed cases were the result is still wrong !!)
  641. * UseBrower updated gives a global list of all position of all used symbols
  642. with switch -gb
  643. Revision 1.16 1998/05/12 10:47:00 peter
  644. * moved printstatus to verb_def
  645. + V_Normal which is between V_Error and V_Warning and doesn't have a
  646. prefix like error: warning: and is included in V_Default
  647. * fixed some messages
  648. * first time parameter scan is only for -v and -T
  649. - removed old style messages
  650. Revision 1.15 1998/05/11 13:07:54 peter
  651. + $ifdef NEWPPU for the new ppuformat
  652. + $define GDB not longer required
  653. * removed all warnings and stripped some log comments
  654. * no findfirst/findnext anymore to remove smartlink *.o files
  655. Revision 1.14 1998/05/06 18:36:53 peter
  656. * tai_section extended with code,data,bss sections and enumerated type
  657. * ident 'compiled by FPC' moved to pmodules
  658. * small fix for smartlink
  659. Revision 1.13 1998/05/06 08:38:42 pierre
  660. * better position info with UseTokenInfo
  661. UseTokenInfo greatly simplified
  662. + added check for changed tree after first time firstpass
  663. (if we could remove all the cases were it happen
  664. we could skip all firstpass if firstpasscount > 1)
  665. Only with ExtDebug
  666. Revision 1.12 1998/05/04 17:54:28 peter
  667. + smartlinking works (only case jumptable left todo)
  668. * redesign of systems.pas to support assemblers and linkers
  669. + Unitname is now also in the PPU-file, increased version to 14
  670. Revision 1.11 1998/05/01 16:38:45 florian
  671. * handling of private and protected fixed
  672. + change_keywords_to_tp implemented to remove
  673. keywords which aren't supported by tp
  674. * break and continue are now symbols of the system unit
  675. + widestring, longstring and ansistring type released
  676. Revision 1.10 1998/05/01 07:43:56 florian
  677. + basics for rtti implemented
  678. + switch $m (generate rtti for published sections)
  679. Revision 1.9 1998/04/30 15:59:40 pierre
  680. * GDB works again better :
  681. correct type info in one pass
  682. + UseTokenInfo for better source position
  683. * fixed one remaining bug in scanner for line counts
  684. * several little fixes
  685. Revision 1.8 1998/04/29 10:33:55 pierre
  686. + added some code for ansistring (not complete nor working yet)
  687. * corrected operator overloading
  688. * corrected nasm output
  689. + started inline procedures
  690. + added starstarn : use ** for exponentiation (^ gave problems)
  691. + started UseTokenInfo cond to get accurate positions
  692. Revision 1.7 1998/04/27 23:10:28 peter
  693. + new scanner
  694. * $makelib -> if smartlink
  695. * small filename fixes pmodule.setfilename
  696. * moved import from files.pas -> import.pas
  697. Revision 1.6 1998/04/21 10:16:48 peter
  698. * patches from strasbourg
  699. * objects is not used anymore in the fpc compiled version
  700. Revision 1.5 1998/04/10 14:41:43 peter
  701. * removed some Hints
  702. * small speed optimization for AsmLn
  703. Revision 1.4 1998/04/08 16:58:03 pierre
  704. * several bugfixes
  705. ADD ADC and AND are also sign extended
  706. nasm output OK (program still crashes at end
  707. and creates wrong assembler files !!)
  708. procsym types sym in tdef removed !!
  709. Revision 1.3 1998/04/07 22:45:04 florian
  710. * bug0092, bug0115 and bug0121 fixed
  711. + packed object/class/array
  712. }