pdecvar.pas 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Parses variable declarations. Used for var statement and record
  5. definitions
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit pdecvar;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. symsym,symdef;
  24. function read_property_dec(aclass:tobjectdef):tpropertysym;
  25. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  26. implementation
  27. uses
  28. { common }
  29. cutils,cclasses,
  30. { global }
  31. globtype,globals,tokens,verbose,
  32. systems,
  33. { symtable }
  34. symconst,symbase,symtype,symtable,defutil,defcmp,
  35. fmodule,
  36. { pass 1 }
  37. node,pass_1,
  38. nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,nmem,
  39. { codegen }
  40. ncgutil,
  41. { parser }
  42. scanner,
  43. pbase,pexpr,ptype,ptconst,pdecsub,
  44. { link }
  45. import
  46. {$ifdef Delphi}
  47. ,dmisc
  48. ,sysutils
  49. {$endif}
  50. ;
  51. function read_property_dec(aclass:tobjectdef):tpropertysym;
  52. { convert a node tree to symlist and return the last
  53. symbol }
  54. function parse_symlist(pl:tsymlist;var def:tdef):boolean;
  55. var
  56. idx : longint;
  57. sym : tsym;
  58. srsymtable : tsymtable;
  59. st : tsymtable;
  60. begin
  61. result:=true;
  62. def:=nil;
  63. if token=_ID then
  64. begin
  65. if assigned(aclass) then
  66. sym:=search_class_member(aclass,pattern)
  67. else
  68. searchsym(pattern,sym,srsymtable);
  69. if assigned(sym) then
  70. begin
  71. case sym.typ of
  72. varsym :
  73. begin
  74. pl.addsym(sl_load,sym);
  75. def:=tvarsym(sym).vartype.def;
  76. end;
  77. procsym :
  78. begin
  79. pl.addsym(sl_call,sym);
  80. end;
  81. end;
  82. end
  83. else
  84. begin
  85. Message1(parser_e_illegal_field_or_method,pattern);
  86. result:=false;
  87. end;
  88. consume(_ID);
  89. repeat
  90. case token of
  91. _ID,
  92. _SEMICOLON :
  93. begin
  94. break;
  95. end;
  96. _POINT :
  97. begin
  98. consume(_POINT);
  99. if assigned(def) then
  100. begin
  101. st:=def.getsymtable(gs_record);
  102. if assigned(st) then
  103. begin
  104. sym:=searchsymonlyin(st,pattern);
  105. if assigned(sym) then
  106. begin
  107. pl.addsym(sl_subscript,sym);
  108. case sym.typ of
  109. varsym :
  110. def:=tvarsym(sym).vartype.def;
  111. else
  112. begin
  113. Message1(sym_e_illegal_field,pattern);
  114. result:=false;
  115. end;
  116. end;
  117. end
  118. else
  119. begin
  120. Message1(sym_e_illegal_field,pattern);
  121. result:=false;
  122. end;
  123. end
  124. else
  125. begin
  126. Message(cg_e_invalid_qualifier);
  127. result:=false;
  128. end;
  129. end
  130. else
  131. begin
  132. Message(cg_e_invalid_qualifier);
  133. result:=false;
  134. end;
  135. consume(_ID);
  136. end;
  137. _LECKKLAMMER :
  138. begin
  139. consume(_LECKKLAMMER);
  140. repeat
  141. if def.deftype=arraydef then
  142. begin
  143. idx:=get_intconst;
  144. pl.addconst(sl_vec,idx);
  145. def:=tarraydef(def).elementtype.def;
  146. end
  147. else
  148. begin
  149. Message(cg_e_invalid_qualifier);
  150. result:=false;
  151. end;
  152. until not try_to_consume(_COMMA);
  153. consume(_RECKKLAMMER);
  154. end;
  155. else
  156. begin
  157. Message(parser_e_ill_property_access_sym);
  158. result:=false;
  159. break;
  160. end;
  161. end;
  162. until false;
  163. end
  164. else
  165. begin
  166. Message(parser_e_ill_property_access_sym);
  167. result:=false;
  168. end;
  169. end;
  170. var
  171. sym : tsym;
  172. p : tpropertysym;
  173. overriden : tsym;
  174. hs : string;
  175. varspez : tvarspez;
  176. s : string;
  177. tt : ttype;
  178. arraytype : ttype;
  179. def : tdef;
  180. pt : tnode;
  181. propname : stringid;
  182. sc : tsinglelist;
  183. oldregisterdef : boolean;
  184. readvs,
  185. hvs : tvarsym;
  186. readprocdef,
  187. writeprocdef : tprocvardef;
  188. begin
  189. { Generate temp procvardefs to search for matching read/write
  190. procedures. the readprocdef will store all definitions }
  191. oldregisterdef:=registerdef;
  192. registerdef:=false;
  193. readprocdef:=tprocvardef.create(normal_function_level);
  194. writeprocdef:=tprocvardef.create(normal_function_level);
  195. registerdef:=oldregisterdef;
  196. { make it method pointers }
  197. if assigned(aclass) then
  198. begin
  199. include(readprocdef.procoptions,po_methodpointer);
  200. include(writeprocdef.procoptions,po_methodpointer);
  201. end;
  202. if token<>_ID then
  203. begin
  204. consume(_ID);
  205. consume(_SEMICOLON);
  206. exit;
  207. end;
  208. { Generate propertysym and insert in symtablestack }
  209. p:=tpropertysym.create(orgpattern);
  210. symtablestack.insert(p);
  211. propname:=pattern;
  212. consume(_ID);
  213. { Set the symtablestack to the parast of readprop so
  214. temp defs will be destroyed after declaration }
  215. readprocdef.parast.next:=symtablestack;
  216. symtablestack:=readprocdef.parast;
  217. { property parameters ? }
  218. if token=_LECKKLAMMER then
  219. begin
  220. if (sp_published in current_object_option) then
  221. Message(parser_e_cant_publish_that_property);
  222. { create a list of the parameters }
  223. sc:=tsinglelist.create;
  224. consume(_LECKKLAMMER);
  225. inc(testcurobject);
  226. repeat
  227. if token=_VAR then
  228. begin
  229. consume(_VAR);
  230. varspez:=vs_var;
  231. end
  232. else if token=_CONST then
  233. begin
  234. consume(_CONST);
  235. varspez:=vs_const;
  236. end
  237. else if (idtoken=_OUT) and (m_out in aktmodeswitches) then
  238. begin
  239. consume(_OUT);
  240. varspez:=vs_out;
  241. end
  242. else
  243. varspez:=vs_value;
  244. sc.reset;
  245. repeat
  246. readvs:=tvarsym.create(orgpattern,varspez,generrortype);
  247. readprocdef.parast.insert(readvs);
  248. sc.insert(readvs);
  249. consume(_ID);
  250. until not try_to_consume(_COMMA);
  251. if token=_COLON then
  252. begin
  253. consume(_COLON);
  254. if token=_ARRAY then
  255. begin
  256. consume(_ARRAY);
  257. consume(_OF);
  258. { define range and type of range }
  259. tt.setdef(tarraydef.create(0,-1,s32bittype));
  260. { define field type }
  261. single_type(arraytype,s,false);
  262. tarraydef(tt.def).setelementtype(arraytype);
  263. end
  264. else
  265. single_type(tt,s,false);
  266. end
  267. else
  268. tt:=cformaltype;
  269. readvs:=tvarsym(sc.first);
  270. while assigned(readvs) do
  271. begin
  272. readprocdef.concatpara(nil,tt,readvs,nil,false);
  273. { also update the writeprocdef }
  274. hvs:=tvarsym.create(readvs.realname,vs_value,generrortype);
  275. writeprocdef.parast.insert(hvs);
  276. writeprocdef.concatpara(nil,tt,hvs,nil,false);
  277. readvs:=tvarsym(readvs.listnext);
  278. end;
  279. until not try_to_consume(_SEMICOLON);
  280. sc.free;
  281. dec(testcurobject);
  282. consume(_RECKKLAMMER);
  283. { the parser need to know if a property has parameters, the
  284. index parameter doesn't count (PFV) }
  285. if readprocdef.minparacount>0 then
  286. include(p.propoptions,ppo_hasparameters);
  287. end;
  288. { overriden property ? }
  289. { force property interface
  290. there is a property parameter
  291. a global property }
  292. if (token=_COLON) or (readprocdef.minparacount>0) or (aclass=nil) then
  293. begin
  294. consume(_COLON);
  295. single_type(p.proptype,hs,false);
  296. if (idtoken=_INDEX) then
  297. begin
  298. consume(_INDEX);
  299. pt:=comp_expr(true);
  300. if is_constnode(pt) and
  301. is_ordinal(pt.resulttype.def) and
  302. (not is_64bitint(pt.resulttype.def)) then
  303. p.index:=tordconstnode(pt).value
  304. else
  305. begin
  306. Message(parser_e_invalid_property_index_value);
  307. p.index:=0;
  308. end;
  309. p.indextype.setdef(pt.resulttype.def);
  310. include(p.propoptions,ppo_indexed);
  311. { concat a longint to the para templates }
  312. hvs:=tvarsym.create('$index',vs_value,p.indextype);
  313. readprocdef.parast.insert(hvs);
  314. readprocdef.concatpara(nil,p.indextype,hvs,nil,false);
  315. hvs:=tvarsym.create('$index',vs_value,p.indextype);
  316. writeprocdef.parast.insert(hvs);
  317. writeprocdef.concatpara(nil,p.indextype,hvs,nil,false);
  318. pt.free;
  319. end;
  320. end
  321. else
  322. begin
  323. { do an property override }
  324. overriden:=search_class_member(aclass.childof,propname);
  325. if assigned(overriden) and (overriden.typ=propertysym) then
  326. begin
  327. p.dooverride(tpropertysym(overriden));
  328. end
  329. else
  330. begin
  331. p.proptype:=generrortype;
  332. message(parser_e_no_property_found_to_override);
  333. end;
  334. end;
  335. if (sp_published in current_object_option) and
  336. not(p.proptype.def.is_publishable) then
  337. Message(parser_e_cant_publish_that_property);
  338. if try_to_consume(_READ) then
  339. begin
  340. p.readaccess.clear;
  341. if parse_symlist(p.readaccess,def) then
  342. begin
  343. sym:=p.readaccess.firstsym^.sym;
  344. case sym.typ of
  345. procsym :
  346. begin
  347. { read is function returning the type of the property }
  348. readprocdef.rettype:=p.proptype;
  349. { Insert hidden parameters }
  350. handle_calling_convention(readprocdef);
  351. calc_parast(readprocdef);
  352. { search procdefs matching readprocdef }
  353. p.readaccess.procdef:=Tprocsym(sym).search_procdef_bypara(readprocdef.para,p.proptype.def,[cpo_allowdefaults]);
  354. if not assigned(p.readaccess.procdef) then
  355. Message(parser_e_ill_property_access_sym);
  356. end;
  357. varsym :
  358. begin
  359. if not assigned(def) then
  360. internalerror(200310071);
  361. if compare_defs(def,p.proptype.def,nothingn)>=te_equal then
  362. begin
  363. { property parameters are allowed if this is
  364. an indexed property, because the index is then
  365. the parameter.
  366. Note: In the help of Kylix it is written
  367. that it isn't allowed, but the compiler accepts it (PFV) }
  368. if (ppo_hasparameters in p.propoptions) then
  369. Message(parser_e_ill_property_access_sym);
  370. end
  371. else
  372. IncompatibleTypes(def,p.proptype.def);
  373. end;
  374. else
  375. Message(parser_e_ill_property_access_sym);
  376. end;
  377. end;
  378. end;
  379. if try_to_consume(_WRITE) then
  380. begin
  381. p.writeaccess.clear;
  382. if parse_symlist(p.writeaccess,def) then
  383. begin
  384. sym:=p.writeaccess.firstsym^.sym;
  385. case sym.typ of
  386. procsym :
  387. begin
  388. { write is a procedure with an extra value parameter
  389. of the of the property }
  390. writeprocdef.rettype:=voidtype;
  391. hvs:=tvarsym.create('$value',vs_value,p.proptype);
  392. writeprocdef.parast.insert(hvs);
  393. writeprocdef.concatpara(nil,p.proptype,hvs,nil,false);
  394. { Insert hidden parameters }
  395. handle_calling_convention(writeprocdef);
  396. calc_parast(writeprocdef);
  397. { search procdefs matching writeprocdef }
  398. p.writeaccess.procdef:=Tprocsym(sym).search_procdef_bypara(writeprocdef.para,writeprocdef.rettype.def,[cpo_allowdefaults]);
  399. if not assigned(p.writeaccess.procdef) then
  400. Message(parser_e_ill_property_access_sym);
  401. end;
  402. varsym :
  403. begin
  404. if not assigned(def) then
  405. internalerror(200310072);
  406. if compare_defs(def,p.proptype.def,nothingn)>=te_equal then
  407. begin
  408. { property parameters are allowed if this is
  409. an indexed property, because the index is then
  410. the parameter.
  411. Note: In the help of Kylix it is written
  412. that it isn't allowed, but the compiler accepts it (PFV) }
  413. if (ppo_hasparameters in p.propoptions) then
  414. Message(parser_e_ill_property_access_sym);
  415. end
  416. else
  417. IncompatibleTypes(def,p.proptype.def);
  418. end;
  419. else
  420. Message(parser_e_ill_property_access_sym);
  421. end;
  422. end;
  423. end;
  424. if assigned(aclass) then
  425. begin
  426. include(p.propoptions,ppo_stored);
  427. if try_to_consume(_STORED) then
  428. begin
  429. p.storedaccess.clear;
  430. case token of
  431. _ID:
  432. begin
  433. { in the case that idtoken=_DEFAULT }
  434. { we have to do nothing except }
  435. { setting ppo_stored, it's the same }
  436. { as stored true }
  437. if idtoken<>_DEFAULT then
  438. begin
  439. if parse_symlist(p.storedaccess,def) then
  440. begin
  441. sym:=p.storedaccess.firstsym^.sym;
  442. case sym.typ of
  443. procsym :
  444. begin
  445. p.storedaccess.procdef:=Tprocsym(sym).search_procdef_nopara_boolret;
  446. if not assigned(p.storedaccess.procdef) then
  447. message(parser_e_ill_property_storage_sym);
  448. end;
  449. varsym :
  450. begin
  451. if not assigned(def) then
  452. internalerror(200310073);
  453. if (ppo_hasparameters in p.propoptions) or
  454. not(is_boolean(def)) then
  455. Message(parser_e_stored_property_must_be_boolean);
  456. end;
  457. else
  458. Message(parser_e_ill_property_access_sym);
  459. end;
  460. end;
  461. end;
  462. end;
  463. _FALSE:
  464. begin
  465. consume(_FALSE);
  466. exclude(p.propoptions,ppo_stored);
  467. end;
  468. _TRUE:
  469. consume(_TRUE);
  470. end;
  471. end;
  472. end;
  473. if try_to_consume(_DEFAULT) then
  474. begin
  475. if not(is_ordinal(p.proptype.def) or
  476. is_64bitint(p.proptype.def) or
  477. is_class(p.proptype.def) or
  478. is_single(p.proptype.def) or
  479. (p.proptype.def.deftype in [classrefdef,pointerdef]) or
  480. ((p.proptype.def.deftype=setdef) and
  481. (tsetdef(p.proptype.def).settype=smallset))) or
  482. ((p.proptype.def.deftype=arraydef) and
  483. (ppo_indexed in p.propoptions)) or
  484. (ppo_hasparameters in p.propoptions) then
  485. begin
  486. Message(parser_e_property_cant_have_a_default_value);
  487. { Error recovery }
  488. pt:=comp_expr(true);
  489. pt.free;
  490. end
  491. else
  492. begin
  493. { Get the result of the default, the firstpass is
  494. needed to support values like -1 }
  495. pt:=comp_expr(true);
  496. if (p.proptype.def.deftype=setdef) and
  497. (pt.nodetype=arrayconstructorn) then
  498. begin
  499. arrayconstructor_to_set(pt);
  500. do_resulttypepass(pt);
  501. end;
  502. inserttypeconv(pt,p.proptype);
  503. if not(is_constnode(pt)) then
  504. Message(parser_e_property_default_value_must_const);
  505. { Set default value }
  506. case pt.nodetype of
  507. setconstn :
  508. p.default:=plongint(tsetconstnode(pt).value_set)^;
  509. ordconstn :
  510. p.default:=tordconstnode(pt).value;
  511. niln :
  512. p.default:=0;
  513. realconstn:
  514. p.default:=longint(single(trealconstnode(pt).value_real));
  515. end;
  516. pt.free;
  517. end;
  518. end
  519. else if try_to_consume(_NODEFAULT) then
  520. begin
  521. p.default:=0;
  522. end;
  523. { remove temporary procvardefs }
  524. symtablestack:=symtablestack.next;
  525. readprocdef.free;
  526. writeprocdef.free;
  527. result:=p;
  528. end;
  529. const
  530. variantrecordlevel : longint = 0;
  531. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  532. { reads the filed of a record into a }
  533. { symtablestack, if record=false }
  534. { variants are forbidden, so this procedure }
  535. { can be used to read object fields }
  536. { if absolute is true, ABSOLUTE and file }
  537. { types are allowed }
  538. { => the procedure is also used to read }
  539. { a sequence of variable declaration }
  540. procedure insert_syms(sc : tsinglelist;tt : ttype;is_threadvar : boolean; addsymopts : tsymoptions);
  541. { inserts the symbols of sc in st with def as definition or sym as ttypesym, sc is disposed }
  542. var
  543. vs,vs2 : tvarsym;
  544. begin
  545. vs:=tvarsym(sc.first);
  546. while assigned(vs) do
  547. begin
  548. vs.vartype:=tt;
  549. { insert any additional hint directives }
  550. vs.symoptions := vs.symoptions + addsymopts;
  551. if (sp_static in current_object_option) then
  552. include(vs.symoptions,sp_static);
  553. if is_threadvar then
  554. include(vs.varoptions,vo_is_thread_var);
  555. { static data fields are inserted in the globalsymtable }
  556. if (symtablestack.symtabletype=objectsymtable) and
  557. (sp_static in current_object_option) then
  558. begin
  559. vs2:=tvarsym.create('$'+lower(symtablestack.name^)+'_'+vs.name,vs_value,tt);
  560. symtablestack.defowner.owner.insert(vs2);
  561. insertbssdata(vs2);
  562. end
  563. else
  564. begin
  565. { external data is not possible here }
  566. case symtablestack.symtabletype of
  567. globalsymtable,
  568. staticsymtable :
  569. insertbssdata(vs);
  570. recordsymtable,
  571. objectsymtable :
  572. tabstractrecordsymtable(symtablestack).insertfield(vs,false);
  573. end;
  574. end;
  575. vs:=tvarsym(vs.listnext);
  576. end;
  577. end;
  578. var
  579. sc : tsinglelist;
  580. old_block_type : tblock_type;
  581. symdone : boolean;
  582. { to handle absolute }
  583. abssym : tabsolutesym;
  584. { c var }
  585. newtype : ttypesym;
  586. is_dll,
  587. is_gpc_name,is_cdecl,
  588. extern_var,export_var : boolean;
  589. old_current_object_option : tsymoptions;
  590. hs,sorg,C_name,dll_name : string;
  591. tt,casetype : ttype;
  592. { Delphi initialized vars }
  593. tconstsym : ttypedconstsym;
  594. { maxsize contains the max. size of a variant }
  595. { startvarrec contains the start of the variant part of a record }
  596. maxsize, startvarrecsize : longint;
  597. usedalign,
  598. minalignment,maxalignment,startvarrecalign : byte;
  599. hp,pt : tnode;
  600. vs,vs2 : tvarsym;
  601. srsym : tsym;
  602. oldsymtablestack,
  603. srsymtable : tsymtable;
  604. unionsymtable : trecordsymtable;
  605. offset : longint;
  606. uniondef : trecorddef;
  607. unionsym : tvarsym;
  608. uniontype : ttype;
  609. dummysymoptions : tsymoptions;
  610. begin
  611. old_current_object_option:=current_object_option;
  612. { all variables are public if not in a object declaration }
  613. if not is_object then
  614. current_object_option:=[sp_public];
  615. old_block_type:=block_type;
  616. block_type:=bt_type;
  617. is_gpc_name:=false;
  618. { Force an expected ID error message }
  619. if not (token in [_ID,_CASE,_END]) then
  620. consume(_ID);
  621. { read vars }
  622. sc:=tsinglelist.create;
  623. while (token=_ID) and
  624. not(is_object and (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED])) do
  625. begin
  626. sorg:=orgpattern;
  627. sc.reset;
  628. repeat
  629. vs:=tvarsym.create(orgpattern,vs_value,generrortype);
  630. symtablestack.insert(vs);
  631. if assigned(vs.owner) then
  632. sc.insert(vs)
  633. else
  634. vs.free;
  635. consume(_ID);
  636. until not try_to_consume(_COMMA);
  637. consume(_COLON);
  638. if (m_gpc in aktmodeswitches) and
  639. not(is_record or is_object or is_threadvar) and
  640. (token=_ID) and (orgpattern='__asmname__') then
  641. begin
  642. consume(_ID);
  643. C_name:=get_stringconst;
  644. Is_gpc_name:=true;
  645. end;
  646. { this is needed for Delphi mode at least
  647. but should be OK for all modes !! (PM) }
  648. ignore_equal:=true;
  649. if is_record or is_object then
  650. begin
  651. { for records, don't search the recordsymtable for
  652. the symbols of the types }
  653. oldsymtablestack:=symtablestack;
  654. symtablestack:=symtablestack.next;
  655. read_type(tt,'',false);
  656. symtablestack:=oldsymtablestack;
  657. end
  658. else
  659. read_type(tt,'',false);
  660. { Process procvar directives }
  661. if (tt.def.deftype=procvardef) and
  662. (tt.def.typesym=nil) and
  663. is_proc_directive(token,true) then
  664. begin
  665. newtype:=ttypesym.create('unnamed',tt);
  666. parse_var_proc_directives(tsym(newtype));
  667. newtype.restype.def:=nil;
  668. tt.def.typesym:=nil;
  669. newtype.free;
  670. end;
  671. { types that use init/final are not allowed in variant parts, but
  672. classes are allowed }
  673. if (variantrecordlevel>0) and
  674. (tt.def.needs_inittable and not is_class(tt.def)) then
  675. Message(parser_e_cant_use_inittable_here);
  676. ignore_equal:=false;
  677. symdone:=false;
  678. if is_gpc_name then
  679. begin
  680. vs:=tvarsym(sc.first);
  681. if assigned(vs.listnext) then
  682. Message(parser_e_absolute_only_one_var);
  683. vs.vartype:=tt;
  684. include(vs.varoptions,vo_is_C_var);
  685. vs.set_mangledname(target_info.Cprefix+sorg);
  686. include(vs.varoptions,vo_is_external);
  687. symdone:=true;
  688. end;
  689. { check for absolute }
  690. if not symdone and
  691. (idtoken=_ABSOLUTE) and not(is_record or is_object or is_threadvar) then
  692. begin
  693. consume(_ABSOLUTE);
  694. abssym:=nil;
  695. { only allowed for one var }
  696. vs:=tvarsym(sc.first);
  697. if assigned(vs.listnext) then
  698. Message(parser_e_absolute_only_one_var);
  699. { parse the rest }
  700. pt:=expr;
  701. { transform a procvar calln to loadn }
  702. if pt.nodetype=calln then
  703. load_procvar_from_calln(pt);
  704. { check allowed absolute types }
  705. if (pt.nodetype=stringconstn) or
  706. (is_constcharnode(pt)) then
  707. begin
  708. abssym:=tabsolutesym.create(vs.realname,tt);
  709. abssym.fileinfo:=vs.fileinfo;
  710. if pt.nodetype=stringconstn then
  711. hs:=strpas(tstringconstnode(pt).value_str)
  712. else
  713. hs:=chr(tordconstnode(pt).value);
  714. consume(token);
  715. abssym.abstyp:=toasm;
  716. abssym.asmname:=stringdup(hs);
  717. { replace the varsym }
  718. symtablestack.replace(vs,abssym);
  719. vs.free;
  720. end
  721. { address }
  722. else if is_constintnode(pt) and
  723. ((target_info.system in [system_i386_go32v2,system_i386_watcom,
  724. system_i386_wdosx,system_i386_win32]) or
  725. (m_objfpc in aktmodeswitches) or
  726. (m_delphi in aktmodeswitches)) then
  727. begin
  728. abssym:=tabsolutesym.create(vs.realname,tt);
  729. abssym.fileinfo:=vs.fileinfo;
  730. abssym.abstyp:=toaddr;
  731. abssym.absseg:=false;
  732. abssym.fieldoffset:=tordconstnode(pt).value;
  733. if (target_info.system in [system_i386_go32v2,system_i386_watcom]) and
  734. try_to_consume(_COLON) then
  735. begin
  736. pt.free;
  737. pt:=expr;
  738. if is_constintnode(pt) then
  739. begin
  740. abssym.fieldoffset:=abssym.fieldoffset shl 4+tordconstnode(pt).value;
  741. abssym.absseg:=true;
  742. end
  743. else
  744. Message(type_e_ordinal_expr_expected);
  745. end;
  746. symtablestack.replace(vs,abssym);
  747. vs.free;
  748. end
  749. { variable }
  750. else
  751. begin
  752. { remove subscriptn before checking for loadn }
  753. hp:=pt;
  754. while (hp.nodetype in [subscriptn,typeconvn,vecn]) do
  755. hp:=tsubscriptnode(hp).left;
  756. if (hp.nodetype=loadn) then
  757. begin
  758. { we should check the result type of loadn }
  759. if not (tloadnode(hp).symtableentry.typ in [varsym,typedconstsym]) then
  760. Message(parser_e_absolute_only_to_var_or_const);
  761. abssym:=tabsolutesym.create(vs.realname,tt);
  762. abssym.fileinfo:=vs.fileinfo;
  763. abssym.abstyp:=tovar;
  764. abssym.ref:=node_to_symlist(pt);
  765. symtablestack.replace(vs,abssym);
  766. vs.free;
  767. end
  768. else
  769. Message(parser_e_absolute_only_to_var_or_const);
  770. end;
  771. if assigned(abssym) then
  772. begin
  773. { try to consume the hint directives with absolute symbols }
  774. dummysymoptions:=[];
  775. try_consume_hintdirective(dummysymoptions);
  776. abssym.symoptions := abssym.symoptions + dummysymoptions;
  777. end;
  778. pt.free;
  779. symdone:=true;
  780. end;
  781. { Records and objects can't have default values }
  782. if is_record or is_object then
  783. begin
  784. { try to parse the hint directives }
  785. dummysymoptions:=[];
  786. try_consume_hintdirective(dummysymoptions);
  787. { for a record there doesn't need to be a ; before the END or ) }
  788. if not(token in [_END,_RKLAMMER]) then
  789. consume(_SEMICOLON);
  790. end
  791. else
  792. begin
  793. { Process procvar directives before = and ; }
  794. if (tt.def.deftype=procvardef) and
  795. (tt.def.typesym=nil) and
  796. is_proc_directive(token,true) then
  797. begin
  798. newtype:=ttypesym.create('unnamed',tt);
  799. parse_var_proc_directives(tsym(newtype));
  800. newtype.restype.def:=nil;
  801. tt.def.typesym:=nil;
  802. newtype.free;
  803. end;
  804. { try to parse the hint directives }
  805. dummysymoptions:=[];
  806. try_consume_hintdirective(dummysymoptions);
  807. { Handling of Delphi typed const = initialized vars ! }
  808. { When should this be rejected ?
  809. - in parasymtable
  810. - in record or object
  811. - ... (PM) }
  812. if (token=_EQUAL) and
  813. not(m_tp7 in aktmodeswitches) and
  814. not(symtablestack.symtabletype in [parasymtable]) and
  815. not is_record and
  816. not is_object then
  817. begin
  818. vs:=tvarsym(sc.first);
  819. if assigned(vs.listnext) then
  820. Message(parser_e_initialized_only_one_var);
  821. if is_threadvar then
  822. Message(parser_e_initialized_not_for_threadvar);
  823. if symtablestack.symtabletype=localsymtable then
  824. begin
  825. consume(_EQUAL);
  826. tconstsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
  827. vs.defaultconstsym:=tconstsym;
  828. symtablestack.insert(tconstsym);
  829. insertconstdata(tconstsym);
  830. readtypedconst(tt,tconstsym,false);
  831. end
  832. else
  833. begin
  834. tconstsym:=ttypedconstsym.createtype(vs.realname,tt,true);
  835. tconstsym.fileinfo:=vs.fileinfo;
  836. symtablestack.replace(vs,tconstsym);
  837. vs.free;
  838. insertconstdata(tconstsym);
  839. consume(_EQUAL);
  840. readtypedconst(tt,tconstsym,true);
  841. symdone:=true;
  842. end;
  843. consume(_SEMICOLON);
  844. end
  845. else
  846. begin
  847. consume(_SEMICOLON);
  848. end;
  849. end;
  850. { Add calling convention for procvars }
  851. if (tt.def.deftype=procvardef) and
  852. (tt.def.typesym=nil) then
  853. begin
  854. { Parse procvar directives after ; }
  855. if is_proc_directive(token,true) then
  856. begin
  857. newtype:=ttypesym.create('unnamed',tt);
  858. parse_var_proc_directives(tsym(newtype));
  859. newtype.restype.def:=nil;
  860. tt.def.typesym:=nil;
  861. newtype.free;
  862. end;
  863. { Add calling convention for procvar }
  864. handle_calling_convention(tprocvardef(tt.def));
  865. calc_parast(tprocvardef(tt.def));
  866. end;
  867. { Check for variable directives }
  868. if not symdone and (token=_ID) then
  869. begin
  870. { Check for C Variable declarations }
  871. if (m_cvar_support in aktmodeswitches) and
  872. not(is_record or is_object or is_threadvar) and
  873. (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR]) then
  874. begin
  875. { only allowed for one var }
  876. vs:=tvarsym(sc.first);
  877. if assigned(vs.listnext) then
  878. Message(parser_e_absolute_only_one_var);
  879. { set type of the var }
  880. vs.vartype:=tt;
  881. vs.symoptions := vs.symoptions + dummysymoptions;
  882. { defaults }
  883. is_dll:=false;
  884. is_cdecl:=false;
  885. extern_var:=false;
  886. export_var:=false;
  887. C_name:=sorg;
  888. { cdecl }
  889. if idtoken=_CVAR then
  890. begin
  891. consume(_CVAR);
  892. consume(_SEMICOLON);
  893. is_cdecl:=true;
  894. C_name:=target_info.Cprefix+sorg;
  895. end;
  896. { external }
  897. if idtoken=_EXTERNAL then
  898. begin
  899. consume(_EXTERNAL);
  900. extern_var:=true;
  901. end;
  902. { export }
  903. if idtoken in [_EXPORT,_PUBLIC] then
  904. begin
  905. consume(_ID);
  906. if extern_var or
  907. (symtablestack.symtabletype in [parasymtable,localsymtable]) then
  908. Message(parser_e_not_external_and_export)
  909. else
  910. export_var:=true;
  911. end;
  912. { external and export need a name after when no cdecl is used }
  913. if not is_cdecl then
  914. begin
  915. { dll name ? }
  916. if (extern_var) and (idtoken<>_NAME) then
  917. begin
  918. is_dll:=true;
  919. dll_name:=get_stringconst;
  920. end;
  921. consume(_NAME);
  922. C_name:=get_stringconst;
  923. end;
  924. { consume the ; when export or external is used }
  925. if extern_var or export_var then
  926. consume(_SEMICOLON);
  927. { set some vars options }
  928. if is_dll then
  929. include(vs.varoptions,vo_is_dll_var)
  930. else
  931. include(vs.varoptions,vo_is_C_var);
  932. vs.set_mangledname(C_Name);
  933. if export_var then
  934. begin
  935. inc(vs.refs);
  936. include(vs.varoptions,vo_is_exported);
  937. end;
  938. if extern_var then
  939. include(vs.varoptions,vo_is_external);
  940. { insert in the datasegment when it is not external }
  941. if (not extern_var) then
  942. insertbssdata(vs);
  943. { now we can insert it in the import lib if its a dll, or
  944. add it to the externals }
  945. if extern_var then
  946. begin
  947. if is_dll then
  948. begin
  949. if not(current_module.uses_imports) then
  950. begin
  951. current_module.uses_imports:=true;
  952. importlib.preparelib(current_module.modulename^);
  953. end;
  954. importlib.importvariable(vs,C_name,dll_name);
  955. end
  956. else
  957. if target_info.DllScanSupported then
  958. current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
  959. end;
  960. symdone:=true;
  961. end
  962. else
  963. if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
  964. begin
  965. include(current_object_option,sp_static);
  966. insert_syms(sc,tt,false,dummysymoptions);
  967. exclude(current_object_option,sp_static);
  968. consume(_STATIC);
  969. consume(_SEMICOLON);
  970. symdone:=true;
  971. end;
  972. end;
  973. { insert it in the symtable, if not done yet }
  974. if not symdone then
  975. begin
  976. { save object option, because we can turn of the sp_published }
  977. if (sp_published in current_object_option) and
  978. not(is_class(tt.def)) then
  979. begin
  980. Message(parser_e_cant_publish_that);
  981. exclude(current_object_option,sp_published);
  982. { recover by changing access type to public }
  983. vs2:=tvarsym(sc.first);
  984. while assigned (vs2) do
  985. begin
  986. exclude(vs2.symoptions,sp_published);
  987. include(vs2.symoptions,sp_public);
  988. vs2:=tvarsym(vs2.listnext);
  989. end;
  990. end
  991. else
  992. if (sp_published in current_object_option) and
  993. not(oo_can_have_published in tobjectdef(tt.def).objectoptions) then
  994. begin
  995. Message(parser_e_only_publishable_classes_can__be_published);
  996. exclude(current_object_option,sp_published);
  997. end;
  998. insert_syms(sc,tt,is_threadvar,dummysymoptions);
  999. current_object_option:=old_current_object_option;
  1000. end;
  1001. end;
  1002. { Check for Case }
  1003. if is_record and (token=_CASE) then
  1004. begin
  1005. maxsize:=0;
  1006. maxalignment:=0;
  1007. consume(_CASE);
  1008. sorg:=orgpattern;
  1009. hs:=pattern;
  1010. searchsym(hs,srsym,srsymtable);
  1011. { may be only a type: }
  1012. if assigned(srsym) and (srsym.typ in [typesym,unitsym]) then
  1013. begin
  1014. { for records, don't search the recordsymtable for
  1015. the symbols of the types }
  1016. oldsymtablestack:=symtablestack;
  1017. symtablestack:=symtablestack.next;
  1018. read_type(casetype,'',true);
  1019. symtablestack:=oldsymtablestack;
  1020. end
  1021. else
  1022. begin
  1023. consume(_ID);
  1024. consume(_COLON);
  1025. { for records, don't search the recordsymtable for
  1026. the symbols of the types }
  1027. oldsymtablestack:=symtablestack;
  1028. symtablestack:=symtablestack.next;
  1029. read_type(casetype,'',true);
  1030. symtablestack:=oldsymtablestack;
  1031. vs:=tvarsym.create(sorg,vs_value,casetype);
  1032. tabstractrecordsymtable(symtablestack).insertfield(vs,true);
  1033. end;
  1034. if not(is_ordinal(casetype.def)) or is_64bitint(casetype.def) then
  1035. Message(type_e_ordinal_expr_expected);
  1036. consume(_OF);
  1037. UnionSymtable:=trecordsymtable.create;
  1038. Unionsymtable.next:=symtablestack;
  1039. registerdef:=false;
  1040. UnionDef:=trecorddef.create(unionsymtable);
  1041. uniondef.isunion:=true;
  1042. if assigned(symtablestack.defowner) then
  1043. Uniondef.owner:=symtablestack.defowner.owner;
  1044. registerdef:=true;
  1045. startvarrecsize:=UnionSymtable.datasize;
  1046. startvarrecalign:=UnionSymtable.dataalignment;
  1047. symtablestack:=UnionSymtable;
  1048. repeat
  1049. repeat
  1050. pt:=comp_expr(true);
  1051. if not(pt.nodetype=ordconstn) then
  1052. Message(cg_e_illegal_expression);
  1053. pt.free;
  1054. if token=_COMMA then
  1055. consume(_COMMA)
  1056. else
  1057. break;
  1058. until false;
  1059. consume(_COLON);
  1060. { read the vars }
  1061. consume(_LKLAMMER);
  1062. inc(variantrecordlevel);
  1063. if token<>_RKLAMMER then
  1064. read_var_decs(true,false,false);
  1065. dec(variantrecordlevel);
  1066. consume(_RKLAMMER);
  1067. { calculates maximal variant size }
  1068. maxsize:=max(maxsize,unionsymtable.datasize);
  1069. maxalignment:=max(maxalignment,unionsymtable.dataalignment);
  1070. { the items of the next variant are overlayed }
  1071. unionsymtable.datasize:=startvarrecsize;
  1072. unionsymtable.dataalignment:=startvarrecalign;
  1073. if (token<>_END) and (token<>_RKLAMMER) then
  1074. consume(_SEMICOLON)
  1075. else
  1076. break;
  1077. until (token=_END) or (token=_RKLAMMER);
  1078. { at last set the record size to that of the biggest variant }
  1079. unionsymtable.datasize:=maxsize;
  1080. unionsymtable.dataalignment:=maxalignment;
  1081. uniontype.def:=uniondef;
  1082. uniontype.sym:=nil;
  1083. UnionSym:=tvarsym.create('$case',vs_value,uniontype);
  1084. symtablestack:=symtablestack.next;
  1085. { we do NOT call symtablestack.insert
  1086. on purpose PM }
  1087. if aktalignment.recordalignmax=-1 then
  1088. begin
  1089. {$ifdef i386}
  1090. if maxalignment>2 then
  1091. minalignment:=4
  1092. else if maxalignment>1 then
  1093. minalignment:=2
  1094. else
  1095. minalignment:=1;
  1096. {$else}
  1097. {$ifdef m68k}
  1098. minalignment:=2;
  1099. {$endif}
  1100. minalignment:=1;
  1101. {$endif}
  1102. end
  1103. else
  1104. minalignment:=maxalignment;
  1105. usedalign:=used_align(maxalignment,minalignment,maxalignment);
  1106. offset:=align(trecordsymtable(symtablestack).datasize,usedalign);
  1107. trecordsymtable(symtablestack).datasize:=offset+unionsymtable.datasize;
  1108. if maxalignment>trecordsymtable(symtablestack).dataalignment then
  1109. trecordsymtable(symtablestack).dataalignment:=maxalignment;
  1110. Unionsymtable.Insert_in(trecordsymtable(symtablestack),offset);
  1111. Unionsym.owner:=nil;
  1112. unionsym.free;
  1113. uniondef.owner:=nil;
  1114. uniondef.free;
  1115. end;
  1116. block_type:=old_block_type;
  1117. current_object_option:=old_current_object_option;
  1118. { free the list }
  1119. sc.free;
  1120. end;
  1121. end.
  1122. {
  1123. $Log$
  1124. Revision 1.59 2003-12-10 16:37:01 peter
  1125. * global property support for fpc modes
  1126. Revision 1.58 2003/11/23 17:05:15 peter
  1127. * register calling is left-right
  1128. * parameter ordering
  1129. * left-right calling inserts result parameter last
  1130. Revision 1.57 2003/10/28 15:36:01 peter
  1131. * absolute to object field supported, fixes tb0458
  1132. Revision 1.56 2003/10/05 12:55:37 peter
  1133. * allow absolute with value for win32,wdos
  1134. Revision 1.55 2003/10/03 14:45:09 peter
  1135. * more proc directive for procvar fixes
  1136. Revision 1.54 2003/10/02 21:13:09 peter
  1137. * procvar directive parsing fixes
  1138. Revision 1.53 2003/10/02 15:12:07 peter
  1139. * fix type parsing in records
  1140. Revision 1.52 2003/10/01 19:05:33 peter
  1141. * searchsym_type to search for type definitions. It ignores
  1142. records,objects and parameters
  1143. Revision 1.51 2003/09/23 17:56:05 peter
  1144. * locals and paras are allocated in the code generation
  1145. * tvarsym.localloc contains the location of para/local when
  1146. generating code for the current procedure
  1147. Revision 1.50 2003/09/07 14:14:51 florian
  1148. * proper error recovering from invalid published fields
  1149. Revision 1.49 2003/09/05 17:41:12 florian
  1150. * merged Wiktor's Watcom patches in 1.1
  1151. Revision 1.48 2003/07/02 22:18:04 peter
  1152. * paraloc splitted in callerparaloc,calleeparaloc
  1153. * sparc calling convention updates
  1154. Revision 1.47 2003/05/09 17:47:03 peter
  1155. * self moved to hidden parameter
  1156. * removed hdisposen,hnewn,selfn
  1157. Revision 1.46 2003/04/25 20:59:33 peter
  1158. * removed funcretn,funcretsym, function result is now in varsym
  1159. and aliases for result and function name are added using absolutesym
  1160. * vs_hidden parameter for funcret passed in parameter
  1161. * vs_hidden fixes
  1162. * writenode changed to printnode and released from extdebug
  1163. * -vp option added to generate a tree.log with the nodetree
  1164. * nicer printnode for statements, callnode
  1165. Revision 1.45 2003/03/17 18:56:02 peter
  1166. * fix crash with duplicate id
  1167. Revision 1.44 2003/01/02 11:14:02 michael
  1168. + Patch from peter to support initial values for local variables
  1169. Revision 1.43 2002/12/27 15:22:20 peter
  1170. * don't allow initialized threadvars
  1171. Revision 1.42 2002/12/07 14:04:59 carl
  1172. * convert some vars from longint -> byte
  1173. Revision 1.41 2002/11/29 22:31:19 carl
  1174. + unimplemented hint directive added
  1175. * hint directive parsing implemented
  1176. * warning on these directives
  1177. Revision 1.40 2002/11/25 17:43:21 peter
  1178. * splitted defbase in defutil,symutil,defcmp
  1179. * merged isconvertable and is_equal into compare_defs(_ext)
  1180. * made operator search faster by walking the list only once
  1181. Revision 1.39 2002/11/15 16:29:31 peter
  1182. * made tasmsymbol.refs private (merged)
  1183. Revision 1.38 2002/11/15 01:58:53 peter
  1184. * merged changes from 1.0.7 up to 04-11
  1185. - -V option for generating bug report tracing
  1186. - more tracing for option parsing
  1187. - errors for cdecl and high()
  1188. - win32 import stabs
  1189. - win32 records<=8 are returned in eax:edx (turned off by default)
  1190. - heaptrc update
  1191. - more info for temp management in .s file with EXTDEBUG
  1192. Revision 1.37 2002/10/05 15:18:43 carl
  1193. * fix heap leaks
  1194. Revision 1.36 2002/10/05 12:43:26 carl
  1195. * fixes for Delphi 6 compilation
  1196. (warning : Some features do not work under Delphi)
  1197. Revision 1.35 2002/10/04 20:53:05 carl
  1198. * bugfix of crash
  1199. Revision 1.34 2002/10/03 21:22:01 carl
  1200. * don't make the vars regable if they are absolute and their definitions
  1201. are not the same.
  1202. Revision 1.33 2002/09/16 18:08:45 peter
  1203. * fix setting of sp_static
  1204. Revision 1.32 2002/09/09 17:34:15 peter
  1205. * tdicationary.replace added to replace and item in a dictionary. This
  1206. is only allowed for the same name
  1207. * varsyms are inserted in symtable before the types are parsed. This
  1208. fixes the long standing "var longint : longint" bug
  1209. - consume_idlist and idstringlist removed. The loops are inserted
  1210. at the callers place and uses the symtable for duplicate id checking
  1211. Revision 1.31 2002/08/25 19:25:20 peter
  1212. * sym.insert_in_data removed
  1213. * symtable.insertvardata/insertconstdata added
  1214. * removed insert_in_data call from symtable.insert, it needs to be
  1215. called separatly. This allows to deref the address calculation
  1216. * procedures now calculate the parast addresses after the procedure
  1217. directives are parsed. This fixes the cdecl parast problem
  1218. * push_addr_param has an extra argument that specifies if cdecl is used
  1219. or not
  1220. Revision 1.30 2002/07/29 21:23:44 florian
  1221. * more fixes for the ppc
  1222. + wrappers for the tcnvnode.first_* stuff introduced
  1223. Revision 1.29 2002/07/26 21:15:40 florian
  1224. * rewrote the system handling
  1225. Revision 1.28 2002/07/20 11:57:55 florian
  1226. * types.pas renamed to defbase.pas because D6 contains a types
  1227. unit so this would conflicts if D6 programms are compiled
  1228. + Willamette/SSE2 instructions to assembler added
  1229. Revision 1.27 2002/06/10 13:41:26 jonas
  1230. * fixed bug 1985
  1231. Revision 1.26 2002/05/18 13:34:12 peter
  1232. * readded missing revisions
  1233. Revision 1.25 2002/05/16 19:46:43 carl
  1234. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1235. + try to fix temp allocation (still in ifdef)
  1236. + generic constructor calls
  1237. + start of tassembler / tmodulebase class cleanup
  1238. Revision 1.23 2002/04/21 18:57:24 peter
  1239. * fixed memleaks when file can't be opened
  1240. }