pdecobj.pas 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Does object types for Free Pascal
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit pdecobj;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. globtype,symtype,symdef;
  23. { parses a object declaration }
  24. function object_dec(const n : stringid;fd : tobjectdef) : tdef;
  25. implementation
  26. uses
  27. cutils,cclasses,
  28. globals,verbose,systems,tokens,
  29. symconst,symbase,symsym,symtable,defutil,defcmp,
  30. node,nld,nmem,ncon,ncnv,ncal,pass_1,
  31. scanner,
  32. pbase,pexpr,pdecsub,pdecvar,ptype
  33. {$ifdef delphi}
  34. ,dmisc
  35. ,sysutils
  36. {$endif}
  37. ;
  38. const
  39. { Please leave this here, this module should NOT use
  40. these variables.
  41. Declaring it as string here results in an error when compiling (PFV) }
  42. current_procinfo = 'error';
  43. function object_dec(const n : stringid;fd : tobjectdef) : tdef;
  44. { this function parses an object or class declaration }
  45. var
  46. there_is_a_destructor : boolean;
  47. classtype : tobjectdeftype;
  48. childof : tobjectdef;
  49. aktclass : tobjectdef;
  50. function constructor_head:tprocdef;
  51. var
  52. pd : tprocdef;
  53. begin
  54. consume(_CONSTRUCTOR);
  55. { must be at same level as in implementation }
  56. pd:=parse_proc_head(aktclass,potype_constructor);
  57. if (cs_constructor_name in aktglobalswitches) and
  58. (pd.procsym.name<>'INIT') then
  59. Message(parser_e_constructorname_must_be_init);
  60. consume(_SEMICOLON);
  61. include(aktclass.objectoptions,oo_has_constructor);
  62. { Set return type, class constructors return the
  63. created instance, object constructors return boolean }
  64. if is_class(pd._class) then
  65. pd.rettype.setdef(pd._class)
  66. else
  67. pd.rettype:=booltype;
  68. constructor_head:=pd;
  69. end;
  70. procedure property_dec;
  71. { convert a node tree to symlist and return the last
  72. symbol }
  73. function parse_symlist(pl:tsymlist;var def:tdef):boolean;
  74. var
  75. idx : longint;
  76. sym : tsym;
  77. st : tsymtable;
  78. begin
  79. result:=true;
  80. def:=nil;
  81. if token=_ID then
  82. begin
  83. sym:=search_class_member(aktclass,pattern);
  84. if assigned(sym) then
  85. begin
  86. case sym.typ of
  87. varsym :
  88. begin
  89. pl.addsym(sl_load,sym);
  90. def:=tvarsym(sym).vartype.def;
  91. end;
  92. procsym :
  93. begin
  94. pl.addsym(sl_call,sym);
  95. end;
  96. end;
  97. end
  98. else
  99. begin
  100. Message1(parser_e_illegal_field_or_method,pattern);
  101. result:=false;
  102. end;
  103. consume(_ID);
  104. repeat
  105. case token of
  106. _ID,
  107. _SEMICOLON :
  108. begin
  109. break;
  110. end;
  111. _POINT :
  112. begin
  113. consume(_POINT);
  114. if assigned(def) then
  115. begin
  116. st:=def.getsymtable(gs_record);
  117. if assigned(st) then
  118. begin
  119. sym:=searchsymonlyin(st,pattern);
  120. if assigned(sym) then
  121. begin
  122. pl.addsym(sl_subscript,sym);
  123. case sym.typ of
  124. varsym :
  125. def:=tvarsym(sym).vartype.def;
  126. else
  127. begin
  128. Message1(sym_e_illegal_field,pattern);
  129. result:=false;
  130. end;
  131. end;
  132. end
  133. else
  134. begin
  135. Message1(sym_e_illegal_field,pattern);
  136. result:=false;
  137. end;
  138. end
  139. else
  140. begin
  141. Message(cg_e_invalid_qualifier);
  142. result:=false;
  143. end;
  144. end
  145. else
  146. begin
  147. Message(cg_e_invalid_qualifier);
  148. result:=false;
  149. end;
  150. consume(_ID);
  151. end;
  152. _LECKKLAMMER :
  153. begin
  154. consume(_LECKKLAMMER);
  155. repeat
  156. if def.deftype=arraydef then
  157. begin
  158. idx:=get_intconst;
  159. pl.addconst(sl_vec,idx);
  160. def:=tarraydef(def).elementtype.def;
  161. end
  162. else
  163. begin
  164. Message(cg_e_invalid_qualifier);
  165. result:=false;
  166. end;
  167. until not try_to_consume(_COMMA);
  168. consume(_RECKKLAMMER);
  169. end;
  170. else
  171. begin
  172. Message(parser_e_ill_property_access_sym);
  173. result:=false;
  174. break;
  175. end;
  176. end;
  177. until false;
  178. end
  179. else
  180. begin
  181. Message(parser_e_ill_property_access_sym);
  182. result:=false;
  183. end;
  184. end;
  185. var
  186. sym : tsym;
  187. p : tpropertysym;
  188. overriden : tsym;
  189. hs : string;
  190. varspez : tvarspez;
  191. s : string;
  192. tt : ttype;
  193. arraytype : ttype;
  194. def : tdef;
  195. pt : tnode;
  196. propname : stringid;
  197. sc : tsinglelist;
  198. oldregisterdef : boolean;
  199. readvs,
  200. hvs : tvarsym;
  201. readprocdef,
  202. writeprocdef : tprocvardef;
  203. begin
  204. { check for a class }
  205. if not((is_class_or_interface(aktclass)) or
  206. ((m_delphi in aktmodeswitches) and (is_object(aktclass)))) then
  207. Message(parser_e_syntax_error);
  208. consume(_PROPERTY);
  209. { Generate temp procvardefs to search for matching read/write
  210. procedures. the readprocdef will store all definitions }
  211. oldregisterdef:=registerdef;
  212. registerdef:=false;
  213. readprocdef:=tprocvardef.create(normal_function_level);
  214. include(readprocdef.procoptions,po_methodpointer);
  215. writeprocdef:=tprocvardef.create(normal_function_level);
  216. include(writeprocdef.procoptions,po_methodpointer);
  217. registerdef:=oldregisterdef;
  218. if token<>_ID then
  219. begin
  220. consume(_ID);
  221. consume(_SEMICOLON);
  222. exit;
  223. end;
  224. { Generate propertysym and insert in symtablestack }
  225. p:=tpropertysym.create(orgpattern);
  226. symtablestack.insert(p);
  227. propname:=pattern;
  228. consume(_ID);
  229. { Set the symtablestack to the parast of readprop so
  230. temp defs will be destroyed after declaration }
  231. readprocdef.parast.next:=symtablestack;
  232. symtablestack:=readprocdef.parast;
  233. { property parameters ? }
  234. if token=_LECKKLAMMER then
  235. begin
  236. if (sp_published in current_object_option) then
  237. Message(parser_e_cant_publish_that_property);
  238. { create a list of the parameters }
  239. sc:=tsinglelist.create;
  240. consume(_LECKKLAMMER);
  241. inc(testcurobject);
  242. repeat
  243. if token=_VAR then
  244. begin
  245. consume(_VAR);
  246. varspez:=vs_var;
  247. end
  248. else if token=_CONST then
  249. begin
  250. consume(_CONST);
  251. varspez:=vs_const;
  252. end
  253. else if (idtoken=_OUT) and (m_out in aktmodeswitches) then
  254. begin
  255. consume(_OUT);
  256. varspez:=vs_out;
  257. end
  258. else
  259. varspez:=vs_value;
  260. sc.reset;
  261. repeat
  262. readvs:=tvarsym.create(orgpattern,varspez,generrortype);
  263. readprocdef.parast.insert(readvs);
  264. sc.insert(readvs);
  265. consume(_ID);
  266. until not try_to_consume(_COMMA);
  267. if token=_COLON then
  268. begin
  269. consume(_COLON);
  270. if token=_ARRAY then
  271. begin
  272. consume(_ARRAY);
  273. consume(_OF);
  274. { define range and type of range }
  275. tt.setdef(tarraydef.create(0,-1,s32bittype));
  276. { define field type }
  277. single_type(arraytype,s,false);
  278. tarraydef(tt.def).setelementtype(arraytype);
  279. end
  280. else
  281. single_type(tt,s,false);
  282. end
  283. else
  284. tt:=cformaltype;
  285. readvs:=tvarsym(sc.first);
  286. while assigned(readvs) do
  287. begin
  288. readprocdef.concatpara(nil,tt,readvs,nil,false);
  289. { also update the writeprocdef }
  290. hvs:=tvarsym.create(readvs.realname,vs_value,generrortype);
  291. writeprocdef.parast.insert(hvs);
  292. writeprocdef.concatpara(nil,tt,hvs,nil,false);
  293. readvs:=tvarsym(readvs.listnext);
  294. end;
  295. until not try_to_consume(_SEMICOLON);
  296. sc.free;
  297. dec(testcurobject);
  298. consume(_RECKKLAMMER);
  299. { the parser need to know if a property has parameters, the
  300. index parameter doesn't count (PFV) }
  301. if readprocdef.minparacount>0 then
  302. include(p.propoptions,ppo_hasparameters);
  303. end;
  304. { overriden property ? }
  305. { force property interface, if there is a property parameter }
  306. if (token=_COLON) or (readprocdef.minparacount>0) then
  307. begin
  308. consume(_COLON);
  309. single_type(p.proptype,hs,false);
  310. if (idtoken=_INDEX) then
  311. begin
  312. consume(_INDEX);
  313. pt:=comp_expr(true);
  314. if is_constnode(pt) and
  315. is_ordinal(pt.resulttype.def) and
  316. (not is_64bitint(pt.resulttype.def)) then
  317. p.index:=tordconstnode(pt).value
  318. else
  319. begin
  320. Message(parser_e_invalid_property_index_value);
  321. p.index:=0;
  322. end;
  323. p.indextype.setdef(pt.resulttype.def);
  324. include(p.propoptions,ppo_indexed);
  325. { concat a longint to the para templates }
  326. hvs:=tvarsym.create('$index',vs_value,p.indextype);
  327. readprocdef.parast.insert(hvs);
  328. readprocdef.concatpara(nil,p.indextype,hvs,nil,false);
  329. hvs:=tvarsym.create('$index',vs_value,p.indextype);
  330. writeprocdef.parast.insert(hvs);
  331. writeprocdef.concatpara(nil,p.indextype,hvs,nil,false);
  332. pt.free;
  333. end;
  334. end
  335. else
  336. begin
  337. { do an property override }
  338. overriden:=search_class_member(aktclass.childof,propname);
  339. if assigned(overriden) and (overriden.typ=propertysym) then
  340. begin
  341. p.dooverride(tpropertysym(overriden));
  342. end
  343. else
  344. begin
  345. p.proptype:=generrortype;
  346. message(parser_e_no_property_found_to_override);
  347. end;
  348. end;
  349. if (sp_published in current_object_option) and
  350. not(p.proptype.def.is_publishable) then
  351. Message(parser_e_cant_publish_that_property);
  352. if try_to_consume(_READ) then
  353. begin
  354. p.readaccess.clear;
  355. if parse_symlist(p.readaccess,def) then
  356. begin
  357. sym:=p.readaccess.firstsym^.sym;
  358. case sym.typ of
  359. procsym :
  360. begin
  361. { read is function returning the type of the property }
  362. readprocdef.rettype:=p.proptype;
  363. { Insert hidden parameters }
  364. handle_calling_convention(readprocdef);
  365. calc_parast(readprocdef);
  366. { search procdefs matching readprocdef }
  367. p.readaccess.procdef:=Tprocsym(sym).search_procdef_bypara(readprocdef.para,p.proptype.def,[cpo_allowdefaults]);
  368. if not assigned(p.readaccess.procdef) then
  369. Message(parser_e_ill_property_access_sym);
  370. end;
  371. varsym :
  372. begin
  373. if not assigned(def) then
  374. internalerror(200310071);
  375. if compare_defs(def,p.proptype.def,nothingn)>=te_equal then
  376. begin
  377. { property parameters are allowed if this is
  378. an indexed property, because the index is then
  379. the parameter.
  380. Note: In the help of Kylix it is written
  381. that it isn't allowed, but the compiler accepts it (PFV) }
  382. if (ppo_hasparameters in p.propoptions) then
  383. Message(parser_e_ill_property_access_sym);
  384. end
  385. else
  386. IncompatibleTypes(def,p.proptype.def);
  387. end;
  388. else
  389. Message(parser_e_ill_property_access_sym);
  390. end;
  391. end;
  392. end;
  393. if try_to_consume(_WRITE) then
  394. begin
  395. p.writeaccess.clear;
  396. if parse_symlist(p.writeaccess,def) then
  397. begin
  398. sym:=p.writeaccess.firstsym^.sym;
  399. case sym.typ of
  400. procsym :
  401. begin
  402. { write is a procedure with an extra value parameter
  403. of the of the property }
  404. writeprocdef.rettype:=voidtype;
  405. hvs:=tvarsym.create('$value',vs_value,p.proptype);
  406. writeprocdef.parast.insert(hvs);
  407. writeprocdef.concatpara(nil,p.proptype,hvs,nil,false);
  408. { Insert hidden parameters }
  409. handle_calling_convention(writeprocdef);
  410. calc_parast(writeprocdef);
  411. { search procdefs matching writeprocdef }
  412. p.writeaccess.procdef:=Tprocsym(sym).search_procdef_bypara(writeprocdef.para,writeprocdef.rettype.def,[cpo_allowdefaults]);
  413. if not assigned(p.writeaccess.procdef) then
  414. Message(parser_e_ill_property_access_sym);
  415. end;
  416. varsym :
  417. begin
  418. if not assigned(def) then
  419. internalerror(200310072);
  420. if compare_defs(def,p.proptype.def,nothingn)>=te_equal then
  421. begin
  422. { property parameters are allowed if this is
  423. an indexed property, because the index is then
  424. the parameter.
  425. Note: In the help of Kylix it is written
  426. that it isn't allowed, but the compiler accepts it (PFV) }
  427. if (ppo_hasparameters in p.propoptions) then
  428. Message(parser_e_ill_property_access_sym);
  429. end
  430. else
  431. IncompatibleTypes(def,p.proptype.def);
  432. end;
  433. else
  434. Message(parser_e_ill_property_access_sym);
  435. end;
  436. end;
  437. end;
  438. include(p.propoptions,ppo_stored);
  439. if try_to_consume(_STORED) then
  440. begin
  441. p.storedaccess.clear;
  442. case token of
  443. _ID:
  444. begin
  445. { in the case that idtoken=_DEFAULT }
  446. { we have to do nothing except }
  447. { setting ppo_stored, it's the same }
  448. { as stored true }
  449. if idtoken<>_DEFAULT then
  450. begin
  451. if parse_symlist(p.storedaccess,def) then
  452. begin
  453. sym:=p.storedaccess.firstsym^.sym;
  454. case sym.typ of
  455. procsym :
  456. begin
  457. p.storedaccess.procdef:=Tprocsym(sym).search_procdef_nopara_boolret;
  458. if not assigned(p.storedaccess.procdef) then
  459. message(parser_e_ill_property_storage_sym);
  460. end;
  461. varsym :
  462. begin
  463. if not assigned(def) then
  464. internalerror(200310073);
  465. if (ppo_hasparameters in p.propoptions) or
  466. not(is_boolean(def)) then
  467. Message(parser_e_stored_property_must_be_boolean);
  468. end;
  469. else
  470. Message(parser_e_ill_property_access_sym);
  471. end;
  472. end;
  473. end;
  474. end;
  475. _FALSE:
  476. begin
  477. consume(_FALSE);
  478. exclude(p.propoptions,ppo_stored);
  479. end;
  480. _TRUE:
  481. consume(_TRUE);
  482. end;
  483. end;
  484. if try_to_consume(_DEFAULT) then
  485. begin
  486. if not(is_ordinal(p.proptype.def) or
  487. is_64bitint(p.proptype.def) or
  488. is_class(p.proptype.def) or
  489. is_single(p.proptype.def) or
  490. (p.proptype.def.deftype in [classrefdef,pointerdef]) or
  491. ((p.proptype.def.deftype=setdef) and
  492. (tsetdef(p.proptype.def).settype=smallset))) or
  493. ((p.proptype.def.deftype=arraydef) and
  494. (ppo_indexed in p.propoptions)) or
  495. (ppo_hasparameters in p.propoptions) then
  496. begin
  497. Message(parser_e_property_cant_have_a_default_value);
  498. { Error recovery }
  499. pt:=comp_expr(true);
  500. pt.free;
  501. end
  502. else
  503. begin
  504. { Get the result of the default, the firstpass is
  505. needed to support values like -1 }
  506. pt:=comp_expr(true);
  507. if (p.proptype.def.deftype=setdef) and
  508. (pt.nodetype=arrayconstructorn) then
  509. begin
  510. arrayconstructor_to_set(pt);
  511. do_resulttypepass(pt);
  512. end;
  513. inserttypeconv(pt,p.proptype);
  514. if not(is_constnode(pt)) then
  515. Message(parser_e_property_default_value_must_const);
  516. { Set default value }
  517. case pt.nodetype of
  518. setconstn :
  519. p.default:=plongint(tsetconstnode(pt).value_set)^;
  520. ordconstn :
  521. p.default:=tordconstnode(pt).value;
  522. niln :
  523. p.default:=0;
  524. realconstn:
  525. p.default:=longint(single(trealconstnode(pt).value_real));
  526. end;
  527. pt.free;
  528. end;
  529. end
  530. else if try_to_consume(_NODEFAULT) then
  531. begin
  532. p.default:=0;
  533. end;
  534. consume(_SEMICOLON);
  535. { default property ? }
  536. if try_to_consume(_DEFAULT) then
  537. begin
  538. include(p.propoptions,ppo_defaultproperty);
  539. if readprocdef.maxparacount=0 then
  540. message(parser_e_property_need_paras);
  541. consume(_SEMICOLON);
  542. end;
  543. { remove temporary procvardefs }
  544. symtablestack:=symtablestack.next;
  545. readprocdef.free;
  546. writeprocdef.free;
  547. end;
  548. function destructor_head:tprocdef;
  549. var
  550. pd : tprocdef;
  551. begin
  552. consume(_DESTRUCTOR);
  553. pd:=parse_proc_head(aktclass,potype_destructor);
  554. if (cs_constructor_name in aktglobalswitches) and
  555. (pd.procsym.name<>'DONE') then
  556. Message(parser_e_destructorname_must_be_done);
  557. if not(pd.maxparacount=0) and
  558. (m_fpc in aktmodeswitches) then
  559. Message(parser_e_no_paras_for_destructor);
  560. consume(_SEMICOLON);
  561. include(aktclass.objectoptions,oo_has_destructor);
  562. { no return value }
  563. pd.rettype:=voidtype;
  564. destructor_head:=pd;
  565. end;
  566. var
  567. hs : string;
  568. pcrd : tclassrefdef;
  569. tt : ttype;
  570. old_object_option : tsymoptions;
  571. oldparse_only : boolean;
  572. storetypecanbeforward : boolean;
  573. procedure setclassattributes;
  574. begin
  575. { publishable }
  576. if classtype in [odt_interfacecom,odt_class] then
  577. begin
  578. aktclass.objecttype:=classtype;
  579. if (cs_generate_rtti in aktlocalswitches) or
  580. (assigned(aktclass.childof) and
  581. (oo_can_have_published in aktclass.childof.objectoptions)) then
  582. begin
  583. include(aktclass.objectoptions,oo_can_have_published);
  584. { in "publishable" classes the default access type is published }
  585. current_object_option:=[sp_published];
  586. end;
  587. end;
  588. end;
  589. procedure setclassparent;
  590. begin
  591. if assigned(fd) then
  592. aktclass:=fd
  593. else
  594. aktclass:=tobjectdef.create(classtype,n,nil);
  595. { is the current class tobject? }
  596. { so you could define your own tobject }
  597. if (cs_compilesystem in aktmoduleswitches) and (classtype=odt_class) and (upper(n)='TOBJECT') then
  598. class_tobject:=aktclass
  599. else if (cs_compilesystem in aktmoduleswitches) and (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
  600. interface_iunknown:=aktclass
  601. else
  602. begin
  603. case classtype of
  604. odt_class:
  605. childof:=class_tobject;
  606. odt_interfacecom:
  607. childof:=interface_iunknown;
  608. end;
  609. if (oo_is_forward in childof.objectoptions) then
  610. Message1(parser_e_forward_declaration_must_be_resolved,childof.objrealname^);
  611. aktclass.set_parent(childof);
  612. end;
  613. end;
  614. procedure setinterfacemethodoptions;
  615. var
  616. i: longint;
  617. defs: TIndexArray;
  618. pd: tprocdef;
  619. begin
  620. include(aktclass.objectoptions,oo_has_virtual);
  621. defs:=aktclass.symtable.defindex;
  622. for i:=1 to defs.count do
  623. begin
  624. pd:=tprocdef(defs.search(i));
  625. if pd.deftype=procdef then
  626. begin
  627. pd.extnumber:=aktclass.lastvtableindex;
  628. inc(aktclass.lastvtableindex);
  629. include(pd.procoptions,po_virtualmethod);
  630. pd.forwarddef:=false;
  631. end;
  632. end;
  633. end;
  634. function readobjecttype : boolean;
  635. begin
  636. readobjecttype:=true;
  637. { distinguish classes and objects }
  638. case token of
  639. _OBJECT:
  640. begin
  641. classtype:=odt_object;
  642. consume(_OBJECT)
  643. end;
  644. _CPPCLASS:
  645. begin
  646. classtype:=odt_cppclass;
  647. consume(_CPPCLASS);
  648. end;
  649. _INTERFACE:
  650. begin
  651. { need extra check here since interface is a keyword
  652. in all pascal modes }
  653. if not(m_class in aktmodeswitches) then
  654. Message(parser_f_need_objfpc_or_delphi_mode);
  655. if aktinterfacetype=it_interfacecom then
  656. classtype:=odt_interfacecom
  657. else {it_interfacecorba}
  658. classtype:=odt_interfacecorba;
  659. consume(_INTERFACE);
  660. { forward declaration }
  661. if not(assigned(fd)) and (token=_SEMICOLON) then
  662. begin
  663. { also anonym objects aren't allow (o : object a : longint; end;) }
  664. if n='' then
  665. Message(parser_f_no_anonym_objects);
  666. aktclass:=tobjectdef.create(classtype,n,nil);
  667. if (cs_compilesystem in aktmoduleswitches) and
  668. (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
  669. interface_iunknown:=aktclass;
  670. include(aktclass.objectoptions,oo_is_forward);
  671. object_dec:=aktclass;
  672. typecanbeforward:=storetypecanbeforward;
  673. readobjecttype:=false;
  674. exit;
  675. end;
  676. end;
  677. _CLASS:
  678. begin
  679. classtype:=odt_class;
  680. consume(_CLASS);
  681. if not(assigned(fd)) and
  682. (token=_OF) and
  683. { Delphi only allows class of in type blocks.
  684. Note that when parsing the type of a variable declaration
  685. the blocktype is bt_type so the check for typecanbeforward
  686. is also necessary (PFV) }
  687. (((block_type=bt_type) and typecanbeforward) or
  688. not(m_delphi in aktmodeswitches)) then
  689. begin
  690. { a hack, but it's easy to handle }
  691. { class reference type }
  692. consume(_OF);
  693. single_type(tt,hs,typecanbeforward);
  694. { accept hp1, if is a forward def or a class }
  695. if (tt.def.deftype=forwarddef) or
  696. is_class(tt.def) then
  697. begin
  698. pcrd:=tclassrefdef.create(tt);
  699. object_dec:=pcrd;
  700. end
  701. else
  702. begin
  703. object_dec:=generrortype.def;
  704. Message1(type_e_class_type_expected,generrortype.def.typename);
  705. end;
  706. typecanbeforward:=storetypecanbeforward;
  707. readobjecttype:=false;
  708. exit;
  709. end
  710. { forward class }
  711. else if not(assigned(fd)) and (token=_SEMICOLON) then
  712. begin
  713. { also anonym objects aren't allow (o : object a : longint; end;) }
  714. if n='' then
  715. Message(parser_f_no_anonym_objects);
  716. aktclass:=tobjectdef.create(odt_class,n,nil);
  717. if (cs_compilesystem in aktmoduleswitches) and (upper(n)='TOBJECT') then
  718. class_tobject:=aktclass;
  719. aktclass.objecttype:=odt_class;
  720. include(aktclass.objectoptions,oo_is_forward);
  721. { all classes must have a vmt !! at offset zero }
  722. if not(oo_has_vmt in aktclass.objectoptions) then
  723. aktclass.insertvmt;
  724. object_dec:=aktclass;
  725. typecanbeforward:=storetypecanbeforward;
  726. readobjecttype:=false;
  727. exit;
  728. end;
  729. end;
  730. else
  731. begin
  732. classtype:=odt_class; { this is error but try to recover }
  733. consume(_OBJECT);
  734. end;
  735. end;
  736. end;
  737. procedure handleimplementedinterface(implintf : tobjectdef);
  738. begin
  739. if not is_interface(implintf) then
  740. begin
  741. Message1(type_e_interface_type_expected,implintf.typename);
  742. exit;
  743. end;
  744. if aktclass.implementedinterfaces.searchintf(implintf)<>-1 then
  745. Message1(sym_e_duplicate_id,implintf.name)
  746. else
  747. begin
  748. { allocate and prepare the GUID only if the class
  749. implements some interfaces.
  750. }
  751. if aktclass.implementedinterfaces.count = 0 then
  752. aktclass.prepareguid;
  753. aktclass.implementedinterfaces.addintf(implintf);
  754. end;
  755. end;
  756. procedure readimplementedinterfaces;
  757. var
  758. tt : ttype;
  759. begin
  760. while try_to_consume(_COMMA) do
  761. begin
  762. id_type(tt,pattern,false);
  763. if (tt.def.deftype<>objectdef) then
  764. begin
  765. Message1(type_e_interface_type_expected,tt.def.typename);
  766. continue;
  767. end;
  768. handleimplementedinterface(tobjectdef(tt.def));
  769. end;
  770. end;
  771. procedure readinterfaceiid;
  772. var
  773. p : tnode;
  774. valid : boolean;
  775. begin
  776. p:=comp_expr(true);
  777. if p.nodetype=stringconstn then
  778. begin
  779. stringdispose(aktclass.iidstr);
  780. aktclass.iidstr:=stringdup(strpas(tstringconstnode(p).value_str)); { or upper? }
  781. p.free;
  782. valid:=string2guid(aktclass.iidstr^,aktclass.iidguid^);
  783. if (classtype=odt_interfacecom) and not assigned(aktclass.iidguid) and not valid then
  784. Message(parser_e_improper_guid_syntax);
  785. end
  786. else
  787. begin
  788. p.free;
  789. Message(cg_e_illegal_expression);
  790. end;
  791. end;
  792. procedure readparentclasses;
  793. var
  794. hp : tobjectdef;
  795. begin
  796. hp:=nil;
  797. { reads the parent class }
  798. if try_to_consume(_LKLAMMER) then
  799. begin
  800. id_type(tt,pattern,false);
  801. childof:=tobjectdef(tt.def);
  802. if (not assigned(childof)) or
  803. (childof.deftype<>objectdef) then
  804. begin
  805. if assigned(childof) then
  806. Message1(type_e_class_type_expected,childof.typename);
  807. childof:=nil;
  808. aktclass:=tobjectdef.create(classtype,n,nil);
  809. end
  810. else
  811. begin
  812. { a mix of class, interfaces, objects and cppclasses
  813. isn't allowed }
  814. case classtype of
  815. odt_class:
  816. if not(is_class(childof)) then
  817. begin
  818. if is_interface(childof) then
  819. begin
  820. { we insert the interface after the child
  821. is set, see below
  822. }
  823. hp:=childof;
  824. childof:=class_tobject;
  825. end
  826. else
  827. Message(parser_e_mix_of_classes_and_objects);
  828. end;
  829. odt_interfacecorba,
  830. odt_interfacecom:
  831. if not(is_interface(childof)) then
  832. Message(parser_e_mix_of_classes_and_objects);
  833. odt_cppclass:
  834. if not(is_cppclass(childof)) then
  835. Message(parser_e_mix_of_classes_and_objects);
  836. odt_object:
  837. if not(is_object(childof)) then
  838. Message(parser_e_mix_of_classes_and_objects);
  839. end;
  840. { the forward of the child must be resolved to get
  841. correct field addresses }
  842. if assigned(fd) then
  843. begin
  844. if (oo_is_forward in childof.objectoptions) then
  845. Message1(parser_e_forward_declaration_must_be_resolved,childof.objrealname^);
  846. aktclass:=fd;
  847. { we must inherit several options !!
  848. this was missing !!
  849. all is now done in set_parent
  850. including symtable datasize setting PM }
  851. fd.set_parent(childof);
  852. end
  853. else
  854. aktclass:=tobjectdef.create(classtype,n,childof);
  855. if aktclass.objecttype=odt_class then
  856. begin
  857. if assigned(hp) then
  858. handleimplementedinterface(hp);
  859. readimplementedinterfaces;
  860. end;
  861. end;
  862. consume(_RKLAMMER);
  863. end
  864. { if no parent class, then a class get tobject as parent }
  865. else if classtype in [odt_class,odt_interfacecom] then
  866. setclassparent
  867. else
  868. aktclass:=tobjectdef.create(classtype,n,nil);
  869. { read GUID }
  870. if (classtype in [odt_interfacecom,odt_interfacecorba]) and
  871. try_to_consume(_LECKKLAMMER) then
  872. begin
  873. readinterfaceiid;
  874. consume(_RECKKLAMMER);
  875. end;
  876. end;
  877. procedure chkcpp(pd:tprocdef);
  878. begin
  879. if is_cppclass(pd._class) then
  880. begin
  881. pd.proccalloption:=pocall_cppdecl;
  882. pd.setmangledname(target_info.Cprefix+pd.cplusplusmangledname);
  883. end;
  884. end;
  885. var
  886. pd : tprocdef;
  887. begin
  888. old_object_option:=current_object_option;
  889. { forward is resolved }
  890. if assigned(fd) then
  891. exclude(fd.objectoptions,oo_is_forward);
  892. { objects and class types can't be declared local }
  893. if not(symtablestack.symtabletype in [globalsymtable,staticsymtable]) then
  894. Message(parser_e_no_local_objects);
  895. storetypecanbeforward:=typecanbeforward;
  896. { for tp7 don't allow forward types }
  897. if (m_tp7 in aktmodeswitches) then
  898. typecanbeforward:=false;
  899. if not(readobjecttype) then
  900. exit;
  901. { also anonym objects aren't allow (o : object a : longint; end;) }
  902. if n='' then
  903. Message(parser_f_no_anonym_objects);
  904. { read list of parent classes }
  905. readparentclasses;
  906. { default access is public }
  907. there_is_a_destructor:=false;
  908. current_object_option:=[sp_public];
  909. { set class flags and inherits published }
  910. setclassattributes;
  911. aktobjectdef:=aktclass;
  912. aktclass.symtable.next:=symtablestack;
  913. symtablestack:=aktclass.symtable;
  914. testcurobject:=1;
  915. curobjectname:=Upper(n);
  916. { short class declaration ? }
  917. if (classtype<>odt_class) or (token<>_SEMICOLON) then
  918. begin
  919. { Parse componenten }
  920. repeat
  921. case token of
  922. _ID :
  923. begin
  924. case idtoken of
  925. _PRIVATE :
  926. begin
  927. if is_interface(aktclass) then
  928. Message(parser_e_no_access_specifier_in_interfaces);
  929. consume(_PRIVATE);
  930. current_object_option:=[sp_private];
  931. include(aktclass.objectoptions,oo_has_private);
  932. end;
  933. _PROTECTED :
  934. begin
  935. if is_interface(aktclass) then
  936. Message(parser_e_no_access_specifier_in_interfaces);
  937. consume(_PROTECTED);
  938. current_object_option:=[sp_protected];
  939. include(aktclass.objectoptions,oo_has_protected);
  940. end;
  941. _PUBLIC :
  942. begin
  943. if is_interface(aktclass) then
  944. Message(parser_e_no_access_specifier_in_interfaces);
  945. consume(_PUBLIC);
  946. current_object_option:=[sp_public];
  947. end;
  948. _PUBLISHED :
  949. begin
  950. { we've to check for a pushlished section in non- }
  951. { publishable classes later, if a real declaration }
  952. { this is the way, delphi does it }
  953. if is_interface(aktclass) then
  954. Message(parser_e_no_access_specifier_in_interfaces);
  955. consume(_PUBLISHED);
  956. current_object_option:=[sp_published];
  957. end;
  958. else
  959. begin
  960. if is_interface(aktclass) then
  961. Message(parser_e_no_vars_in_interfaces);
  962. if (sp_published in current_object_option) and
  963. not(oo_can_have_published in aktclass.objectoptions) then
  964. Message(parser_e_cant_have_published);
  965. read_var_decs(false,true,false);
  966. end;
  967. end;
  968. end;
  969. _PROPERTY :
  970. begin
  971. property_dec;
  972. end;
  973. _PROCEDURE,
  974. _FUNCTION,
  975. _CLASS :
  976. begin
  977. if (sp_published in current_object_option) and
  978. not(oo_can_have_published in aktclass.objectoptions) then
  979. Message(parser_e_cant_have_published);
  980. oldparse_only:=parse_only;
  981. parse_only:=true;
  982. pd:=parse_proc_dec(aktclass);
  983. { this is for error recovery as well as forward }
  984. { interface mappings, i.e. mapping to a method }
  985. { which isn't declared yet }
  986. if assigned(pd) then
  987. begin
  988. parse_object_proc_directives(pd);
  989. handle_calling_convention(pd);
  990. calc_parast(pd);
  991. { add definition to procsym }
  992. proc_add_definition(pd);
  993. { add procdef options to objectdef options }
  994. if (po_msgint in pd.procoptions) then
  995. include(aktclass.objectoptions,oo_has_msgint);
  996. if (po_msgstr in pd.procoptions) then
  997. include(aktclass.objectoptions,oo_has_msgstr);
  998. if (po_virtualmethod in pd.procoptions) then
  999. include(aktclass.objectoptions,oo_has_virtual);
  1000. chkcpp(pd);
  1001. end;
  1002. parse_only:=oldparse_only;
  1003. end;
  1004. _CONSTRUCTOR :
  1005. begin
  1006. if (sp_published in current_object_option) and
  1007. not(oo_can_have_published in aktclass.objectoptions) then
  1008. Message(parser_e_cant_have_published);
  1009. if not(sp_public in current_object_option) then
  1010. Message(parser_w_constructor_should_be_public);
  1011. if is_interface(aktclass) then
  1012. Message(parser_e_no_con_des_in_interfaces);
  1013. oldparse_only:=parse_only;
  1014. parse_only:=true;
  1015. pd:=constructor_head;
  1016. parse_object_proc_directives(pd);
  1017. handle_calling_convention(pd);
  1018. calc_parast(pd);
  1019. { add definition to procsym }
  1020. proc_add_definition(pd);
  1021. { add procdef options to objectdef options }
  1022. if (po_virtualmethod in pd.procoptions) then
  1023. include(aktclass.objectoptions,oo_has_virtual);
  1024. chkcpp(pd);
  1025. parse_only:=oldparse_only;
  1026. end;
  1027. _DESTRUCTOR :
  1028. begin
  1029. if (sp_published in current_object_option) and
  1030. not(oo_can_have_published in aktclass.objectoptions) then
  1031. Message(parser_e_cant_have_published);
  1032. if there_is_a_destructor then
  1033. Message(parser_n_only_one_destructor);
  1034. if is_interface(aktclass) then
  1035. Message(parser_e_no_con_des_in_interfaces);
  1036. if not(sp_public in current_object_option) then
  1037. Message(parser_w_destructor_should_be_public);
  1038. there_is_a_destructor:=true;
  1039. oldparse_only:=parse_only;
  1040. parse_only:=true;
  1041. pd:=destructor_head;
  1042. parse_object_proc_directives(pd);
  1043. handle_calling_convention(pd);
  1044. calc_parast(pd);
  1045. { add definition to procsym }
  1046. proc_add_definition(pd);
  1047. { add procdef options to objectdef options }
  1048. if (po_virtualmethod in pd.procoptions) then
  1049. include(aktclass.objectoptions,oo_has_virtual);
  1050. chkcpp(pd);
  1051. parse_only:=oldparse_only;
  1052. end;
  1053. _END :
  1054. begin
  1055. consume(_END);
  1056. break;
  1057. end;
  1058. else
  1059. consume(_ID); { Give a ident expected message, like tp7 }
  1060. end;
  1061. until false;
  1062. end;
  1063. { generate vmt space if needed }
  1064. if not(oo_has_vmt in aktclass.objectoptions) and
  1065. (([oo_has_virtual,oo_has_constructor,oo_has_destructor]*aktclass.objectoptions<>[]) or
  1066. (classtype in [odt_class])
  1067. ) then
  1068. aktclass.insertvmt;
  1069. if is_interface(aktclass) then
  1070. setinterfacemethodoptions;
  1071. { reset }
  1072. testcurobject:=0;
  1073. curobjectname:='';
  1074. typecanbeforward:=storetypecanbeforward;
  1075. { restore old state }
  1076. symtablestack:=symtablestack.next;
  1077. aktobjectdef:=nil;
  1078. current_object_option:=old_object_option;
  1079. object_dec:=aktclass;
  1080. end;
  1081. end.
  1082. {
  1083. $Log$
  1084. Revision 1.74 2003-12-04 23:27:49 peter
  1085. * missing handle_calling_convention()
  1086. Revision 1.73 2003/11/10 18:06:25 florian
  1087. + published single properties can have a default value now
  1088. Revision 1.72 2003/10/30 16:23:13 peter
  1089. * don't search for overloads in parents for constructors
  1090. Revision 1.71 2003/10/22 15:22:33 peter
  1091. * fixed unitsym-globalsymtable relation so the uses of a unit
  1092. is counted correctly
  1093. Revision 1.70 2003/10/21 18:16:13 peter
  1094. * IncompatibleTypes() added that will include unit names when
  1095. the typenames are the same
  1096. Revision 1.69 2003/10/07 16:06:30 peter
  1097. * tsymlist.def renamed to tsymlist.procdef
  1098. * tsymlist.procdef is now only used to store the procdef
  1099. Revision 1.68 2003/10/02 21:15:12 peter
  1100. * support nil as default value
  1101. * when no default property is allowed don't check default value
  1102. Revision 1.67 2003/06/13 21:19:30 peter
  1103. * current_procdef removed, use current_procinfo.procdef instead
  1104. Revision 1.66 2003/05/23 14:27:35 peter
  1105. * remove some unit dependencies
  1106. * current_procinfo changes to store more info
  1107. Revision 1.65 2003/05/09 17:47:02 peter
  1108. * self moved to hidden parameter
  1109. * removed hdisposen,hnewn,selfn
  1110. Revision 1.64 2003/05/05 14:53:16 peter
  1111. * vs_hidden replaced by is_hidden boolean
  1112. Revision 1.63 2003/04/27 11:21:33 peter
  1113. * aktprocdef renamed to current_procinfo.procdef
  1114. * procinfo renamed to current_procinfo
  1115. * procinfo will now be stored in current_module so it can be
  1116. cleaned up properly
  1117. * gen_main_procsym changed to create_main_proc and release_main_proc
  1118. to also generate a tprocinfo structure
  1119. * fixed unit implicit initfinal
  1120. Revision 1.62 2003/04/27 07:29:50 peter
  1121. * current_procinfo.procdef cleanup, current_procdef is now always nil when parsing
  1122. a new procdef declaration
  1123. * aktprocsym removed
  1124. * lexlevel removed, use symtable.symtablelevel instead
  1125. * implicit init/final code uses the normal genentry/genexit
  1126. * funcret state checking updated for new funcret handling
  1127. Revision 1.61 2003/04/26 00:32:37 peter
  1128. * start search for overriden properties in the parent class
  1129. Revision 1.60 2003/04/25 20:59:33 peter
  1130. * removed funcretn,funcretsym, function result is now in varsym
  1131. and aliases for result and function name are added using absolutesym
  1132. * vs_hidden parameter for funcret passed in parameter
  1133. * vs_hidden fixes
  1134. * writenode changed to printnode and released from extdebug
  1135. * -vp option added to generate a tree.log with the nodetree
  1136. * nicer printnode for statements, callnode
  1137. Revision 1.59 2003/04/10 17:57:52 peter
  1138. * vs_hidden released
  1139. Revision 1.58 2003/01/09 21:52:37 peter
  1140. * merged some verbosity options.
  1141. * V_LineInfo is a verbosity flag to include line info
  1142. Revision 1.57 2002/11/25 17:43:21 peter
  1143. * splitted defbase in defutil,symutil,defcmp
  1144. * merged isconvertable and is_equal into compare_defs(_ext)
  1145. * made operator search faster by walking the list only once
  1146. Revision 1.56 2002/11/17 16:31:56 carl
  1147. * memory optimization (3-4%) : cleanup of tai fields,
  1148. cleanup of tdef and tsym fields.
  1149. * make it work for m68k
  1150. Revision 1.55 2002/10/05 12:43:25 carl
  1151. * fixes for Delphi 6 compilation
  1152. (warning : Some features do not work under Delphi)
  1153. Revision 1.54 2002/10/02 18:20:20 peter
  1154. * don't allow interface without m_class mode
  1155. Revision 1.53 2002/09/27 21:13:28 carl
  1156. * low-highval always checked if limit ober 2GB is reached (to avoid overflow)
  1157. Revision 1.52 2002/09/16 14:11:13 peter
  1158. * add argument to equal_paras() to support default values or not
  1159. Revision 1.51 2002/09/09 17:34:15 peter
  1160. * tdicationary.replace added to replace and item in a dictionary. This
  1161. is only allowed for the same name
  1162. * varsyms are inserted in symtable before the types are parsed. This
  1163. fixes the long standing "var longint : longint" bug
  1164. - consume_idlist and idstringlist removed. The loops are inserted
  1165. at the callers place and uses the symtable for duplicate id checking
  1166. Revision 1.50 2002/09/03 16:26:26 daniel
  1167. * Make Tprocdef.defs protected
  1168. Revision 1.49 2002/08/17 09:23:38 florian
  1169. * first part of procinfo rewrite
  1170. Revision 1.48 2002/08/09 07:33:02 florian
  1171. * a couple of interface related fixes
  1172. Revision 1.47 2002/07/20 11:57:55 florian
  1173. * types.pas renamed to defbase.pas because D6 contains a types
  1174. unit so this would conflicts if D6 programms are compiled
  1175. + Willamette/SSE2 instructions to assembler added
  1176. Revision 1.46 2002/07/01 16:23:53 peter
  1177. * cg64 patch
  1178. * basics for currency
  1179. * asnode updates for class and interface (not finished)
  1180. Revision 1.45 2002/05/18 13:34:12 peter
  1181. * readded missing revisions
  1182. Revision 1.44 2002/05/16 19:46:42 carl
  1183. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1184. + try to fix temp allocation (still in ifdef)
  1185. + generic constructor calls
  1186. + start of tassembler / tmodulebase class cleanup
  1187. Revision 1.42 2002/05/12 16:53:08 peter
  1188. * moved entry and exitcode to ncgutil and cgobj
  1189. * foreach gets extra argument for passing local data to the
  1190. iterator function
  1191. * -CR checks also class typecasts at runtime by changing them
  1192. into as
  1193. * fixed compiler to cycle with the -CR option
  1194. * fixed stabs with elf writer, finally the global variables can
  1195. be watched
  1196. * removed a lot of routines from cga unit and replaced them by
  1197. calls to cgobj
  1198. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1199. u32bit then the other is typecasted also to u32bit without giving
  1200. a rangecheck warning/error.
  1201. * fixed pascal calling method with reversing also the high tree in
  1202. the parast, detected by tcalcst3 test
  1203. Revision 1.41 2002/04/21 19:02:04 peter
  1204. * removed newn and disposen nodes, the code is now directly
  1205. inlined from pexpr
  1206. * -an option that will write the secondpass nodes to the .s file, this
  1207. requires EXTDEBUG define to actually write the info
  1208. * fixed various internal errors and crashes due recent code changes
  1209. Revision 1.40 2002/04/19 15:46:02 peter
  1210. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  1211. in most cases and not written to the ppu
  1212. * add mangeledname_prefix() routine to generate the prefix of
  1213. manglednames depending on the current procedure, object and module
  1214. * removed static procprefix since the mangledname is now build only
  1215. on demand from tprocdef.mangledname
  1216. Revision 1.39 2002/04/04 19:06:00 peter
  1217. * removed unused units
  1218. * use tlocation.size in cg.a_*loc*() routines
  1219. Revision 1.38 2002/01/25 17:38:19 peter
  1220. * fixed default value for properties with index values
  1221. Revision 1.37 2002/01/24 18:25:48 peter
  1222. * implicit result variable generation for assembler routines
  1223. * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
  1224. Revision 1.36 2002/01/06 12:08:15 peter
  1225. * removed uauto from orddef, use new range_to_basetype generating
  1226. the correct ordinal type for a range
  1227. }