pdecvar.pas 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  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,s32inttype));
  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. 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.fieldoffset:=tordconstnode(pt).value;
  732. {$ifdef i386}
  733. abssym.absseg:=false;
  734. if (target_info.system in [system_i386_go32v2,system_i386_watcom]) and
  735. try_to_consume(_COLON) then
  736. begin
  737. pt.free;
  738. pt:=expr;
  739. if is_constintnode(pt) then
  740. begin
  741. abssym.fieldoffset:=abssym.fieldoffset shl 4+tordconstnode(pt).value;
  742. abssym.absseg:=true;
  743. end
  744. else
  745. Message(type_e_ordinal_expr_expected);
  746. end;
  747. {$endif i386}
  748. symtablestack.replace(vs,abssym);
  749. vs.free;
  750. end
  751. { variable }
  752. else
  753. begin
  754. { remove subscriptn before checking for loadn }
  755. hp:=pt;
  756. while (hp.nodetype in [subscriptn,typeconvn,vecn]) do
  757. hp:=tsubscriptnode(hp).left;
  758. if (hp.nodetype=loadn) then
  759. begin
  760. { we should check the result type of loadn }
  761. if not (tloadnode(hp).symtableentry.typ in [varsym,typedconstsym]) then
  762. Message(parser_e_absolute_only_to_var_or_const);
  763. abssym:=tabsolutesym.create(vs.realname,tt);
  764. abssym.fileinfo:=vs.fileinfo;
  765. abssym.abstyp:=tovar;
  766. abssym.ref:=node_to_symlist(pt);
  767. symtablestack.replace(vs,abssym);
  768. vs.free;
  769. end
  770. else
  771. Message(parser_e_absolute_only_to_var_or_const);
  772. end;
  773. if assigned(abssym) then
  774. begin
  775. { try to consume the hint directives with absolute symbols }
  776. dummysymoptions:=[];
  777. try_consume_hintdirective(dummysymoptions);
  778. abssym.symoptions := abssym.symoptions + dummysymoptions;
  779. end;
  780. pt.free;
  781. symdone:=true;
  782. end;
  783. { Records and objects can't have default values }
  784. if is_record or is_object then
  785. begin
  786. { try to parse the hint directives }
  787. dummysymoptions:=[];
  788. try_consume_hintdirective(dummysymoptions);
  789. { for a record there doesn't need to be a ; before the END or ) }
  790. if not(token in [_END,_RKLAMMER]) then
  791. consume(_SEMICOLON);
  792. end
  793. else
  794. begin
  795. { Process procvar directives before = and ; }
  796. if (tt.def.deftype=procvardef) and
  797. (tt.def.typesym=nil) and
  798. is_proc_directive(token,true) then
  799. begin
  800. newtype:=ttypesym.create('unnamed',tt);
  801. parse_var_proc_directives(tsym(newtype));
  802. newtype.restype.def:=nil;
  803. tt.def.typesym:=nil;
  804. newtype.free;
  805. end;
  806. { try to parse the hint directives }
  807. dummysymoptions:=[];
  808. try_consume_hintdirective(dummysymoptions);
  809. { Handling of Delphi typed const = initialized vars ! }
  810. { When should this be rejected ?
  811. - in parasymtable
  812. - in record or object
  813. - ... (PM) }
  814. if (token=_EQUAL) and
  815. not(m_tp7 in aktmodeswitches) and
  816. not(symtablestack.symtabletype in [parasymtable]) and
  817. not is_record and
  818. not is_object then
  819. begin
  820. vs:=tvarsym(sc.first);
  821. if assigned(vs.listnext) then
  822. Message(parser_e_initialized_only_one_var);
  823. if is_threadvar then
  824. Message(parser_e_initialized_not_for_threadvar);
  825. if symtablestack.symtabletype=localsymtable then
  826. begin
  827. consume(_EQUAL);
  828. tconstsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
  829. vs.defaultconstsym:=tconstsym;
  830. symtablestack.insert(tconstsym);
  831. insertconstdata(tconstsym);
  832. readtypedconst(tt,tconstsym,false);
  833. end
  834. else
  835. begin
  836. tconstsym:=ttypedconstsym.createtype(vs.realname,tt,true);
  837. tconstsym.fileinfo:=vs.fileinfo;
  838. symtablestack.replace(vs,tconstsym);
  839. vs.free;
  840. insertconstdata(tconstsym);
  841. consume(_EQUAL);
  842. readtypedconst(tt,tconstsym,true);
  843. symdone:=true;
  844. end;
  845. consume(_SEMICOLON);
  846. end
  847. else
  848. begin
  849. consume(_SEMICOLON);
  850. end;
  851. end;
  852. { Add calling convention for procvars }
  853. if (tt.def.deftype=procvardef) and
  854. (tt.def.typesym=nil) then
  855. begin
  856. { Parse procvar directives after ; }
  857. if is_proc_directive(token,true) then
  858. begin
  859. newtype:=ttypesym.create('unnamed',tt);
  860. parse_var_proc_directives(tsym(newtype));
  861. newtype.restype.def:=nil;
  862. tt.def.typesym:=nil;
  863. newtype.free;
  864. end;
  865. { Add calling convention for procvar }
  866. handle_calling_convention(tprocvardef(tt.def));
  867. calc_parast(tprocvardef(tt.def));
  868. end;
  869. { Check for variable directives }
  870. if not symdone and (token=_ID) then
  871. begin
  872. { Check for C Variable declarations }
  873. if (m_cvar_support in aktmodeswitches) and
  874. not(is_record or is_object or is_threadvar) and
  875. (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR]) then
  876. begin
  877. { only allowed for one var }
  878. vs:=tvarsym(sc.first);
  879. if assigned(vs.listnext) then
  880. Message(parser_e_absolute_only_one_var);
  881. { set type of the var }
  882. vs.vartype:=tt;
  883. vs.symoptions := vs.symoptions + dummysymoptions;
  884. { defaults }
  885. is_dll:=false;
  886. is_cdecl:=false;
  887. extern_var:=false;
  888. export_var:=false;
  889. C_name:=sorg;
  890. { cdecl }
  891. if idtoken=_CVAR then
  892. begin
  893. consume(_CVAR);
  894. consume(_SEMICOLON);
  895. is_cdecl:=true;
  896. C_name:=target_info.Cprefix+sorg;
  897. end;
  898. { external }
  899. if idtoken=_EXTERNAL then
  900. begin
  901. consume(_EXTERNAL);
  902. extern_var:=true;
  903. end;
  904. { export }
  905. if idtoken in [_EXPORT,_PUBLIC] then
  906. begin
  907. consume(_ID);
  908. if extern_var or
  909. (symtablestack.symtabletype in [parasymtable,localsymtable]) then
  910. Message(parser_e_not_external_and_export)
  911. else
  912. export_var:=true;
  913. end;
  914. { external and export need a name after when no cdecl is used }
  915. if not is_cdecl then
  916. begin
  917. { dll name ? }
  918. if (extern_var) and (idtoken<>_NAME) then
  919. begin
  920. is_dll:=true;
  921. dll_name:=get_stringconst;
  922. end;
  923. consume(_NAME);
  924. C_name:=get_stringconst;
  925. end;
  926. { consume the ; when export or external is used }
  927. if extern_var or export_var then
  928. consume(_SEMICOLON);
  929. { set some vars options }
  930. if is_dll then
  931. include(vs.varoptions,vo_is_dll_var)
  932. else
  933. include(vs.varoptions,vo_is_C_var);
  934. vs.set_mangledname(C_Name);
  935. if export_var then
  936. begin
  937. inc(vs.refs);
  938. include(vs.varoptions,vo_is_exported);
  939. end;
  940. if extern_var then
  941. include(vs.varoptions,vo_is_external);
  942. { insert in the datasegment when it is not external }
  943. if (not extern_var) then
  944. insertbssdata(vs);
  945. { now we can insert it in the import lib if its a dll, or
  946. add it to the externals }
  947. if extern_var then
  948. begin
  949. if is_dll then
  950. begin
  951. if not(current_module.uses_imports) then
  952. begin
  953. current_module.uses_imports:=true;
  954. importlib.preparelib(current_module.modulename^);
  955. end;
  956. importlib.importvariable(vs,C_name,dll_name);
  957. end
  958. else
  959. if target_info.DllScanSupported then
  960. current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
  961. end;
  962. symdone:=true;
  963. end
  964. else
  965. if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
  966. begin
  967. include(current_object_option,sp_static);
  968. insert_syms(sc,tt,false,dummysymoptions);
  969. exclude(current_object_option,sp_static);
  970. consume(_STATIC);
  971. consume(_SEMICOLON);
  972. symdone:=true;
  973. end;
  974. end;
  975. { insert it in the symtable, if not done yet }
  976. if not symdone then
  977. begin
  978. { save object option, because we can turn of the sp_published }
  979. if (sp_published in current_object_option) and
  980. not(is_class(tt.def)) then
  981. begin
  982. Message(parser_e_cant_publish_that);
  983. exclude(current_object_option,sp_published);
  984. { recover by changing access type to public }
  985. vs2:=tvarsym(sc.first);
  986. while assigned (vs2) do
  987. begin
  988. exclude(vs2.symoptions,sp_published);
  989. include(vs2.symoptions,sp_public);
  990. vs2:=tvarsym(vs2.listnext);
  991. end;
  992. end
  993. else
  994. if (sp_published in current_object_option) and
  995. not(oo_can_have_published in tobjectdef(tt.def).objectoptions) then
  996. begin
  997. Message(parser_e_only_publishable_classes_can__be_published);
  998. exclude(current_object_option,sp_published);
  999. end;
  1000. insert_syms(sc,tt,is_threadvar,dummysymoptions);
  1001. current_object_option:=old_current_object_option;
  1002. end;
  1003. end;
  1004. { Check for Case }
  1005. if is_record and (token=_CASE) then
  1006. begin
  1007. maxsize:=0;
  1008. maxalignment:=0;
  1009. consume(_CASE);
  1010. sorg:=orgpattern;
  1011. hs:=pattern;
  1012. searchsym(hs,srsym,srsymtable);
  1013. { may be only a type: }
  1014. if assigned(srsym) and (srsym.typ in [typesym,unitsym]) then
  1015. begin
  1016. { for records, don't search the recordsymtable for
  1017. the symbols of the types }
  1018. oldsymtablestack:=symtablestack;
  1019. symtablestack:=symtablestack.next;
  1020. read_type(casetype,'',true);
  1021. symtablestack:=oldsymtablestack;
  1022. end
  1023. else
  1024. begin
  1025. consume(_ID);
  1026. consume(_COLON);
  1027. { for records, don't search the recordsymtable for
  1028. the symbols of the types }
  1029. oldsymtablestack:=symtablestack;
  1030. symtablestack:=symtablestack.next;
  1031. read_type(casetype,'',true);
  1032. symtablestack:=oldsymtablestack;
  1033. vs:=tvarsym.create(sorg,vs_value,casetype);
  1034. tabstractrecordsymtable(symtablestack).insertfield(vs,true);
  1035. end;
  1036. if not(is_ordinal(casetype.def)) or is_64bitint(casetype.def) then
  1037. Message(type_e_ordinal_expr_expected);
  1038. consume(_OF);
  1039. UnionSymtable:=trecordsymtable.create(aktpackrecords);
  1040. Unionsymtable.next:=symtablestack;
  1041. registerdef:=false;
  1042. UnionDef:=trecorddef.create(unionsymtable);
  1043. uniondef.isunion:=true;
  1044. if assigned(symtablestack.defowner) then
  1045. Uniondef.owner:=symtablestack.defowner.owner;
  1046. registerdef:=true;
  1047. startvarrecsize:=UnionSymtable.datasize;
  1048. startvarrecalign:=UnionSymtable.fieldalignment;
  1049. symtablestack:=UnionSymtable;
  1050. repeat
  1051. repeat
  1052. pt:=comp_expr(true);
  1053. if not(pt.nodetype=ordconstn) then
  1054. Message(cg_e_illegal_expression);
  1055. pt.free;
  1056. if token=_COMMA then
  1057. consume(_COMMA)
  1058. else
  1059. break;
  1060. until false;
  1061. consume(_COLON);
  1062. { read the vars }
  1063. consume(_LKLAMMER);
  1064. inc(variantrecordlevel);
  1065. if token<>_RKLAMMER then
  1066. read_var_decs(true,false,false);
  1067. dec(variantrecordlevel);
  1068. consume(_RKLAMMER);
  1069. { calculates maximal variant size }
  1070. maxsize:=max(maxsize,unionsymtable.datasize);
  1071. maxalignment:=max(maxalignment,unionsymtable.fieldalignment);
  1072. { the items of the next variant are overlayed }
  1073. unionsymtable.datasize:=startvarrecsize;
  1074. unionsymtable.fieldalignment:=startvarrecalign;
  1075. if (token<>_END) and (token<>_RKLAMMER) then
  1076. consume(_SEMICOLON)
  1077. else
  1078. break;
  1079. until (token=_END) or (token=_RKLAMMER);
  1080. { at last set the record size to that of the biggest variant }
  1081. unionsymtable.datasize:=maxsize;
  1082. unionsymtable.fieldalignment:=maxalignment;
  1083. uniontype.def:=uniondef;
  1084. uniontype.sym:=nil;
  1085. UnionSym:=tvarsym.create('$case',vs_value,uniontype);
  1086. symtablestack:=symtablestack.next;
  1087. { Align the offset where the union symtable is added }
  1088. usedalign:=used_align(maxalignment,aktalignment.recordalignmin,aktalignment.maxCrecordalign);
  1089. offset:=align(trecordsymtable(symtablestack).datasize,usedalign);
  1090. trecordsymtable(symtablestack).datasize:=offset+unionsymtable.datasize;
  1091. if maxalignment>trecordsymtable(symtablestack).fieldalignment then
  1092. trecordsymtable(symtablestack).fieldalignment:=maxalignment;
  1093. trecordsymtable(symtablestack).insertunionst(Unionsymtable,offset);
  1094. Unionsym.owner:=nil;
  1095. unionsym.free;
  1096. uniondef.owner:=nil;
  1097. uniondef.free;
  1098. end;
  1099. block_type:=old_block_type;
  1100. current_object_option:=old_current_object_option;
  1101. { free the list }
  1102. sc.free;
  1103. end;
  1104. end.
  1105. {
  1106. $Log$
  1107. Revision 1.64 2004-02-03 22:32:54 peter
  1108. * renamed xNNbittype to xNNinttype
  1109. * renamed registers32 to registersint
  1110. * replace some s32bit,u32bit with torddef([su]inttype).def.typ
  1111. Revision 1.63 2004/01/31 17:45:17 peter
  1112. * Change several $ifdef i386 to x86
  1113. * Change several OS_32 to OS_INT/OS_ADDR
  1114. Revision 1.62 2004/01/29 16:51:29 peter
  1115. * fixed alignment calculation for variant records
  1116. * fixed alignment padding of records
  1117. Revision 1.61 2004/01/28 22:16:31 peter
  1118. * more record alignment fixes
  1119. Revision 1.60 2004/01/28 20:30:18 peter
  1120. * record alignment splitted in fieldalignment and recordalignment,
  1121. the latter is used when this record is inserted in another record.
  1122. Revision 1.59 2003/12/10 16:37:01 peter
  1123. * global property support for fpc modes
  1124. Revision 1.58 2003/11/23 17:05:15 peter
  1125. * register calling is left-right
  1126. * parameter ordering
  1127. * left-right calling inserts result parameter last
  1128. Revision 1.57 2003/10/28 15:36:01 peter
  1129. * absolute to object field supported, fixes tb0458
  1130. Revision 1.56 2003/10/05 12:55:37 peter
  1131. * allow absolute with value for win32,wdos
  1132. Revision 1.55 2003/10/03 14:45:09 peter
  1133. * more proc directive for procvar fixes
  1134. Revision 1.54 2003/10/02 21:13:09 peter
  1135. * procvar directive parsing fixes
  1136. Revision 1.53 2003/10/02 15:12:07 peter
  1137. * fix type parsing in records
  1138. Revision 1.52 2003/10/01 19:05:33 peter
  1139. * searchsym_type to search for type definitions. It ignores
  1140. records,objects and parameters
  1141. Revision 1.51 2003/09/23 17:56:05 peter
  1142. * locals and paras are allocated in the code generation
  1143. * tvarsym.localloc contains the location of para/local when
  1144. generating code for the current procedure
  1145. Revision 1.50 2003/09/07 14:14:51 florian
  1146. * proper error recovering from invalid published fields
  1147. Revision 1.49 2003/09/05 17:41:12 florian
  1148. * merged Wiktor's Watcom patches in 1.1
  1149. Revision 1.48 2003/07/02 22:18:04 peter
  1150. * paraloc splitted in callerparaloc,calleeparaloc
  1151. * sparc calling convention updates
  1152. Revision 1.47 2003/05/09 17:47:03 peter
  1153. * self moved to hidden parameter
  1154. * removed hdisposen,hnewn,selfn
  1155. Revision 1.46 2003/04/25 20:59:33 peter
  1156. * removed funcretn,funcretsym, function result is now in varsym
  1157. and aliases for result and function name are added using absolutesym
  1158. * vs_hidden parameter for funcret passed in parameter
  1159. * vs_hidden fixes
  1160. * writenode changed to printnode and released from extdebug
  1161. * -vp option added to generate a tree.log with the nodetree
  1162. * nicer printnode for statements, callnode
  1163. Revision 1.45 2003/03/17 18:56:02 peter
  1164. * fix crash with duplicate id
  1165. Revision 1.44 2003/01/02 11:14:02 michael
  1166. + Patch from peter to support initial values for local variables
  1167. Revision 1.43 2002/12/27 15:22:20 peter
  1168. * don't allow initialized threadvars
  1169. Revision 1.42 2002/12/07 14:04:59 carl
  1170. * convert some vars from longint -> byte
  1171. Revision 1.41 2002/11/29 22:31:19 carl
  1172. + unimplemented hint directive added
  1173. * hint directive parsing implemented
  1174. * warning on these directives
  1175. Revision 1.40 2002/11/25 17:43:21 peter
  1176. * splitted defbase in defutil,symutil,defcmp
  1177. * merged isconvertable and is_equal into compare_defs(_ext)
  1178. * made operator search faster by walking the list only once
  1179. Revision 1.39 2002/11/15 16:29:31 peter
  1180. * made tasmsymbol.refs private (merged)
  1181. Revision 1.38 2002/11/15 01:58:53 peter
  1182. * merged changes from 1.0.7 up to 04-11
  1183. - -V option for generating bug report tracing
  1184. - more tracing for option parsing
  1185. - errors for cdecl and high()
  1186. - win32 import stabs
  1187. - win32 records<=8 are returned in eax:edx (turned off by default)
  1188. - heaptrc update
  1189. - more info for temp management in .s file with EXTDEBUG
  1190. Revision 1.37 2002/10/05 15:18:43 carl
  1191. * fix heap leaks
  1192. Revision 1.36 2002/10/05 12:43:26 carl
  1193. * fixes for Delphi 6 compilation
  1194. (warning : Some features do not work under Delphi)
  1195. Revision 1.35 2002/10/04 20:53:05 carl
  1196. * bugfix of crash
  1197. Revision 1.34 2002/10/03 21:22:01 carl
  1198. * don't make the vars regable if they are absolute and their definitions
  1199. are not the same.
  1200. Revision 1.33 2002/09/16 18:08:45 peter
  1201. * fix setting of sp_static
  1202. Revision 1.32 2002/09/09 17:34:15 peter
  1203. * tdicationary.replace added to replace and item in a dictionary. This
  1204. is only allowed for the same name
  1205. * varsyms are inserted in symtable before the types are parsed. This
  1206. fixes the long standing "var longint : longint" bug
  1207. - consume_idlist and idstringlist removed. The loops are inserted
  1208. at the callers place and uses the symtable for duplicate id checking
  1209. Revision 1.31 2002/08/25 19:25:20 peter
  1210. * sym.insert_in_data removed
  1211. * symtable.insertvardata/insertconstdata added
  1212. * removed insert_in_data call from symtable.insert, it needs to be
  1213. called separatly. This allows to deref the address calculation
  1214. * procedures now calculate the parast addresses after the procedure
  1215. directives are parsed. This fixes the cdecl parast problem
  1216. * push_addr_param has an extra argument that specifies if cdecl is used
  1217. or not
  1218. Revision 1.30 2002/07/29 21:23:44 florian
  1219. * more fixes for the ppc
  1220. + wrappers for the tcnvnode.first_* stuff introduced
  1221. Revision 1.29 2002/07/26 21:15:40 florian
  1222. * rewrote the system handling
  1223. Revision 1.28 2002/07/20 11:57:55 florian
  1224. * types.pas renamed to defbase.pas because D6 contains a types
  1225. unit so this would conflicts if D6 programms are compiled
  1226. + Willamette/SSE2 instructions to assembler added
  1227. Revision 1.27 2002/06/10 13:41:26 jonas
  1228. * fixed bug 1985
  1229. Revision 1.26 2002/05/18 13:34:12 peter
  1230. * readded missing revisions
  1231. Revision 1.25 2002/05/16 19:46:43 carl
  1232. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1233. + try to fix temp allocation (still in ifdef)
  1234. + generic constructor calls
  1235. + start of tassembler / tmodulebase class cleanup
  1236. Revision 1.23 2002/04/21 18:57:24 peter
  1237. * fixed memleaks when file can't be opened
  1238. }