parser.pas 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  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. interface
  23. procedure compile(const filename:string;compile_system:boolean);
  24. procedure initparser;
  25. implementation
  26. uses
  27. dos,objects,cobjects,globals,scanner,systems,symtable,tree,aasm,
  28. types,strings,pass_1,hcodegen,files,verbose,script,import
  29. {$ifdef i386}
  30. ,i386
  31. ,cgi386
  32. ,cgai386
  33. ,tgeni386
  34. ,aopt386
  35. {$endif i386}
  36. {$ifdef m68k}
  37. ,m68k
  38. ,cg68k
  39. ,tgen68k
  40. ,cga68k
  41. {$endif m68k}
  42. { parser units }
  43. ,pbase,pmodules,pdecl,
  44. { assembling & linking }
  45. assemble,
  46. link;
  47. { dummy variable for search when calling exec }
  48. var
  49. file_found : boolean;
  50. procedure readconstdefs;
  51. begin
  52. s32bitdef:=porddef(globaldef('longint'));
  53. u32bitdef:=porddef(globaldef('ulong'));
  54. cstringdef:=pstringdef(globaldef('string'));
  55. {$ifdef UseLongString}
  56. clongstringdef:=pstringdef(globaldef('longstring'));
  57. {$endif UseLongString}
  58. {$ifdef UseAnsiString}
  59. cansistringdef:=pstringdef(globaldef('ansistring'));
  60. {$endif UseAnsiString}
  61. cchardef:=porddef(globaldef('char'));
  62. {$ifdef i386}
  63. c64floatdef:=pfloatdef(globaldef('s64real'));
  64. {$endif}
  65. {$ifdef m68k}
  66. c64floatdef:=pfloatdef(globaldef('s32real'));
  67. {$endif m68k}
  68. s80floatdef:=pfloatdef(globaldef('s80real'));
  69. s32fixeddef:=pfloatdef(globaldef('cs32fixed'));
  70. voiddef:=porddef(globaldef('void'));
  71. u8bitdef:=porddef(globaldef('byte'));
  72. u16bitdef:=porddef(globaldef('word'));
  73. booldef:=porddef(globaldef('boolean'));
  74. voidpointerdef:=ppointerdef(globaldef('void_pointer'));
  75. cfiledef:=pfiledef(globaldef('file'));
  76. end;
  77. procedure initparser;
  78. begin
  79. forwardsallowed:=false;
  80. { ^M means a string or a char, because we don't parse a }
  81. { type declaration }
  82. block_type:=bt_general;
  83. ignore_equal:=false;
  84. { we didn't parse a object or class declaration }
  85. { and no function header }
  86. testcurobject:=0;
  87. { create error defintion }
  88. generrordef:=new(perrordef,init);
  89. symtablestack:=nil;
  90. { a long time, this was forgotten }
  91. aktprocsym:=nil;
  92. current_module:=nil;
  93. loaded_units.init;
  94. usedunits.init;
  95. end;
  96. { moved out to save stack }
  97. var
  98. addparam : string;
  99. procedure compile(const filename:string;compile_system:boolean);
  100. var
  101. hp : pmodule;
  102. comp_unit : boolean;
  103. { some variables to save the compiler state }
  104. oldtoken : ttoken;
  105. oldpattern : stringid;
  106. oldpreprocstack : ppreprocstack;
  107. oldorgpattern,oldprocprefix : string;
  108. old_block_type : tblock_type;
  109. oldinputbuffer : pchar;
  110. oldinputpointer : longint;
  111. olds_point,oldparse_only : boolean;
  112. oldc : char;
  113. oldcomment_level : word;
  114. oldimports,oldexports,oldresource,
  115. oldbsssegment,olddatasegment,oldcodesegment,
  116. oldexprasmlist,olddebuglist,
  117. oldinternals,oldexternals,oldconsts : paasmoutput;
  118. oldnextlabelnr : longint;
  119. oldswitches : Tcswitches;
  120. oldmacros,oldrefsymtable,oldsymtablestack : psymtable;
  121. procedure def_macro(const s : string);
  122. var
  123. mac : pmacrosym;
  124. begin
  125. mac:=pmacrosym(macros^.search(s));
  126. if mac=nil then
  127. begin
  128. mac:=new(pmacrosym,init(s));
  129. Message1(parser_m_macro_defined,mac^.name);
  130. macros^.insert(mac);
  131. end;
  132. mac^.defined:=true;
  133. end;
  134. procedure set_macro(const s : string;value : string);
  135. var
  136. mac : pmacrosym;
  137. begin
  138. mac:=pmacrosym(macros^.search(s));
  139. if mac=nil then
  140. begin
  141. mac:=new(pmacrosym,init(s));
  142. macros^.insert(mac);
  143. end
  144. else
  145. begin
  146. if assigned(mac^.buftext) then
  147. freemem(mac^.buftext,mac^.buflen);
  148. end;
  149. Message2(parser_m_macro_set_to,mac^.name,value);
  150. mac^.buflen:=length(value);
  151. getmem(mac^.buftext,mac^.buflen);
  152. move(value[1],mac^.buftext^,mac^.buflen);
  153. mac^.defined:=true;
  154. end;
  155. procedure define_macros;
  156. var
  157. hp : pstring_item;
  158. begin
  159. hp:=pstring_item(commandlinedefines.first);
  160. while assigned(hp) do
  161. begin
  162. def_macro(hp^.str^);
  163. hp:=pstring_item(hp^.next);
  164. end;
  165. { set macros for version checking }
  166. set_macro('FPC_VERSION',version_nr);
  167. set_macro('FPC_RELEASE',release_nr);
  168. set_macro('FPC_PATCH',patch_nr);
  169. end;
  170. var
  171. a : PAsmFile;
  172. label
  173. done;
  174. begin {compile}
  175. inc(compile_level);
  176. { save old state }
  177. { save symtable state }
  178. oldsymtablestack:=symtablestack;
  179. symtablestack:=nil;
  180. oldrefsymtable:=refsymtable;
  181. refsymtable:=nil;
  182. oldprocprefix:=procprefix;
  183. { a long time, this was only in init_parser
  184. but it should be reset to zero for each module }
  185. aktprocsym:=nil;
  186. { first, we assume a program }
  187. if not(assigned(current_module)) then
  188. begin
  189. {!!!}
  190. current_module:=new(pmodule,init(filename,false));
  191. main_module:=current_module;
  192. end;
  193. { reset flags }
  194. current_module^.flags:=0;
  195. { ... and crc }
  196. current_module^.crc:=0;
  197. { save scanner state }
  198. oldmacros:=macros;
  199. oldpattern:=pattern;
  200. oldtoken:=token;
  201. oldorgpattern:=orgpattern;
  202. old_block_type:=block_type;
  203. oldpreprocstack:=preprocstack;
  204. oldinputbuffer:=inputbuffer;
  205. oldinputpointer:=inputpointer;
  206. olds_point:=s_point;
  207. oldc:=c;
  208. oldcomment_level:=comment_level;
  209. oldparse_only:=parse_only;
  210. { save assembler lists }
  211. olddatasegment:=datasegment;
  212. oldbsssegment:=bsssegment;
  213. oldcodesegment:=codesegment;
  214. olddebuglist:=debuglist;
  215. oldexternals:=externals;
  216. oldinternals:=internals;
  217. oldconsts:=consts;
  218. oldexprasmlist:=exprasmlist;
  219. oldimports:=importssection;
  220. oldexports:=exportssection;
  221. oldresource:=resourcesection;
  222. oldswitches:=aktswitches;
  223. oldnextlabelnr:=nextlabelnr;
  224. Message1(parser_i_compiling,filename);
  225. InitScanner(filename);
  226. aktswitches:=initswitches;
  227. { we need this to make the system unit }
  228. if compile_system then
  229. aktswitches:=aktswitches+[cs_compilesystem];
  230. aktpackrecords:=initpackrecords;
  231. { init code generator for a new module }
  232. codegen_newmodule;
  233. macros:=new(psymtable,init(macrosymtable));
  234. define_macros;
  235. { startup scanner }
  236. token:=yylex;
  237. { init asm writing }
  238. datasegment:=new(paasmoutput,init);
  239. codesegment:=new(paasmoutput,init);
  240. bsssegment:=new(paasmoutput,init);
  241. debuglist:=new(paasmoutput,init);
  242. externals:=new(paasmoutput,init);
  243. internals:=new(paasmoutput,init);
  244. consts:=new(paasmoutput,init);
  245. importssection:=nil;
  246. exportssection:=nil;
  247. resourcesection:=nil;
  248. { global switches are read, so further changes aren't allowed }
  249. current_module^.in_main:=true;
  250. { open assembler response }
  251. if (compile_level=1) then
  252. AsmRes.Init('ppas');
  253. { if the current file isn't a system unit }
  254. { the the system unit will be loaded }
  255. if not(cs_compilesystem in aktswitches) then
  256. begin
  257. { should be done in unit system (changing the field system_unit)
  258. FK
  259. }
  260. hp:=loadunit(upper(target_info.system_unit),true,true);
  261. systemunit:=hp^.symtable;
  262. readconstdefs;
  263. { we could try to overload caret by default }
  264. symtablestack:=systemunit;
  265. { if POWER is defined in the RTL then use it for caret overloading }
  266. getsym('POWER',false);
  267. if assigned(srsym) and (srsym^.typ=procsym) and
  268. (overloaded_operators[CARET]=nil) then
  269. overloaded_operators[CARET]:=pprocsym(srsym);
  270. end
  271. else
  272. begin
  273. { create definitions for constants }
  274. registerdef:=false;
  275. s32bitdef:=new(porddef,init(s32bit,$80000000,$7fffffff));
  276. u32bitdef:=new(porddef,init(u32bit,0,$ffffffff));
  277. cstringdef:=new(pstringdef,init(255));
  278. { should we give a length to the default long and ansi string definition ?? }
  279. {$ifdef UseLongString}
  280. clongstringdef:=new(pstringdef,longinit(-1));
  281. {$endif UseLongString}
  282. {$ifdef UseAnsiString}
  283. cansistringdef:=new(pstringdef,ansiinit(-1));
  284. {$endif UseAnsiString}
  285. cchardef:=new(porddef,init(uchar,0,255));
  286. {$ifdef i386}
  287. c64floatdef:=new(pfloatdef,init(s64real));
  288. s80floatdef:=new(pfloatdef,init(s80real));
  289. {$endif}
  290. {$ifdef m68k}
  291. c64floatdef:=new(pfloatdef,init(s32real));
  292. if (cs_fp_emulation in aktswitches) then
  293. s80floatdef:=new(pfloatdef,init(s32real))
  294. else
  295. s80floatdef:=new(pfloatdef,init(s80real));
  296. {$endif}
  297. s32fixeddef:=new(pfloatdef,init(f32bit));
  298. { some other definitions }
  299. voiddef:=new(porddef,init(uvoid,0,0));
  300. u8bitdef:=new(porddef,init(u8bit,0,255));
  301. u16bitdef:=new(porddef,init(u16bit,0,65535));
  302. booldef:=new(porddef,init(bool8bit,0,1));
  303. voidpointerdef:=new(ppointerdef,init(voiddef));
  304. cfiledef:=new(pfiledef,init(ft_untyped,nil));
  305. systemunit:=nil;
  306. end;
  307. registerdef:=true;
  308. { current return type is void }
  309. procinfo.retdef:=voiddef;
  310. { reset lexical level }
  311. lexlevel:=0;
  312. { parse source }
  313. {***BUGFIX}
  314. if (token=_UNIT) or (compile_level>1) then
  315. begin
  316. {If the compile level > 1 we get a nice "unit expected" error
  317. message if we are trying to use a program as unit.}
  318. proc_unit;
  319. if current_module^.compiled then
  320. goto done;
  321. comp_unit:=true;
  322. end
  323. else
  324. begin
  325. proc_program(token=_LIBRARY);
  326. comp_unit:=false;
  327. end;
  328. { Why? The definition of Pascal requires that everything
  329. after 'end.' is ignored!
  330. if not(cs_tp_compatible in aktswitches) then
  331. consume(_EOF); }
  332. if errorcount=0 then
  333. begin
  334. if current_module^.uses_imports then
  335. importlib^.generatelib;
  336. a:=new(PAsmFile,Init(filename));
  337. a^.WriteAsmSource;
  338. a^.DoAssemble;
  339. dispose(a,Done);
  340. { Check linking => we are at first level in compile }
  341. if (compile_level=1) then
  342. begin
  343. if Linker.ExeName='' then
  344. Linker.SetFileName(FileName);
  345. if (comp_unit) then
  346. begin
  347. Linker.Make_Library;
  348. end
  349. else
  350. begin
  351. if (cs_no_linking in initswitches) then
  352. externlink:=true;
  353. Linker.Link;
  354. end;
  355. end;
  356. end
  357. else
  358. begin
  359. Message1(unit_e_total_errors,tostr(errorcount));
  360. Message(unit_f_errors_in_unit);
  361. end;
  362. { clear memory }
  363. {$ifdef Splitheap}
  364. if testsplit then
  365. begin
  366. { temp heap should be empty after that !!!}
  367. codegen_donemodule;
  368. Releasetempheap;
  369. end;
  370. {else
  371. codegen_donemodule;}
  372. {$endif Splitheap}
  373. { restore old state }
  374. { if already compiled jumps directly here }
  375. done:
  376. { close trees }
  377. if dispose_asm_lists then
  378. begin
  379. dispose(datasegment,Done);
  380. dispose(codesegment,Done);
  381. dispose(bsssegment,Done);
  382. dispose(debuglist,Done);
  383. dispose(externals,Done);
  384. dispose(internals,Done);
  385. dispose(consts,Done);
  386. end;
  387. { restore symtable state }
  388. {$ifdef UseBrowser}
  389. if (compile_level>1) then
  390. { we want to keep the current symtablestack }
  391. {$endif UseBrowser}
  392. begin
  393. refsymtable:=oldrefsymtable;
  394. symtablestack:=oldsymtablestack;
  395. end;
  396. procprefix:=oldprocprefix;
  397. { close the inputfiles }
  398. {$ifndef UseBrowser}
  399. { but not if we want the names for the browser ! }
  400. current_module^.sourcefiles.done;
  401. {$endif not UseBrowser}
  402. { restore scanner state }
  403. pattern:=oldpattern;
  404. token:=oldtoken;
  405. orgpattern:=oldorgpattern;
  406. block_type:=old_block_type;
  407. { call donescanner before restoring preprocstack, because }
  408. { donescanner tests for a empty preprocstack }
  409. { and can also check for unused macros }
  410. donescanner(current_module^.compiled);
  411. dispose(macros,done);
  412. macros:=oldmacros;
  413. preprocstack:=oldpreprocstack;
  414. aktswitches:=oldswitches;
  415. inputbuffer:=oldinputbuffer;
  416. inputpointer:=oldinputpointer;
  417. s_point:=olds_point;
  418. c:=oldc;
  419. comment_level:=oldcomment_level;
  420. parse_only:=oldparse_only;
  421. { restore asmlists }
  422. datasegment:=olddatasegment;
  423. bsssegment:=oldbsssegment;
  424. codesegment:=oldcodesegment;
  425. debuglist:=olddebuglist;
  426. externals:=oldexternals;
  427. internals:=oldinternals;
  428. importssection:=oldimports;
  429. exportssection:=oldexports;
  430. resourcesection:=oldresource;
  431. nextlabelnr:=oldnextlabelnr;
  432. exprasmlist:=oldexprasmlist;
  433. consts:=oldconsts;
  434. nextlabelnr:=oldnextlabelnr;
  435. reset_gdb_info;
  436. if (compile_level=1) then
  437. begin
  438. if (not AsmRes.Empty) then
  439. begin
  440. Message1(exec_i_closing_script,AsmRes.Fn);
  441. AsmRes.WriteToDisk;
  442. end;
  443. end;
  444. dec(compile_level);
  445. end;
  446. end.
  447. {
  448. $Log$
  449. Revision 1.5 1998-04-10 14:41:43 peter
  450. * removed some Hints
  451. * small speed optimization for AsmLn
  452. Revision 1.4 1998/04/08 16:58:03 pierre
  453. * several bugfixes
  454. ADD ADC and AND are also sign extended
  455. nasm output OK (program still crashes at end
  456. and creates wrong assembler files !!)
  457. procsym types sym in tdef removed !!
  458. Revision 1.3 1998/04/07 22:45:04 florian
  459. * bug0092, bug0115 and bug0121 fixed
  460. + packed object/class/array
  461. Revision 1.2 1998/03/26 11:18:30 florian
  462. - switch -Sa removed
  463. - support of a:=b:=0 removed
  464. Revision 1.1.1.1 1998/03/25 11:18:12 root
  465. * Restored version
  466. Revision 1.60 1998/03/24 21:48:32 florian
  467. * just a couple of fixes applied:
  468. - problem with fixed16 solved
  469. - internalerror 10005 problem fixed
  470. - patch for assembler reading
  471. - small optimizer fix
  472. - mem is now supported
  473. Revision 1.59 1998/03/20 23:31:33 florian
  474. * bug0113 fixed
  475. * problem with interdepened units fixed ("options.pas problem")
  476. * two small extensions for future AMD 3D support
  477. Revision 1.58 1998/03/13 22:45:58 florian
  478. * small bug fixes applied
  479. Revision 1.57 1998/03/10 17:19:29 peter
  480. * fixed bug0108
  481. * better linebreak scanning (concentrated in nextchar(), it supports
  482. #10, #13, #10#13, #13#10
  483. Revision 1.56 1998/03/10 16:27:40 pierre
  484. * better line info in stabs debug
  485. * symtabletype and lexlevel separated into two fields of tsymtable
  486. + ifdef MAKELIB for direct library output, not complete
  487. + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
  488. working
  489. + ifdef TESTFUNCRET for setting func result in underfunction, not
  490. working
  491. Revision 1.55 1998/03/10 12:54:06 peter
  492. * def_symbol renamed to def_macro and use it in defines_macros
  493. Revision 1.54 1998/03/10 01:17:22 peter
  494. * all files have the same header
  495. * messages are fully implemented, EXTDEBUG uses Comment()
  496. + AG... files for the Assembler generation
  497. Revision 1.53 1998/03/06 00:52:34 peter
  498. * replaced all old messages from errore.msg, only ExtDebug and some
  499. Comment() calls are left
  500. * fixed options.pas
  501. Revision 1.52 1998/03/02 16:00:37 peter
  502. * -Ch works again
  503. Revision 1.51 1998/03/02 13:38:44 peter
  504. + importlib object
  505. * doesn't crash on a systemunit anymore
  506. * updated makefile and depend
  507. Revision 1.49 1998/02/28 00:20:31 florian
  508. * more changes to get import libs for Win32 working
  509. Revision 1.48 1998/02/27 22:27:56 florian
  510. + win_targ unit
  511. + support of sections
  512. + new asmlists: sections, exports and resource
  513. Revision 1.47 1998/02/24 10:29:17 peter
  514. * -a works again
  515. Revision 1.46 1998/02/24 00:19:14 peter
  516. * makefile works again (btw. linux does like any char after a \ )
  517. * removed circular unit with assemble and files
  518. * fixed a sigsegv in pexpr
  519. * pmodule init unit/program is the almost the same, merged them
  520. Revision 1.45 1998/02/22 23:03:25 peter
  521. * renamed msource->mainsource and name->unitname
  522. * optimized filename handling, filename is not seperate anymore with
  523. path+name+ext, this saves stackspace and a lot of fsplit()'s
  524. * recompiling of some units in libraries fixed
  525. * shared libraries are working again
  526. + $LINKLIB <lib> to support automatic linking to libraries
  527. + libraries are saved/read from the ppufile, also allows more libraries
  528. per ppufile
  529. Revision 1.44 1998/02/19 00:11:04 peter
  530. * fixed -g to work again
  531. * fixed some typos with the scriptobject
  532. Revision 1.43 1998/02/18 13:48:12 michael
  533. + Implemented an OS independent AsmRes object.
  534. Revision 1.42 1998/02/17 21:20:54 peter
  535. + Script unit
  536. + __EXIT is called again to exit a program
  537. - target_info.link/assembler calls
  538. * linking works again for dos
  539. * optimized a few filehandling functions
  540. * fixed stabs generation for procedures
  541. Revision 1.41 1998/02/16 12:51:35 michael
  542. + Implemented linker object
  543. Revision 1.40 1998/02/15 21:16:25 peter
  544. * all assembler outputs supported by assemblerobject
  545. * cleanup with assembleroutputs, better .ascii generation
  546. * help_constructor/destructor are now added to the externals
  547. - generation of asmresponse is not outputformat depended
  548. Revision 1.39 1998/02/14 01:45:26 peter
  549. * more fixes
  550. - pmode target is removed
  551. - search_as_ld is removed, this is done in the link.pas/assemble.pas
  552. + findexe() to search for an executable (linker,assembler,binder)
  553. Revision 1.38 1998/02/13 22:26:33 peter
  554. * fixed a few SigSegv's
  555. * INIT$$ was not written for linux!
  556. * assembling and linking works again for linux and dos
  557. + assembler object, only attasmi3 supported yet
  558. * restore pp.pas with AddPath etc.
  559. Revision 1.37 1998/02/13 10:35:17 daniel
  560. * Made Motorola version compilable.
  561. * Fixed optimizer
  562. Revision 1.36 1998/02/12 17:19:12 florian
  563. * fixed to get remake3 work, but needs additional fixes (output, I don't like
  564. also that aktswitches isn't a pointer)
  565. Revision 1.35 1998/02/12 11:50:16 daniel
  566. Yes! Finally! After three retries, my patch!
  567. Changes:
  568. Complete rewrite of psub.pas.
  569. Added support for DLL's.
  570. Compiler requires less memory.
  571. Platform units for each platform.
  572. Revision 1.34 1998/02/02 11:47:36 pierre
  573. + compilation stops at unit with error
  574. Revision 1.33 1998/02/01 22:41:08 florian
  575. * clean up
  576. + system.assigned([class])
  577. + system.assigned([class of xxxx])
  578. * first fixes of as and is-operator
  579. Revision 1.32 1998/01/30 17:31:23 pierre
  580. * bug of cyclic symtablestack fixed
  581. Revision 1.31 1998/01/29 12:13:21 michael
  582. * fixed Typos for library making
  583. Revision 1.30 1998/01/28 13:48:45 michael
  584. + Initial implementation for making libs from within FPC. Not tested, as compiler does not run
  585. Revision 1.29 1998/01/25 18:45:47 peter
  586. + Search for as and ld at startup
  587. + source_info works the same as target_info
  588. + externlink allows only external linking
  589. Revision 1.28 1998/01/23 21:14:59 carl
  590. * RunError 105 (file not open) with -Agas switch fix
  591. Revision 1.27 1998/01/23 17:55:11 michael
  592. + Moved linking stage to it's own unit (link.pas)
  593. Incorporated Pierres changes, but removed -E switch
  594. switch for not linking is now -Cn instead of -E
  595. Revision 1.26 1998/01/23 17:12:15 pierre
  596. * added some improvements for as and ld :
  597. - doserror and dosexitcode treated separately
  598. - PATH searched if doserror=2
  599. + start of long and ansi string (far from complete)
  600. in conditionnal UseLongString and UseAnsiString
  601. * options.pas cleaned (some variables shifted to globals)gl
  602. Revision 1.25 1998/01/22 14:47:16 michael
  603. + Reinstated linker options as -k option. How did they dissapear ?
  604. Revision 1.24 1998/01/17 01:57:36 michael
  605. + Start of shared library support. First working version.
  606. Revision 1.23 1998/01/16 22:34:37 michael
  607. * Changed 'conversation' to 'conversion'. Waayyy too much chatting going on
  608. in this compiler :)
  609. Revision 1.22 1998/01/14 12:52:04 michael
  610. - Removed the 'Assembled' line and replaced 'Calling Linker/assembler...'
  611. with 'Assembling/linking...'. Too much verbosity when V_info is on.
  612. Revision 1.21 1998/01/13 16:15:56 pierre
  613. * bug in interdependent units handling
  614. - primary unit was not in loaded_units list
  615. - current_module^.symtable was assigned too early
  616. - donescanner must not call error if the compilation
  617. of the unit was done at a higher level.
  618. Revision 1.20 1998/01/11 10:54:22 florian
  619. + generic library support
  620. Revision 1.19 1998/01/11 04:17:11 carl
  621. + correct heap and memory variables for m68k targets
  622. Revision 1.18 1998/01/08 23:56:39 florian
  623. * parser unit divided into several smaller units
  624. Revision 1.17 1998/01/08 17:10:12 florian
  625. * the name of the initialization part of a unit was sometimes written
  626. in lower case
  627. Revision 1.16 1998/01/07 00:16:56 michael
  628. Restored released version (plus fixes) as current
  629. Revision 1.13 1997/12/14 22:43:21 florian
  630. + command line switch -Xs for DOS (passes -s to the linker to strip symbols from
  631. executable)
  632. * some changes of Carl-Eric implemented
  633. Revision 1.12 1997/12/12 13:28:31 florian
  634. + version 0.99.0
  635. * all WASM options changed into MASM
  636. + -O2 for Pentium II optimizations
  637. Revision 1.11 1997/12/10 23:07:21 florian
  638. * bugs fixed: 12,38 (also m68k),39,40,41
  639. + warning if a system unit is without -Us compiled
  640. + warning if a method is virtual and private (was an error)
  641. * some indentions changed
  642. + factor does a better error recovering (omit some crashes)
  643. + problem with @type(x) removed (crashed the compiler)
  644. Revision 1.10 1997/12/09 13:50:36 carl
  645. * bugfix of possible alignment problems with m68k
  646. * bugfix of circular unit use -- could still give a stack overflow,
  647. so changed to fatalerror instead.
  648. * bugfix of nil procedural variables, fpc = @nil is illogical!
  649. (if was reversed!)
  650. Revision 1.9 1997/12/08 13:31:31 daniel
  651. * File was in DOS format. Translated to Unix.
  652. Revision 1.8 1997/12/08 10:01:08 pierre
  653. * nil for a procvar const was not allowed (os2_targ.pas not compilable)
  654. * bug in loadunit for units in implementation part already loaded
  655. (crashed on dos_targ.pas, thanks to Daniel who permitted me
  656. to find this bug out)
  657. Revision 1.7 1997/12/04 17:47:50 carl
  658. + renamed m68k units and refs to these units according to cpu rules.
  659. Revision 1.6 1997/12/02 15:56:13 carl
  660. * bugfix of postfixoperator with pd =nil
  661. * bugfix of motorola instructions types for exit code.
  662. Revision 1.5 1997/12/01 18:14:33 pierre
  663. * fixes a bug in nasm output due to my previous changes
  664. Revision 1.3 1997/11/28 18:14:40 pierre
  665. working version with several bug fixes
  666. Revision 1.2 1997/11/27 17:59:46 carl
  667. * made it compile under BP (line too long errors)
  668. Revision 1.1.1.1 1997/11/27 08:32:57 michael
  669. FPC Compiler CVS start
  670. Pre-CVS log:
  671. CEC Carl-Eric Codere
  672. FK Florian Klaempfl
  673. PM Pierre Muller
  674. + feature added
  675. - removed
  676. * bug fixed or changed
  677. History (started with version 0.9.0):
  678. 5th november 1996:
  679. * adapted to 0.9.0
  680. 25th november 1996:
  681. * more stuff adapted
  682. 9th december 1996:
  683. + support for different inline assemblers added (FK)
  684. 22th september:
  685. + support for PACKED RECORD implemented (FK)
  686. 24th september:
  687. + internal support of system.seg added (FK)
  688. * system.ofs bug fixed (FK)
  689. * problem with compiler switches solved (see also pass_1.pas) (FK)
  690. * all aktswitch memory is now recoverd (see also scanner.pas) (FK)
  691. 24th september 1997:
  692. * bug in ESI offset, pushed only if not nested, changed in cgi386.pas in v93 by (FK)
  693. but forgotten here (PM)
  694. 25th september:
  695. + parsing of open arrays implemented (FK)
  696. + parsing of high and low implemented (FK)
  697. + open array support also for proc vars added (FK)
  698. 1th october:
  699. * in typed constants is now the conversion int -> real
  700. automatically done (FK)
  701. 3rd october 1997:
  702. + started conversion to motorola 68000 - ifdef m68k to find
  703. changes (this makes the code look horrible, may later separate
  704. in includes?) - look for all ifdef i386 and ifdef m68k to see
  705. changes. (CEC)
  706. - commented out regnames (was unused) (CEC)
  707. + peepholeopt put in i386 define (not yet available for motorola
  708. 68000) (CEC)
  709. + i386 defines around a_att, in a_o and around a_wasm, a_nasm (CEC).
  710. + code for in_ord_x (PM)
  711. 4th october 1997:
  712. + checking for double definitions of function/procedure
  713. with same parameters in interface (PM)
  714. + enums with jumps set the boolean has_jumps and
  715. disable the succ and pred use (PM)
  716. 9th october 1997:
  717. * Fixed problem with 80float on the 68000 output, caused a GPF (CEC).
  718. 13th october 1997:
  719. + Added support for Motorola Standard assembler. (CEC)
  720. 15th october 1997:
  721. + added code for static modifier for objects variables and methods
  722. controlled by -St switch at command line (PM)
  723. 17th october 1997:
  724. + Added support for Motorola inline assembler (CEC)
  725. * Bugfix with .align 4,0x90, this is NOT allowed in TASM/MASM/WASM (CEC).
  726. + procedure set_macro and setting of fpc_* macros (FK)
  727. 19th october 1997:
  728. * Bugfix of RTS on 68000 target. PC Counter would become corrupt
  729. with paramsize (CEC).
  730. 23th october 1997:
  731. * Small bugfixes concerning SUBI #const,address_reg (CEC).
  732. 24th october 1997:
  733. * array[boolean] works now (FK)
  734. 25th october 1997:
  735. + CDECL and STDCALL (FK)
  736. * ASSEMBLER isn't a keyword anymore (FK)
  737. 3rd november 1997:
  738. + added symdif for sets (PM)
  739. 5th november 1997:
  740. * changed all while token<>ATOKEN do consume(token);
  741. by a procedure call consume_all_untill(ATOKEN)
  742. to test for _EOF (PM)
  743. * aktobjectname was not reset to '' at the end of objectcomponenten (PM)
  744. 14th november 1997:
  745. * removed bug for procvar where the type was not allways set correctly (PM)
  746. + integer const not in longint range converted to real constant (PM)
  747. 25th november 1997:
  748. * removed bugs due to wrong current_module references in compile procedure (PM)
  749. }