parser.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  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,symsym,
  32. finput,fmodule,fppu,
  33. aasmbase,aasmtai,
  34. 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,
  48. cresstr,cpuinfo,procinfo;
  49. procedure initparser;
  50. begin
  51. { ^M means a string or a char, because we don't parse a }
  52. { type declaration }
  53. ignore_equal:=false;
  54. { we didn't parse a object or class declaration }
  55. { and no function header }
  56. testcurobject:=0;
  57. { Current compiled module/proc }
  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 stacksize=0 then
  80. stacksize:=target_info.stacksize;
  81. { open assembler response }
  82. if cs_link_on_target in aktglobalswitches then
  83. GenerateAsmRes(outputexedir+inputfile+'_ppas')
  84. else
  85. GenerateAsmRes(outputexedir+'ppas');
  86. { open deffile }
  87. DefFile:=TDefFile.Create(outputexedir+inputfile+target_info.defext);
  88. { list of generated .o files, so the linker can remove them }
  89. SmartLinkOFiles:=TStringList.Create;
  90. { codegen }
  91. if paraprintnodetree<>0 then
  92. printnode_reset;
  93. { target specific stuff }
  94. case target_info.system of
  95. system_powerpc_morphos:
  96. include(supported_calling_conventions,pocall_syscall);
  97. system_m68k_amiga:
  98. include(supported_calling_conventions,pocall_syscall);
  99. end;
  100. end;
  101. procedure doneparser;
  102. begin
  103. { Reset current compiling info, so destroy routines can't
  104. reference the data that might already be destroyed }
  105. objectlibrary:=nil;
  106. current_module:=nil;
  107. compiled_module:=nil;
  108. current_procinfo:=nil;
  109. { unload units }
  110. loaded_units.free;
  111. usedunits.free;
  112. { if there was an error in the scanner, the scanner is
  113. still assinged }
  114. if assigned(current_scanner) then
  115. begin
  116. current_scanner.free;
  117. current_scanner:=nil;
  118. end;
  119. { close scanner }
  120. DoneScanner;
  121. { close ppas,deffile }
  122. asmres.free;
  123. deffile.free;
  124. { free list of .o files }
  125. SmartLinkOFiles.Free;
  126. end;
  127. {$ifdef PREPROCWRITE}
  128. procedure preprocess(const filename:string);
  129. var
  130. i : longint;
  131. begin
  132. new(preprocfile,init('pre'));
  133. { initialize a module }
  134. current_module:=new(pmodule,init(filename,false));
  135. macrosymtablestack:= initialmacrosymtable;
  136. current_module.localmacrosymtable:= tmacrosymtable.create(false);
  137. current_module.localmacrosymtable.next:= initialmacrosymtable;
  138. macrosymtablestack:= current_module.localmacrosymtable;
  139. ConsolidateMode;
  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. {*****************************************************************************
  200. Create information for a new module
  201. *****************************************************************************}
  202. procedure init_module;
  203. begin
  204. { Create assembler output lists for CG }
  205. exprasmlist:=taasmoutput.create;
  206. datasegment:=taasmoutput.create;
  207. codesegment:=taasmoutput.create;
  208. bsssegment:=taasmoutput.create;
  209. debuglist:=taasmoutput.create;
  210. withdebuglist:=taasmoutput.create;
  211. consts:=taasmoutput.create;
  212. rttilist:=taasmoutput.create;
  213. picdata:=taasmoutput.create;
  214. if target_info.system=system_powerpc_darwin then
  215. picdata.concat(tai_simple.create(ait_non_lazy_symbol_pointer));
  216. ResourceStringList:=Nil;
  217. importssection:=nil;
  218. exportssection:=nil;
  219. resourcesection:=nil;
  220. { Resource strings }
  221. ResourceStrings:=TResourceStrings.Create;
  222. { use the librarydata from current_module }
  223. objectlibrary:=current_module.librarydata;
  224. end;
  225. procedure done_module;
  226. {$ifdef MEMDEBUG}
  227. var
  228. d : tmemdebug;
  229. {$endif}
  230. begin
  231. {$ifdef MEMDEBUG}
  232. d:=tmemdebug.create(current_module.modulename^+' - asmlists');
  233. {$endif}
  234. exprasmlist.free;
  235. codesegment.free;
  236. bsssegment.free;
  237. datasegment.free;
  238. debuglist.free;
  239. withdebuglist.free;
  240. consts.free;
  241. rttilist.free;
  242. picdata.free;
  243. if assigned(ResourceStringList) then
  244. ResourceStringList.free;
  245. if assigned(importssection) then
  246. importssection.free;
  247. if assigned(exportssection) then
  248. exportssection.free;
  249. if assigned(resourcesection) then
  250. resourcesection.free;
  251. {$ifdef MEMDEBUG}
  252. d.free;
  253. {$endif}
  254. { resource strings }
  255. ResourceStrings.free;
  256. objectlibrary:=nil;
  257. end;
  258. {*****************************************************************************
  259. Compile a source file
  260. *****************************************************************************}
  261. procedure compile(const filename:string);
  262. type
  263. polddata=^tolddata;
  264. tolddata=record
  265. { scanner }
  266. oldidtoken,
  267. oldtoken : ttoken;
  268. oldtokenpos : tfileposinfo;
  269. oldc : char;
  270. oldpattern,
  271. oldorgpattern : string;
  272. old_block_type : tblock_type;
  273. { symtable }
  274. oldrefsymtable,
  275. olddefaultsymtablestack,
  276. oldsymtablestack : tsymtable;
  277. olddefaultmacrosymtablestack,
  278. oldmacrosymtablestack : tsymtable;
  279. oldaktprocsym : tprocsym;
  280. { cg }
  281. oldparse_only : boolean;
  282. { asmlists }
  283. oldimports,
  284. oldexports,
  285. oldresource,
  286. oldrttilist,
  287. oldpicdata,
  288. oldresourcestringlist,
  289. oldbsssegment,
  290. olddatasegment,
  291. oldcodesegment,
  292. oldexprasmlist,
  293. olddebuglist,
  294. oldwithdebuglist,
  295. oldconsts : taasmoutput;
  296. oldobjectlibrary : tasmlibrarydata;
  297. { resourcestrings }
  298. OldResourceStrings : tResourceStrings;
  299. { akt.. things }
  300. oldaktlocalswitches : tlocalswitches;
  301. oldaktmoduleswitches : tmoduleswitches;
  302. oldaktfilepos : tfileposinfo;
  303. oldaktpackrecords,
  304. oldaktpackenum,oldaktmaxfpuregisters : longint;
  305. oldaktalignment : talignmentinfo;
  306. oldaktoutputformat : tasm;
  307. oldaktspecificoptprocessor,
  308. oldaktoptprocessor : tprocessors;
  309. oldaktfputype : tfputype;
  310. oldaktasmmode : tasmmode;
  311. oldaktinterfacetype: tinterfacetypes;
  312. oldaktmodeswitches : tmodeswitches;
  313. old_compiled_module : tmodule;
  314. oldcurrent_procinfo : tprocinfo;
  315. oldaktdefproccall : tproccalloption;
  316. oldsourcecodepage : tcodepagestring;
  317. {$ifdef GDB}
  318. store_dbx : plongint;
  319. {$endif GDB}
  320. end;
  321. var
  322. olddata : polddata;
  323. {$ifdef USEEXCEPT}
  324. recoverpos : jmp_buf;
  325. oldrecoverpos : pjmp_buf;
  326. {$endif useexcept}
  327. begin
  328. inc(compile_level);
  329. parser_current_file:=filename;
  330. { Uses heap memory instead of placing everything on the
  331. stack. This is needed because compile() can be called
  332. recursively }
  333. new(olddata);
  334. with olddata^ do
  335. begin
  336. old_compiled_module:=compiled_module;
  337. { save symtable state }
  338. oldsymtablestack:=symtablestack;
  339. oldmacrosymtablestack:=macrosymtablestack;
  340. olddefaultsymtablestack:=defaultsymtablestack;
  341. olddefaultmacrosymtablestack:=defaultmacrosymtablestack;
  342. oldrefsymtable:=refsymtable;
  343. oldcurrent_procinfo:=current_procinfo;
  344. oldaktdefproccall:=aktdefproccall;
  345. { save scanner state }
  346. oldc:=c;
  347. oldpattern:=pattern;
  348. oldorgpattern:=orgpattern;
  349. oldtoken:=token;
  350. oldidtoken:=idtoken;
  351. old_block_type:=block_type;
  352. oldtokenpos:=akttokenpos;
  353. oldsourcecodepage:=aktsourcecodepage;
  354. { save cg }
  355. oldparse_only:=parse_only;
  356. { save assembler lists }
  357. olddatasegment:=datasegment;
  358. oldbsssegment:=bsssegment;
  359. oldcodesegment:=codesegment;
  360. olddebuglist:=debuglist;
  361. oldwithdebuglist:=withdebuglist;
  362. oldconsts:=consts;
  363. oldrttilist:=rttilist;
  364. oldpicdata:=picdata;
  365. oldexprasmlist:=exprasmlist;
  366. oldimports:=importssection;
  367. oldexports:=exportssection;
  368. oldresource:=resourcesection;
  369. oldresourcestringlist:=resourcestringlist;
  370. oldobjectlibrary:=objectlibrary;
  371. OldResourceStrings:=ResourceStrings;
  372. { save akt... state }
  373. { handle the postponed case first }
  374. if localswitcheschanged then
  375. begin
  376. aktlocalswitches:=nextaktlocalswitches;
  377. localswitcheschanged:=false;
  378. end;
  379. oldaktlocalswitches:=aktlocalswitches;
  380. oldaktmoduleswitches:=aktmoduleswitches;
  381. oldaktalignment:=aktalignment;
  382. oldaktpackenum:=aktpackenum;
  383. oldaktpackrecords:=aktpackrecords;
  384. oldaktfputype:=aktfputype;
  385. oldaktmaxfpuregisters:=aktmaxfpuregisters;
  386. oldaktoutputformat:=aktoutputformat;
  387. oldaktoptprocessor:=aktoptprocessor;
  388. oldaktspecificoptprocessor:=aktspecificoptprocessor;
  389. oldaktasmmode:=aktasmmode;
  390. oldaktinterfacetype:=aktinterfacetype;
  391. oldaktfilepos:=aktfilepos;
  392. oldaktmodeswitches:=aktmodeswitches;
  393. {$ifdef GDB}
  394. store_dbx:=dbx_counter;
  395. dbx_counter:=nil;
  396. {$endif GDB}
  397. end;
  398. { show info }
  399. Message1(parser_i_compiling,filename);
  400. { reset symtable }
  401. symtablestack:=nil;
  402. macrosymtablestack:=nil;
  403. defaultsymtablestack:=nil;
  404. defaultmacrosymtablestack:=nil;
  405. systemunit:=nil;
  406. refsymtable:=nil;
  407. aktdefproccall:=initdefproccall;
  408. registerdef:=true;
  409. aktexceptblock:=0;
  410. exceptblockcounter:=0;
  411. aktmaxfpuregisters:=-1;
  412. { reset the unit or create a new program }
  413. { a unit compiled at command line must be inside the loaded_unit list }
  414. if (compile_level=1) then
  415. begin
  416. if assigned(current_module) then
  417. internalerror(200501158);
  418. current_module:=tppumodule.create(nil,filename,'',false);
  419. addloadedunit(current_module);
  420. main_module:=current_module;
  421. current_module.state:=ms_compile;
  422. end;
  423. if not(assigned(current_module) and
  424. (current_module.state in [ms_compile,ms_second_compile])) then
  425. internalerror(200212281);
  426. { Set the module to use for verbose }
  427. compiled_module:=current_module;
  428. SetCompileModule(current_module);
  429. Fillchar(aktfilepos,0,sizeof(aktfilepos));
  430. { Load current state from the init values }
  431. aktlocalswitches:=initlocalswitches;
  432. aktmoduleswitches:=initmoduleswitches;
  433. aktmodeswitches:=initmodeswitches;
  434. {$IFDEF Testvarsets}
  435. aktsetalloc:=initsetalloc;
  436. {$ENDIF}
  437. aktalignment:=initalignment;
  438. aktfputype:=initfputype;
  439. aktpackenum:=initpackenum;
  440. aktpackrecords:=0;
  441. aktoutputformat:=initoutputformat;
  442. set_target_asm(aktoutputformat);
  443. aktoptprocessor:=initoptprocessor;
  444. aktspecificoptprocessor:=initspecificoptprocessor;
  445. aktasmmode:=initasmmode;
  446. aktinterfacetype:=initinterfacetype;
  447. { startup scanner and load the first file }
  448. current_scanner:=tscannerfile.Create(filename);
  449. current_scanner.firstfile;
  450. current_module.scanner:=current_scanner;
  451. { init macros before anything in the file is parsed.}
  452. macrosymtablestack:= initialmacrosymtable;
  453. current_module.localmacrosymtable:= tmacrosymtable.create(false);
  454. current_module.localmacrosymtable.next:= initialmacrosymtable;
  455. macrosymtablestack:= current_module.localmacrosymtable;
  456. { read the first token }
  457. current_scanner.readtoken;
  458. { init code generator for a new module }
  459. init_module;
  460. { If the compile level > 1 we get a nice "unit expected" error
  461. message if we are trying to use a program as unit.}
  462. {$ifdef USEEXCEPT}
  463. if setjmp(recoverpos)=0 then
  464. begin
  465. oldrecoverpos:=recoverpospointer;
  466. recoverpospointer:=@recoverpos;
  467. {$endif USEEXCEPT}
  468. if (token=_UNIT) or (compile_level>1) then
  469. begin
  470. current_module.is_unit:=true;
  471. proc_unit;
  472. end
  473. else
  474. proc_program(token=_LIBRARY);
  475. {$ifdef USEEXCEPT}
  476. recoverpospointer:=oldrecoverpos;
  477. end
  478. else
  479. begin
  480. recoverpospointer:=oldrecoverpos;
  481. longjump_used:=true;
  482. end;
  483. {$endif USEEXCEPT}
  484. { restore old state }
  485. done_module;
  486. if assigned(current_module) then
  487. begin
  488. { module is now compiled }
  489. tppumodule(current_module).state:=ms_compiled;
  490. { free ppu }
  491. if assigned(tppumodule(current_module).ppufile) then
  492. begin
  493. tppumodule(current_module).ppufile.free;
  494. tppumodule(current_module).ppufile:=nil;
  495. end;
  496. { free scanner }
  497. if assigned(current_module.scanner) then
  498. begin
  499. if current_scanner=tscannerfile(current_module.scanner) then
  500. current_scanner:=nil;
  501. tscannerfile(current_module.scanner).free;
  502. current_module.scanner:=nil;
  503. end;
  504. end;
  505. if (compile_level>1) then
  506. begin
  507. with olddata^ do
  508. begin
  509. { restore scanner }
  510. c:=oldc;
  511. pattern:=oldpattern;
  512. orgpattern:=oldorgpattern;
  513. token:=oldtoken;
  514. idtoken:=oldidtoken;
  515. akttokenpos:=oldtokenpos;
  516. block_type:=old_block_type;
  517. { restore cg }
  518. parse_only:=oldparse_only;
  519. { restore asmlists }
  520. exprasmlist:=oldexprasmlist;
  521. datasegment:=olddatasegment;
  522. bsssegment:=oldbsssegment;
  523. codesegment:=oldcodesegment;
  524. consts:=oldconsts;
  525. debuglist:=olddebuglist;
  526. withdebuglist:=oldwithdebuglist;
  527. importssection:=oldimports;
  528. exportssection:=oldexports;
  529. resourcesection:=oldresource;
  530. rttilist:=oldrttilist;
  531. picdata:=oldpicdata;
  532. resourcestringlist:=oldresourcestringlist;
  533. { object data }
  534. ResourceStrings:=OldResourceStrings;
  535. objectlibrary:=oldobjectlibrary;
  536. { restore previous scanner }
  537. if assigned(old_compiled_module) then
  538. current_scanner:=tscannerfile(old_compiled_module.scanner)
  539. else
  540. current_scanner:=nil;
  541. if assigned(current_scanner) then
  542. parser_current_file:=current_scanner.inputfile.name^;
  543. { restore symtable state }
  544. refsymtable:=oldrefsymtable;
  545. symtablestack:=oldsymtablestack;
  546. macrosymtablestack:=oldmacrosymtablestack;
  547. defaultsymtablestack:=olddefaultsymtablestack;
  548. defaultmacrosymtablestack:=olddefaultmacrosymtablestack;
  549. aktdefproccall:=oldaktdefproccall;
  550. current_procinfo:=oldcurrent_procinfo;
  551. aktsourcecodepage:=oldsourcecodepage;
  552. aktlocalswitches:=oldaktlocalswitches;
  553. aktmoduleswitches:=oldaktmoduleswitches;
  554. aktalignment:=oldaktalignment;
  555. aktpackenum:=oldaktpackenum;
  556. aktpackrecords:=oldaktpackrecords;
  557. aktmaxfpuregisters:=oldaktmaxfpuregisters;
  558. aktoutputformat:=oldaktoutputformat;
  559. set_target_asm(aktoutputformat);
  560. aktoptprocessor:=oldaktoptprocessor;
  561. aktspecificoptprocessor:=oldaktspecificoptprocessor;
  562. aktfputype:=oldaktfputype;
  563. aktasmmode:=oldaktasmmode;
  564. aktinterfacetype:=oldaktinterfacetype;
  565. aktfilepos:=oldaktfilepos;
  566. aktmodeswitches:=oldaktmodeswitches;
  567. aktexceptblock:=0;
  568. exceptblockcounter:=0;
  569. {$ifdef GDB}
  570. dbx_counter:=store_dbx;
  571. {$endif GDB}
  572. end;
  573. end
  574. else
  575. begin
  576. parser_current_file:='';
  577. { Shut down things when the last file is compiled }
  578. if (compile_level=1) then
  579. begin
  580. { Close script }
  581. if (not AsmRes.Empty) then
  582. begin
  583. Message1(exec_i_closing_script,AsmRes.Fn);
  584. AsmRes.WriteToDisk;
  585. end;
  586. {$ifdef USEEXCEPT}
  587. if not longjump_used then
  588. {$endif USEEXCEPT}
  589. begin
  590. { do not create browsers on errors !! }
  591. if status.errorcount=0 then
  592. begin
  593. {$ifdef BrowserLog}
  594. { Write Browser Log }
  595. if (cs_browser_log in aktglobalswitches) and
  596. (cs_browser in aktmoduleswitches) then
  597. begin
  598. if browserlog.elements_to_list.empty then
  599. begin
  600. Message1(parser_i_writing_browser_log,browserlog.Fname);
  601. WriteBrowserLog;
  602. end
  603. else
  604. browserlog.list_elements;
  605. end;
  606. {$endif BrowserLog}
  607. { Write Browser Collections }
  608. do_extractsymbolinfo{$ifdef FPC}(){$endif};
  609. end;
  610. end;
  611. {$ifdef dummy}
  612. if current_module.in_second_compile then
  613. begin
  614. current_module.in_second_compile:=false;
  615. current_module.in_compile:=true;
  616. end
  617. else
  618. current_module.in_compile:=false;
  619. {$endif dummy}
  620. end;
  621. end;
  622. dec(compile_level);
  623. compiled_module:=olddata^.old_compiled_module;
  624. dispose(olddata);
  625. {$ifdef USEEXCEPT}
  626. if longjump_used then
  627. longjmp(recoverpospointer^,1);
  628. {$endif USEEXCEPT}
  629. end;
  630. end.
  631. {
  632. $Log$
  633. Revision 1.70 2005-01-19 22:19:41 peter
  634. * unit mapping rewrite
  635. * new derefmap added
  636. Revision 1.69 2005/01/09 20:24:43 olle
  637. * rework of macro subsystem
  638. + exportable macros for mode macpas
  639. Revision 1.68 2004/10/25 15:38:41 peter
  640. * heap and heapsize removed
  641. * checkpointer fixes
  642. Revision 1.67 2004/10/15 09:14:17 mazen
  643. - remove $IFDEF DELPHI and related code
  644. - remove $IFDEF FPCPROCVAR and related code
  645. Revision 1.66 2004/06/20 08:55:30 florian
  646. * logs truncated
  647. Revision 1.65 2004/05/12 13:21:09 karoly
  648. * few small changes to add syscall support to M68k/Amiga target
  649. Revision 1.64 2004/04/28 15:19:03 florian
  650. + syscall directive support for MorphOS added
  651. Revision 1.63 2004/03/16 16:20:49 peter
  652. * reset current_module,current_procinfo so the destroy routines
  653. can't access their info anymore, because that can be already
  654. destroyed
  655. Revision 1.62 2004/03/14 20:08:37 peter
  656. * packrecords fixed for settings from $PACKRECORDS
  657. * default packrecords now uses value 0 and uses info from aligment
  658. structure only, initpackrecords removed
  659. Revision 1.61 2004/03/02 17:32:12 florian
  660. * make cycle fixed
  661. + pic support for darwin
  662. + support of importing vars from shared libs on darwin implemented
  663. }