parser.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 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. unit parser;
  19. {$i fpcdefs.inc}
  20. interface
  21. {$ifdef PREPROCWRITE}
  22. procedure preprocess(const filename:string);
  23. {$endif PREPROCWRITE}
  24. procedure compile(const filename:string);
  25. procedure initparser;
  26. procedure doneparser;
  27. implementation
  28. uses
  29. cutils,cclasses,
  30. globtype,version,tokens,systems,globals,verbose,
  31. symbase,symtable,symdef,symsym,
  32. finput,fmodule,fppu,
  33. aasmbase,aasmtai,
  34. cpubase,cgbase,
  35. script,gendef,
  36. {$ifdef BrowserLog}
  37. browlog,
  38. {$endif BrowserLog}
  39. {$ifdef UseExcept}
  40. tpexcept,
  41. {$endif UseExcept}
  42. {$ifdef GDB}
  43. gdb,
  44. {$endif GDB}
  45. comphook,
  46. scanner,scandir,
  47. pbase,ptype,psystem,pmodules,psub,cresstr,cpuinfo;
  48. procedure initparser;
  49. begin
  50. { ^M means a string or a char, because we don't parse a }
  51. { type declaration }
  52. ignore_equal:=false;
  53. { we didn't parse a object or class declaration }
  54. { and no function header }
  55. testcurobject:=0;
  56. { Symtable }
  57. current_procdef:=nil;
  58. objectlibrary:=nil;
  59. current_module:=nil;
  60. compiled_module:=nil;
  61. current_procinfo:=nil;
  62. loaded_units:=TLinkedList.Create;
  63. usedunits:=TLinkedList.Create;
  64. { global switches }
  65. aktglobalswitches:=initglobalswitches;
  66. aktsourcecodepage:=initsourcecodepage;
  67. { initialize scanner }
  68. InitScanner;
  69. InitScannerDirectives;
  70. { scanner }
  71. c:=#0;
  72. pattern:='';
  73. orgpattern:='';
  74. current_scanner:=nil;
  75. { register all nodes and tais }
  76. registernodes;
  77. registertais;
  78. { memory sizes }
  79. if heapsize=0 then
  80. heapsize:=target_info.heapsize;
  81. if stacksize=0 then
  82. stacksize:=target_info.stacksize;
  83. { open assembler response }
  84. GenerateAsmRes(outputexedir+'ppas');
  85. { open deffile }
  86. DefFile:=TDefFile.Create(outputexedir+inputfile+target_info.defext);
  87. { list of generated .o files, so the linker can remove them }
  88. SmartLinkOFiles:=TStringList.Create;
  89. { codegen }
  90. if paraprintnodetree<>0 then
  91. printnode_reset;
  92. end;
  93. procedure doneparser;
  94. begin
  95. { unload units }
  96. loaded_units.free;
  97. usedunits.free;
  98. { if there was an error in the scanner, the scanner is
  99. still assinged }
  100. if assigned(current_scanner) then
  101. begin
  102. current_scanner.free;
  103. current_scanner:=nil;
  104. end;
  105. { close scanner }
  106. DoneScanner;
  107. { close ppas,deffile }
  108. asmres.free;
  109. deffile.free;
  110. { free list of .o files }
  111. SmartLinkOFiles.Free;
  112. end;
  113. procedure default_macros;
  114. var
  115. hp : tstringlistitem;
  116. begin
  117. { commandline }
  118. hp:=tstringlistitem(initdefines.first);
  119. while assigned(hp) do
  120. begin
  121. current_scanner.def_macro(hp.str);
  122. hp:=tstringlistitem(hp.next);
  123. end;
  124. { set macros for version checking }
  125. current_scanner.set_macro('FPC_VERSION',version_nr);
  126. current_scanner.set_macro('FPC_RELEASE',release_nr);
  127. current_scanner.set_macro('FPC_PATCH',patch_nr);
  128. end;
  129. {$ifdef PREPROCWRITE}
  130. procedure preprocess(const filename:string);
  131. var
  132. i : longint;
  133. begin
  134. new(preprocfile,init('pre'));
  135. { default macros }
  136. current_scanner^.macros:=new(pdictionary,init);
  137. default_macros;
  138. { initialize a module }
  139. current_module:=new(pmodule,init(filename,false));
  140. main_module:=current_module;
  141. { startup scanner, and save in current_module }
  142. current_scanner:=new(pscannerfile,Init(filename));
  143. current_module.scanner:=current_scanner;
  144. { loop until EOF is found }
  145. repeat
  146. current_scanner^.readtoken;
  147. preprocfile^.AddSpace;
  148. case token of
  149. _ID :
  150. begin
  151. preprocfile^.Add(orgpattern);
  152. end;
  153. _REALNUMBER,
  154. _INTCONST :
  155. preprocfile^.Add(pattern);
  156. _CSTRING :
  157. begin
  158. i:=0;
  159. while (i<length(pattern)) do
  160. begin
  161. inc(i);
  162. if pattern[i]='''' then
  163. begin
  164. insert('''',pattern,i);
  165. inc(i);
  166. end;
  167. end;
  168. preprocfile^.Add(''''+pattern+'''');
  169. end;
  170. _CCHAR :
  171. begin
  172. case pattern[1] of
  173. #39 :
  174. pattern:='''''''';
  175. #0..#31,
  176. #128..#255 :
  177. begin
  178. str(ord(pattern[1]),pattern);
  179. pattern:='#'+pattern;
  180. end;
  181. else
  182. pattern:=''''+pattern[1]+'''';
  183. end;
  184. preprocfile^.Add(pattern);
  185. end;
  186. _EOF :
  187. break;
  188. else
  189. preprocfile^.Add(tokeninfo^[token].str)
  190. end;
  191. until false;
  192. { free scanner }
  193. dispose(current_scanner,done);
  194. current_scanner:=nil;
  195. { close }
  196. dispose(preprocfile,done);
  197. end;
  198. {$endif PREPROCWRITE}
  199. procedure compile(const filename:string);
  200. type
  201. polddata=^tolddata;
  202. tolddata=record
  203. { scanner }
  204. oldidtoken,
  205. oldtoken : ttoken;
  206. oldtokenpos : tfileposinfo;
  207. oldc : char;
  208. oldpattern,
  209. oldorgpattern : string;
  210. old_block_type : tblock_type;
  211. { symtable }
  212. oldrefsymtable,
  213. olddefaultsymtablestack,
  214. oldsymtablestack : tsymtable;
  215. oldaktprocsym : tprocsym;
  216. oldcurrent_procdef : tprocdef;
  217. oldoverloaded_operators : toverloaded_operators;
  218. { cg }
  219. oldparse_only : boolean;
  220. { asmlists }
  221. oldimports,
  222. oldexports,
  223. oldresource,
  224. oldrttilist,
  225. oldresourcestringlist,
  226. oldbsssegment,
  227. olddatasegment,
  228. oldcodesegment,
  229. oldexprasmlist,
  230. olddebuglist,
  231. oldwithdebuglist,
  232. oldconsts : taasmoutput;
  233. oldobjectlibrary : tasmlibrarydata;
  234. { resourcestrings }
  235. OldResourceStrings : tResourceStrings;
  236. { akt.. things }
  237. oldaktlocalswitches : tlocalswitches;
  238. oldaktmoduleswitches : tmoduleswitches;
  239. oldaktfilepos : tfileposinfo;
  240. oldaktpackenum,oldaktmaxfpuregisters : longint;
  241. oldaktalignment : talignmentinfo;
  242. oldaktoutputformat : tasm;
  243. oldaktspecificoptprocessor,
  244. oldaktoptprocessor : tprocessors;
  245. oldaktasmmode : tasmmode;
  246. oldaktinterfacetype: tinterfacetypes;
  247. oldaktmodeswitches : tmodeswitches;
  248. old_compiled_module : tmodule;
  249. oldaktdefproccall : tproccalloption;
  250. oldsourcecodepage : tcodepagestring;
  251. oldstatement_level : integer;
  252. {$ifdef GDB}
  253. store_dbx : plongint;
  254. {$endif GDB}
  255. end;
  256. var
  257. olddata : polddata;
  258. {$ifdef USEEXCEPT}
  259. {$ifndef Delphi}
  260. recoverpos : jmp_buf;
  261. oldrecoverpos : pjmp_buf;
  262. {$endif Delphi}
  263. {$endif useexcept}
  264. begin
  265. inc(compile_level);
  266. parser_current_file:=filename;
  267. { Uses heap memory instead of placing everything on the
  268. stack. This is needed because compile() can be called
  269. recursively }
  270. new(olddata);
  271. with olddata^ do
  272. begin
  273. old_compiled_module:=compiled_module;
  274. { save symtable state }
  275. oldsymtablestack:=symtablestack;
  276. olddefaultsymtablestack:=defaultsymtablestack;
  277. oldrefsymtable:=refsymtable;
  278. oldcurrent_procdef:=current_procdef;
  279. oldaktdefproccall:=aktdefproccall;
  280. move(overloaded_operators,oldoverloaded_operators,sizeof(toverloaded_operators));
  281. { save scanner state }
  282. oldc:=c;
  283. oldpattern:=pattern;
  284. oldorgpattern:=orgpattern;
  285. oldtoken:=token;
  286. oldidtoken:=idtoken;
  287. old_block_type:=block_type;
  288. oldtokenpos:=akttokenpos;
  289. oldsourcecodepage:=aktsourcecodepage;
  290. { save cg }
  291. oldparse_only:=parse_only;
  292. { save assembler lists }
  293. olddatasegment:=datasegment;
  294. oldbsssegment:=bsssegment;
  295. oldcodesegment:=codesegment;
  296. olddebuglist:=debuglist;
  297. oldwithdebuglist:=withdebuglist;
  298. oldconsts:=consts;
  299. oldrttilist:=rttilist;
  300. oldexprasmlist:=exprasmlist;
  301. oldimports:=importssection;
  302. oldexports:=exportssection;
  303. oldresource:=resourcesection;
  304. oldresourcestringlist:=resourcestringlist;
  305. oldobjectlibrary:=objectlibrary;
  306. OldResourceStrings:=ResourceStrings;
  307. { save akt... state }
  308. { handle the postponed case first }
  309. if localswitcheschanged then
  310. begin
  311. aktlocalswitches:=nextaktlocalswitches;
  312. localswitcheschanged:=false;
  313. end;
  314. oldaktlocalswitches:=aktlocalswitches;
  315. oldaktmoduleswitches:=aktmoduleswitches;
  316. oldaktalignment:=aktalignment;
  317. oldaktpackenum:=aktpackenum;
  318. oldaktmaxfpuregisters:=aktmaxfpuregisters;
  319. oldaktoutputformat:=aktoutputformat;
  320. oldaktoptprocessor:=aktoptprocessor;
  321. oldaktspecificoptprocessor:=aktspecificoptprocessor;
  322. oldaktasmmode:=aktasmmode;
  323. oldaktinterfacetype:=aktinterfacetype;
  324. oldaktfilepos:=aktfilepos;
  325. oldaktmodeswitches:=aktmodeswitches;
  326. oldstatement_level:=statement_level;
  327. {$ifdef GDB}
  328. store_dbx:=dbx_counter;
  329. dbx_counter:=nil;
  330. {$endif GDB}
  331. end;
  332. { show info }
  333. Message1(parser_i_compiling,filename);
  334. { reset symtable }
  335. symtablestack:=nil;
  336. defaultsymtablestack:=nil;
  337. systemunit:=nil;
  338. refsymtable:=nil;
  339. aktdefproccall:=initdefproccall;
  340. registerdef:=true;
  341. statement_level:=0;
  342. aktexceptblock:=0;
  343. exceptblockcounter:=0;
  344. aktmaxfpuregisters:=-1;
  345. fillchar(overloaded_operators,sizeof(toverloaded_operators),0);
  346. { reset the unit or create a new program }
  347. if not assigned(current_module) then
  348. begin
  349. current_module:=tppumodule.create(nil,filename,'',false);
  350. main_module:=current_module;
  351. current_module.state:=ms_compile;
  352. end;
  353. if not(current_module.state in [ms_compile,ms_second_compile]) then
  354. internalerror(200212281);
  355. { a unit compiled at command line must be inside the loaded_unit list }
  356. if (compile_level=1) then
  357. loaded_units.insert(current_module);
  358. { Set the module to use for verbose }
  359. compiled_module:=current_module;
  360. SetCompileModule(current_module);
  361. Fillchar(aktfilepos,0,sizeof(aktfilepos));
  362. { Load current state from the init values }
  363. aktlocalswitches:=initlocalswitches;
  364. aktmoduleswitches:=initmoduleswitches;
  365. aktmodeswitches:=initmodeswitches;
  366. {$IFDEF Testvarsets}
  367. aktsetalloc:=initsetalloc;
  368. {$ENDIF}
  369. aktalignment:=initalignment;
  370. aktpackenum:=initpackenum;
  371. aktoutputformat:=initoutputformat;
  372. set_target_asm(aktoutputformat);
  373. aktoptprocessor:=initoptprocessor;
  374. aktspecificoptprocessor:=initspecificoptprocessor;
  375. aktasmmode:=initasmmode;
  376. aktinterfacetype:=initinterfacetype;
  377. { startup scanner and load the first file }
  378. current_scanner:=tscannerfile.Create(filename);
  379. current_scanner.firstfile;
  380. current_module.scanner:=current_scanner;
  381. { macros }
  382. default_macros;
  383. { read the first token }
  384. current_scanner.readtoken;
  385. { init code generator for a new module }
  386. codegen_newmodule;
  387. { If the compile level > 1 we get a nice "unit expected" error
  388. message if we are trying to use a program as unit.}
  389. {$ifdef USEEXCEPT}
  390. if setjmp(recoverpos)=0 then
  391. begin
  392. oldrecoverpos:=recoverpospointer;
  393. recoverpospointer:=@recoverpos;
  394. {$endif USEEXCEPT}
  395. if (token=_UNIT) or (compile_level>1) then
  396. begin
  397. current_module.is_unit:=true;
  398. proc_unit;
  399. end
  400. else
  401. proc_program(token=_LIBRARY);
  402. {$ifdef USEEXCEPT}
  403. recoverpospointer:=oldrecoverpos;
  404. end
  405. else
  406. begin
  407. recoverpospointer:=oldrecoverpos;
  408. longjump_used:=true;
  409. end;
  410. {$endif USEEXCEPT}
  411. { clear memory }
  412. {$ifdef Splitheap}
  413. if testsplit then
  414. begin
  415. { temp heap should be empty after that !!!}
  416. codegen_donemodule;
  417. Releasetempheap;
  418. end;
  419. {$endif Splitheap}
  420. { restore old state, close trees, > 0.99.5 has heapblocks, so
  421. it's the default to release the trees }
  422. codegen_donemodule;
  423. if assigned(current_module) then
  424. begin
  425. { free ppu }
  426. if assigned(tppumodule(current_module).ppufile) then
  427. begin
  428. tppumodule(current_module).ppufile.free;
  429. tppumodule(current_module).ppufile:=nil;
  430. end;
  431. { free scanner }
  432. if assigned(current_module.scanner) then
  433. begin
  434. if current_scanner=tscannerfile(current_module.scanner) then
  435. current_scanner:=nil;
  436. tscannerfile(current_module.scanner).free;
  437. current_module.scanner:=nil;
  438. end;
  439. end;
  440. if (compile_level>1) then
  441. begin
  442. with olddata^ do
  443. begin
  444. { restore scanner }
  445. c:=oldc;
  446. pattern:=oldpattern;
  447. orgpattern:=oldorgpattern;
  448. token:=oldtoken;
  449. idtoken:=oldidtoken;
  450. akttokenpos:=oldtokenpos;
  451. block_type:=old_block_type;
  452. { restore cg }
  453. parse_only:=oldparse_only;
  454. { restore asmlists }
  455. exprasmlist:=oldexprasmlist;
  456. datasegment:=olddatasegment;
  457. bsssegment:=oldbsssegment;
  458. codesegment:=oldcodesegment;
  459. consts:=oldconsts;
  460. debuglist:=olddebuglist;
  461. withdebuglist:=oldwithdebuglist;
  462. importssection:=oldimports;
  463. exportssection:=oldexports;
  464. resourcesection:=oldresource;
  465. rttilist:=oldrttilist;
  466. resourcestringlist:=oldresourcestringlist;
  467. { object data }
  468. ResourceStrings:=OldResourceStrings;
  469. objectlibrary:=oldobjectlibrary;
  470. { restore previous scanner }
  471. if assigned(old_compiled_module) then
  472. current_scanner:=tscannerfile(old_compiled_module.scanner)
  473. else
  474. current_scanner:=nil;
  475. if assigned(current_scanner) then
  476. parser_current_file:=current_scanner.inputfile.name^;
  477. { restore symtable state }
  478. refsymtable:=oldrefsymtable;
  479. symtablestack:=oldsymtablestack;
  480. defaultsymtablestack:=olddefaultsymtablestack;
  481. aktdefproccall:=oldaktdefproccall;
  482. current_procdef:=oldcurrent_procdef;
  483. move(oldoverloaded_operators,overloaded_operators,sizeof(toverloaded_operators));
  484. aktsourcecodepage:=oldsourcecodepage;
  485. aktlocalswitches:=oldaktlocalswitches;
  486. aktmoduleswitches:=oldaktmoduleswitches;
  487. aktalignment:=oldaktalignment;
  488. aktpackenum:=oldaktpackenum;
  489. aktmaxfpuregisters:=oldaktmaxfpuregisters;
  490. aktoutputformat:=oldaktoutputformat;
  491. set_target_asm(aktoutputformat);
  492. aktoptprocessor:=oldaktoptprocessor;
  493. aktspecificoptprocessor:=oldaktspecificoptprocessor;
  494. aktasmmode:=oldaktasmmode;
  495. aktinterfacetype:=oldaktinterfacetype;
  496. aktfilepos:=oldaktfilepos;
  497. aktmodeswitches:=oldaktmodeswitches;
  498. statement_level:=oldstatement_level;
  499. aktexceptblock:=0;
  500. exceptblockcounter:=0;
  501. {$ifdef GDB}
  502. dbx_counter:=store_dbx;
  503. {$endif GDB}
  504. end;
  505. end
  506. else
  507. begin
  508. parser_current_file:='';
  509. { Shut down things when the last file is compiled }
  510. if (compile_level=1) then
  511. begin
  512. { Close script }
  513. if (not AsmRes.Empty) then
  514. begin
  515. Message1(exec_i_closing_script,AsmRes.Fn);
  516. AsmRes.WriteToDisk;
  517. end;
  518. {$ifdef USEEXCEPT}
  519. if not longjump_used then
  520. {$endif USEEXCEPT}
  521. begin
  522. { do not create browsers on errors !! }
  523. if status.errorcount=0 then
  524. begin
  525. {$ifdef BrowserLog}
  526. { Write Browser Log }
  527. if (cs_browser_log in aktglobalswitches) and
  528. (cs_browser in aktmoduleswitches) then
  529. begin
  530. if browserlog.elements_to_list.empty then
  531. begin
  532. Message1(parser_i_writing_browser_log,browserlog.Fname);
  533. WriteBrowserLog;
  534. end
  535. else
  536. browserlog.list_elements;
  537. end;
  538. {$endif BrowserLog}
  539. { Write Browser Collections }
  540. do_extractsymbolinfo{$ifdef FPC}(){$endif};
  541. end;
  542. end;
  543. {$ifdef dummy}
  544. if current_module.in_second_compile then
  545. begin
  546. current_module.in_second_compile:=false;
  547. current_module.in_compile:=true;
  548. end
  549. else
  550. current_module.in_compile:=false;
  551. {$endif dummy}
  552. end;
  553. end;
  554. dec(compile_level);
  555. compiled_module:=olddata^.old_compiled_module;
  556. dispose(olddata);
  557. {$ifdef USEEXCEPT}
  558. if longjump_used then
  559. longjmp(recoverpospointer^,1);
  560. {$endif USEEXCEPT}
  561. end;
  562. end.
  563. {
  564. $Log$
  565. Revision 1.52 2003-04-27 11:21:33 peter
  566. * aktprocdef renamed to current_procdef
  567. * procinfo renamed to current_procinfo
  568. * procinfo will now be stored in current_module so it can be
  569. cleaned up properly
  570. * gen_main_procsym changed to create_main_proc and release_main_proc
  571. to also generate a tprocinfo structure
  572. * fixed unit implicit initfinal
  573. Revision 1.51 2003/04/27 07:29:50 peter
  574. * current_procdef cleanup, current_procdef is now always nil when parsing
  575. a new procdef declaration
  576. * aktprocsym removed
  577. * lexlevel removed, use symtable.symtablelevel instead
  578. * implicit init/final code uses the normal genentry/genexit
  579. * funcret state checking updated for new funcret handling
  580. Revision 1.50 2003/04/26 00:30:52 peter
  581. * reset aktfilepos when setting new module for compile
  582. Revision 1.49 2003/04/25 20:59:33 peter
  583. * removed funcretn,funcretsym, function result is now in varsym
  584. and aliases for result and function name are added using absolutesym
  585. * vs_hidden parameter for funcret passed in parameter
  586. * vs_hidden fixes
  587. * writenode changed to printnode and released from extdebug
  588. * -vp option added to generate a tree.log with the nodetree
  589. * nicer printnode for statements, callnode
  590. Revision 1.48 2002/12/29 14:57:50 peter
  591. * unit loading changed to first register units and load them
  592. afterwards. This is needed to support uses xxx in yyy correctly
  593. * unit dependency check fixed
  594. Revision 1.47 2002/12/24 23:32:19 peter
  595. * fixed crash when old_compiled_module was nil
  596. Revision 1.46 2002/11/20 12:36:24 mazen
  597. * $UNITPATH directive is now working
  598. Revision 1.45 2002/10/07 19:29:52 peter
  599. * Place old data in compile() in the heap to save stack
  600. Revision 1.44 2002/09/05 19:27:06 peter
  601. * fixed crash when current_module becomes nil
  602. Revision 1.43 2002/08/18 19:58:28 peter
  603. * more current_scanner fixes
  604. Revision 1.42 2002/08/16 15:31:08 peter
  605. * fixed possible crashes with current_scanner
  606. Revision 1.41 2002/08/15 19:10:35 peter
  607. * first things tai,tnode storing in ppu
  608. Revision 1.40 2002/08/12 16:46:04 peter
  609. * tscannerfile is now destroyed in tmodule.reset and current_scanner
  610. is updated accordingly. This removes all the loading and saving of
  611. the old scanner and the invalid flag marking
  612. Revision 1.39 2002/08/12 15:08:40 carl
  613. + stab register indexes for powerpc (moved from gdb to cpubase)
  614. + tprocessor enumeration moved to cpuinfo
  615. + linker in target_info is now a class
  616. * many many updates for m68k (will soon start to compile)
  617. - removed some ifdef or correct them for correct cpu
  618. Revision 1.38 2002/08/11 14:28:19 peter
  619. * TScannerFile.SetInvalid added that will also reset inputfile
  620. Revision 1.37 2002/08/11 13:24:12 peter
  621. * saving of asmsymbols in ppu supported
  622. * asmsymbollist global is removed and moved into a new class
  623. tasmlibrarydata that will hold the info of a .a file which
  624. corresponds with a single module. Added librarydata to tmodule
  625. to keep the library info stored for the module. In the future the
  626. objectfiles will also be stored to the tasmlibrarydata class
  627. * all getlabel/newasmsymbol and friends are moved to the new class
  628. Revision 1.36 2002/08/09 19:15:41 carl
  629. - removed newcg define
  630. Revision 1.35 2002/07/20 17:16:03 florian
  631. + source code page support
  632. Revision 1.34 2002/07/01 18:46:24 peter
  633. * internal linker
  634. * reorganized aasm layer
  635. Revision 1.33 2002/05/18 13:34:11 peter
  636. * readded missing revisions
  637. Revision 1.32 2002/05/16 19:46:42 carl
  638. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  639. + try to fix temp allocation (still in ifdef)
  640. + generic constructor calls
  641. + start of tassembler / tmodulebase class cleanup
  642. Revision 1.30 2002/04/21 18:57:23 peter
  643. * fixed memleaks when file can't be opened
  644. Revision 1.29 2002/04/20 21:32:24 carl
  645. + generic FPC_CHECKPOINTER
  646. + first parameter offset in stack now portable
  647. * rename some constants
  648. + move some cpu stuff to other units
  649. - remove unused constents
  650. * fix stacksize for some targets
  651. * fix generic size problems which depend now on EXTEND_SIZE constant
  652. Revision 1.28 2002/04/19 15:46:02 peter
  653. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  654. in most cases and not written to the ppu
  655. * add mangeledname_prefix() routine to generate the prefix of
  656. manglednames depending on the current procedure, object and module
  657. * removed static procprefix since the mangledname is now build only
  658. on demand from tprocdef.mangledname
  659. Revision 1.27 2002/01/29 19:43:11 peter
  660. * update target_asm according to outputformat
  661. }