pdecvar.pas 52 KB

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