pdecl.pas 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Does declaration (but not type) parsing 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 pdecl;
  19. interface
  20. uses
  21. globtype,tokens,globals,symtable;
  22. procedure parameter_dec(aktprocdef:pabstractprocdef);
  23. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  24. { reads the declaration blocks }
  25. procedure read_declarations(islibrary : boolean);
  26. { reads declarations in the interface part of a unit }
  27. procedure read_interface_declarations;
  28. implementation
  29. uses
  30. cobjects,scanner,
  31. symconst,aasm,tree,pass_1,strings,
  32. files,types,verbose,systems,import,
  33. cpubase
  34. {$ifndef newcg}
  35. ,tccnv
  36. {$endif newcg}
  37. {$ifdef GDB}
  38. ,gdb
  39. {$endif GDB}
  40. { parser specific stuff }
  41. ,pbase,ptconst,pexpr,ptype,psub,pexports
  42. { processor specific stuff }
  43. { codegen }
  44. {$ifdef newcg}
  45. ,cgbase
  46. {$else}
  47. ,hcodegen
  48. {$endif}
  49. ,hcgdata
  50. ;
  51. procedure parameter_dec(aktprocdef:pabstractprocdef);
  52. {
  53. handle_procvar needs the same changes
  54. }
  55. var
  56. is_procvar : boolean;
  57. sc : Pstringcontainer;
  58. s : string;
  59. storetokenpos : tfileposinfo;
  60. tt : ttype;
  61. hsym : psym;
  62. hvs,
  63. vs : Pvarsym;
  64. hs1,hs2 : string;
  65. varspez : Tvarspez;
  66. inserthigh : boolean;
  67. begin
  68. { parsing a proc or procvar ? }
  69. is_procvar:=(aktprocdef^.deftype=procvardef);
  70. consume(_LKLAMMER);
  71. inc(testcurobject);
  72. repeat
  73. if try_to_consume(_VAR) then
  74. varspez:=vs_var
  75. else
  76. if try_to_consume(_CONST) then
  77. varspez:=vs_const
  78. else
  79. varspez:=vs_value;
  80. inserthigh:=false;
  81. tt.reset;
  82. if idtoken=_SELF then
  83. begin
  84. { only allowed in procvars and class methods }
  85. if is_procvar or
  86. (assigned(procinfo^._class) and procinfo^._class^.is_class) then
  87. begin
  88. if not is_procvar then
  89. begin
  90. {$ifndef UseNiceNames}
  91. hs2:=hs2+'$'+'self';
  92. {$else UseNiceNames}
  93. hs2:=hs2+tostr(length('self'))+'self';
  94. {$endif UseNiceNames}
  95. vs:=new(Pvarsym,initdef('@',procinfo^._class));
  96. vs^.varspez:=vs_var;
  97. { insert the sym in the parasymtable }
  98. pprocdef(aktprocdef)^.parast^.insert(vs);
  99. {$ifdef INCLUDEOK}
  100. include(aktprocdef^.procoptions,po_containsself);
  101. {$else}
  102. aktprocdef^.procoptions:=aktprocdef^.procoptions+[po_containsself];
  103. {$endif}
  104. inc(procinfo^.selfpointer_offset,vs^.address);
  105. end;
  106. consume(idtoken);
  107. consume(_COLON);
  108. single_type(tt,hs1,false);
  109. aktprocdef^.concatpara(tt,vs_value);
  110. { check the types for procedures only }
  111. if not is_procvar then
  112. CheckTypes(tt.def,procinfo^._class);
  113. end
  114. else
  115. consume(_ID);
  116. end
  117. else
  118. begin
  119. { read identifiers }
  120. sc:=idlist;
  121. { read type declaration, force reading for value and const paras }
  122. if (token=_COLON) or (varspez=vs_value) then
  123. begin
  124. consume(_COLON);
  125. { check for an open array }
  126. if token=_ARRAY then
  127. begin
  128. consume(_ARRAY);
  129. consume(_OF);
  130. { define range and type of range }
  131. tt.setdef(new(Parraydef,init(0,-1,s32bitdef)));
  132. { array of const ? }
  133. if (token=_CONST) and (m_objpas in aktmodeswitches) then
  134. begin
  135. consume(_CONST);
  136. srsym:=nil;
  137. getsymonlyin(systemunit,'TVARREC');
  138. if not assigned(srsym) then
  139. InternalError(1234124);
  140. Parraydef(tt.def)^.elementtype:=ptypesym(srsym)^.restype;
  141. Parraydef(tt.def)^.IsArrayOfConst:=true;
  142. hs1:='array_of_const';
  143. end
  144. else
  145. begin
  146. { define field type }
  147. single_type(parraydef(tt.def)^.elementtype,hs1,false);
  148. hs1:='array_of_'+hs1;
  149. end;
  150. inserthigh:=true;
  151. end
  152. { open string ? }
  153. else if (varspez=vs_var) and
  154. (
  155. (
  156. ((token=_STRING) or (idtoken=_SHORTSTRING)) and
  157. (cs_openstring in aktmoduleswitches) and
  158. not(cs_ansistrings in aktlocalswitches)
  159. ) or
  160. (idtoken=_OPENSTRING)) then
  161. begin
  162. consume(token);
  163. tt.setdef(openshortstringdef);
  164. hs1:='openstring';
  165. inserthigh:=true;
  166. end
  167. { everything else }
  168. else
  169. single_type(tt,hs1,false);
  170. end
  171. else
  172. begin
  173. {$ifndef UseNiceNames}
  174. hs1:='$$$';
  175. {$else UseNiceNames}
  176. hs1:='var';
  177. {$endif UseNiceNames}
  178. tt.setdef(cformaldef);
  179. end;
  180. if not is_procvar then
  181. hs2:=pprocdef(aktprocdef)^.mangledname;
  182. storetokenpos:=tokenpos;
  183. while not sc^.empty do
  184. begin
  185. s:=sc^.get_with_tokeninfo(tokenpos);
  186. aktprocdef^.concatpara(tt,varspez);
  187. { For proc vars we only need the definitions }
  188. if not is_procvar then
  189. begin
  190. {$ifndef UseNiceNames}
  191. hs2:=hs2+'$'+hs1;
  192. {$else UseNiceNames}
  193. hs2:=hs2+tostr(length(hs1))+hs1;
  194. {$endif UseNiceNames}
  195. vs:=new(pvarsym,init(s,tt));
  196. vs^.varspez:=varspez;
  197. { we have to add this to avoid var param to be in registers !!!}
  198. if (varspez in [vs_var,vs_const]) and push_addr_param(tt.def) then
  199. {$ifdef INCLUDEOK}
  200. include(vs^.varoptions,vo_regable);
  201. {$else}
  202. vs^.varoptions:=vs^.varoptions+[vo_regable];
  203. {$endif}
  204. { search for duplicate ids in object members/methods }
  205. { but only the current class, I don't know why ... }
  206. { at least TP and Delphi do it in that way (FK) }
  207. if assigned(procinfo^._class) and
  208. (lexlevel=normal_function_level) then
  209. begin
  210. hsym:=procinfo^._class^.symtable^.search(vs^.name);
  211. if assigned(hsym) then
  212. DuplicateSym(hsym);
  213. end;
  214. { do we need a local copy? }
  215. if (varspez=vs_value) and
  216. push_addr_param(tt.def) and
  217. not(is_open_array(tt.def) or is_array_of_const(tt.def)) then
  218. vs^.setname('val'+vs^.name);
  219. { insert the sym in the parasymtable }
  220. pprocdef(aktprocdef)^.parast^.insert(vs);
  221. { also need to push a high value? }
  222. if inserthigh then
  223. begin
  224. hvs:=new(Pvarsym,initdef('high'+s,s32bitdef));
  225. hvs^.varspez:=vs_const;
  226. pprocdef(aktprocdef)^.parast^.insert(hvs);
  227. end;
  228. end;
  229. end;
  230. dispose(sc,done);
  231. tokenpos:=storetokenpos;
  232. end;
  233. { set the new mangled name }
  234. if not is_procvar then
  235. pprocdef(aktprocdef)^.setmangledname(hs2);
  236. until not try_to_consume(_SEMICOLON);
  237. dec(testcurobject);
  238. consume(_RKLAMMER);
  239. end;
  240. const
  241. variantrecordlevel : longint = 0;
  242. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  243. { reads the filed of a record into a }
  244. { symtablestack, if record=false }
  245. { variants are forbidden, so this procedure }
  246. { can be used to read object fields }
  247. { if absolute is true, ABSOLUTE and file }
  248. { types are allowed }
  249. { => the procedure is also used to read }
  250. { a sequence of variable declaration }
  251. procedure insert_syms(st : psymtable;sc : pstringcontainer;tt : ttype;is_threadvar : boolean);
  252. { inserts the symbols of sc in st with def as definition or sym as ptypesym, sc is disposed }
  253. var
  254. s : string;
  255. filepos : tfileposinfo;
  256. ss : pvarsym;
  257. begin
  258. filepos:=tokenpos;
  259. while not sc^.empty do
  260. begin
  261. s:=sc^.get_with_tokeninfo(tokenpos);
  262. ss:=new(pvarsym,init(s,tt));
  263. if is_threadvar then
  264. {$ifdef INCLUDEOK}
  265. include(ss^.varoptions,vo_is_thread_var);
  266. {$else}
  267. ss^.varoptions:=ss^.varoptions+[vo_is_thread_var];
  268. {$endif}
  269. st^.insert(ss);
  270. { static data fields are inserted in the globalsymtable }
  271. if (st^.symtabletype=objectsymtable) and
  272. (sp_static in current_object_option) then
  273. begin
  274. s:=lower(st^.name^)+'_'+s;
  275. st^.defowner^.owner^.insert(new(pvarsym,init(s,tt)));
  276. end;
  277. end;
  278. dispose(sc,done);
  279. tokenpos:=filepos;
  280. end;
  281. var
  282. sc : pstringcontainer;
  283. s : stringid;
  284. old_block_type : tblock_type;
  285. declarepos,storetokenpos : tfileposinfo;
  286. symdone : boolean;
  287. { to handle absolute }
  288. abssym : pabsolutesym;
  289. l : longint;
  290. code : integer;
  291. { c var }
  292. newtype : ptypesym;
  293. is_dll,
  294. is_gpc_name,is_cdecl,extern_aktvarsym,export_aktvarsym : boolean;
  295. old_current_object_option : tsymoptions;
  296. dll_name,
  297. C_name : string;
  298. tt,casetype : ttype;
  299. { Delphi initialized vars }
  300. pconstsym : ptypedconstsym;
  301. { maxsize contains the max. size of a variant }
  302. { startvarrec contains the start of the variant part of a record }
  303. maxsize,startvarrec : longint;
  304. pt : ptree;
  305. begin
  306. old_block_type:=block_type;
  307. block_type:=bt_type;
  308. is_gpc_name:=false;
  309. { Force an expected ID error message }
  310. if not (token in [_ID,_CASE,_END]) then
  311. consume(_ID);
  312. { read vars }
  313. while (token=_ID) and
  314. not(is_object and (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED])) do
  315. begin
  316. C_name:=orgpattern;
  317. sc:=idlist;
  318. consume(_COLON);
  319. if (m_gpc in aktmodeswitches) and
  320. not(is_record or is_object or is_threadvar) and
  321. (token=_ID) and (orgpattern='__asmname__') then
  322. begin
  323. consume(_ID);
  324. C_name:=pattern;
  325. if token=_CCHAR then
  326. consume(_CCHAR)
  327. else
  328. consume(_CSTRING);
  329. Is_gpc_name:=true;
  330. end;
  331. { this is needed for Delphi mode at least
  332. but should be OK for all modes !! (PM) }
  333. ignore_equal:=true;
  334. read_type(tt,'');
  335. if (variantrecordlevel>0) and tt.def^.needs_inittable then
  336. Message(parser_e_cant_use_inittable_here);
  337. ignore_equal:=false;
  338. symdone:=false;
  339. if is_gpc_name then
  340. begin
  341. storetokenpos:=tokenpos;
  342. s:=sc^.get_with_tokeninfo(tokenpos);
  343. if not sc^.empty then
  344. Message(parser_e_absolute_only_one_var);
  345. dispose(sc,done);
  346. aktvarsym:=new(pvarsym,init_C(s,target_os.Cprefix+C_name,tt));
  347. {$ifdef INCLUDEOK}
  348. include(aktvarsym^.varoptions,vo_is_external);
  349. {$else}
  350. aktvarsym^.varoptions:=aktvarsym^.varoptions+[vo_is_external];
  351. {$endif}
  352. symtablestack^.insert(aktvarsym);
  353. tokenpos:=storetokenpos;
  354. symdone:=true;
  355. end;
  356. { check for absolute }
  357. if not symdone and
  358. (idtoken=_ABSOLUTE) and not(is_record or is_object or is_threadvar) then
  359. begin
  360. consume(_ABSOLUTE);
  361. { only allowed for one var }
  362. s:=sc^.get_with_tokeninfo(declarepos);
  363. if not sc^.empty then
  364. Message(parser_e_absolute_only_one_var);
  365. dispose(sc,done);
  366. { parse the rest }
  367. if token=_ID then
  368. begin
  369. getsym(pattern,true);
  370. consume(_ID);
  371. { support unit.variable }
  372. if srsym^.typ=unitsym then
  373. begin
  374. consume(_POINT);
  375. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  376. consume(_ID);
  377. end;
  378. { we should check the result type of srsym }
  379. if not (srsym^.typ in [varsym,typedconstsym]) then
  380. Message(parser_e_absolute_only_to_var_or_const);
  381. storetokenpos:=tokenpos;
  382. tokenpos:=declarepos;
  383. abssym:=new(pabsolutesym,init(s,tt));
  384. abssym^.abstyp:=tovar;
  385. abssym^.ref:=srsym;
  386. symtablestack^.insert(abssym);
  387. tokenpos:=storetokenpos;
  388. end
  389. else
  390. if (token=_CSTRING) or (token=_CCHAR) then
  391. begin
  392. storetokenpos:=tokenpos;
  393. tokenpos:=declarepos;
  394. abssym:=new(pabsolutesym,init(s,tt));
  395. s:=pattern;
  396. consume(token);
  397. abssym^.abstyp:=toasm;
  398. abssym^.asmname:=stringdup(s);
  399. symtablestack^.insert(abssym);
  400. tokenpos:=storetokenpos;
  401. end
  402. else
  403. { absolute address ?!? }
  404. if token=_INTCONST then
  405. begin
  406. if (target_info.target=target_i386_go32v2) then
  407. begin
  408. storetokenpos:=tokenpos;
  409. tokenpos:=declarepos;
  410. abssym:=new(pabsolutesym,init(s,tt));
  411. abssym^.abstyp:=toaddr;
  412. abssym^.absseg:=false;
  413. s:=pattern;
  414. consume(_INTCONST);
  415. val(s,abssym^.address,code);
  416. if token=_COLON then
  417. begin
  418. consume(token);
  419. s:=pattern;
  420. consume(_INTCONST);
  421. val(s,l,code);
  422. abssym^.address:=abssym^.address shl 4+l;
  423. abssym^.absseg:=true;
  424. end;
  425. symtablestack^.insert(abssym);
  426. tokenpos:=storetokenpos;
  427. end
  428. else
  429. Message(parser_e_absolute_only_to_var_or_const);
  430. end
  431. else
  432. Message(parser_e_absolute_only_to_var_or_const);
  433. symdone:=true;
  434. end;
  435. { Handling of Delphi typed const = initialized vars ! }
  436. { When should this be rejected ?
  437. - in parasymtable
  438. - in record or object
  439. - ... (PM) }
  440. if (m_delphi in aktmodeswitches) and (token=_EQUAL) and
  441. not (symtablestack^.symtabletype in [parasymtable]) and
  442. not is_record and not is_object then
  443. begin
  444. storetokenpos:=tokenpos;
  445. s:=sc^.get_with_tokeninfo(tokenpos);
  446. if not sc^.empty then
  447. Message(parser_e_initialized_only_one_var);
  448. pconstsym:=new(ptypedconstsym,inittype(s,tt,false));
  449. symtablestack^.insert(pconstsym);
  450. tokenpos:=storetokenpos;
  451. consume(_EQUAL);
  452. readtypedconst(tt.def,pconstsym,false);
  453. symdone:=true;
  454. end;
  455. { for a record there doesn't need to be a ; before the END or ) }
  456. if not((is_record or is_object) and (token in [_END,_RKLAMMER])) then
  457. consume(_SEMICOLON);
  458. { procvar handling }
  459. if (tt.def^.deftype=procvardef) and (tt.def^.typesym=nil) then
  460. begin
  461. newtype:=new(ptypesym,init('unnamed',tt));
  462. parse_var_proc_directives(psym(newtype));
  463. newtype^.restype.def:=nil;
  464. tt.def^.typesym:=nil;
  465. dispose(newtype,done);
  466. end;
  467. { Check for variable directives }
  468. if not symdone and (token=_ID) then
  469. begin
  470. { Check for C Variable declarations }
  471. if (m_cvar_support in aktmodeswitches) and
  472. not(is_record or is_object or is_threadvar) and
  473. (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR]) then
  474. begin
  475. { only allowed for one var }
  476. s:=sc^.get_with_tokeninfo(declarepos);
  477. if not sc^.empty then
  478. Message(parser_e_absolute_only_one_var);
  479. dispose(sc,done);
  480. { defaults }
  481. is_dll:=false;
  482. is_cdecl:=false;
  483. extern_aktvarsym:=false;
  484. export_aktvarsym:=false;
  485. { cdecl }
  486. if idtoken=_CVAR then
  487. begin
  488. consume(_CVAR);
  489. consume(_SEMICOLON);
  490. is_cdecl:=true;
  491. C_name:=target_os.Cprefix+C_name;
  492. end;
  493. { external }
  494. if idtoken=_EXTERNAL then
  495. begin
  496. consume(_EXTERNAL);
  497. extern_aktvarsym:=true;
  498. end;
  499. { export }
  500. if idtoken in [_EXPORT,_PUBLIC] then
  501. begin
  502. consume(_ID);
  503. if extern_aktvarsym then
  504. Message(parser_e_not_external_and_export)
  505. else
  506. export_aktvarsym:=true;
  507. end;
  508. { external and export need a name after when no cdecl is used }
  509. if not is_cdecl then
  510. begin
  511. { dll name ? }
  512. if (extern_aktvarsym) and (idtoken<>_NAME) then
  513. begin
  514. is_dll:=true;
  515. dll_name:=get_stringconst;
  516. end;
  517. consume(_NAME);
  518. C_name:=get_stringconst;
  519. end;
  520. { consume the ; when export or external is used }
  521. if extern_aktvarsym or export_aktvarsym then
  522. consume(_SEMICOLON);
  523. { insert in the symtable }
  524. storetokenpos:=tokenpos;
  525. tokenpos:=declarepos;
  526. if is_dll then
  527. aktvarsym:=new(pvarsym,init_dll(s,tt))
  528. else
  529. aktvarsym:=new(pvarsym,init_C(s,C_name,tt));
  530. { set some vars options }
  531. if export_aktvarsym then
  532. inc(aktvarsym^.refs);
  533. if extern_aktvarsym then
  534. {$ifdef INCLUDEOK}
  535. include(aktvarsym^.varoptions,vo_is_external);
  536. {$else}
  537. aktvarsym^.varoptions:=aktvarsym^.varoptions+[vo_is_external];
  538. {$endif}
  539. { insert in the stack/datasegment }
  540. symtablestack^.insert(aktvarsym);
  541. tokenpos:=storetokenpos;
  542. { now we can insert it in the import lib if its a dll, or
  543. add it to the externals }
  544. if extern_aktvarsym then
  545. begin
  546. if is_dll then
  547. begin
  548. if not(current_module^.uses_imports) then
  549. begin
  550. current_module^.uses_imports:=true;
  551. importlib^.preparelib(current_module^.modulename^);
  552. end;
  553. importlib^.importvariable(aktvarsym^.mangledname,dll_name,C_name)
  554. end
  555. end;
  556. symdone:=true;
  557. end
  558. else
  559. if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
  560. begin
  561. {$ifdef INCLUDEOK}
  562. include(current_object_option,sp_static);
  563. {$else}
  564. current_object_option:=current_object_option+[sp_static];
  565. {$endif}
  566. insert_syms(symtablestack,sc,tt,false);
  567. {$ifdef INCLUDEOK}
  568. exclude(current_object_option,sp_static);
  569. {$else}
  570. current_object_option:=current_object_option-[sp_static];
  571. {$endif}
  572. consume(_STATIC);
  573. consume(_SEMICOLON);
  574. symdone:=true;
  575. end;
  576. end;
  577. { insert it in the symtable, if not done yet }
  578. if not symdone then
  579. begin
  580. { save object option, because we can turn of the sp_published }
  581. old_current_object_option:=current_object_option;
  582. if (sp_published in current_object_option) and
  583. (not((tt.def^.deftype=objectdef) and (pobjectdef(tt.def)^.is_class))) then
  584. begin
  585. Message(parser_e_cant_publish_that);
  586. exclude(current_object_option,sp_published);
  587. end
  588. else
  589. if (sp_published in current_object_option) and
  590. not(oo_can_have_published in pobjectdef(tt.def)^.objectoptions) then
  591. begin
  592. Message(parser_e_only_publishable_classes_can__be_published);
  593. exclude(current_object_option,sp_published);
  594. end;
  595. insert_syms(symtablestack,sc,tt,is_threadvar);
  596. current_object_option:=old_current_object_option;
  597. end;
  598. end;
  599. { Check for Case }
  600. if is_record and (token=_CASE) then
  601. begin
  602. maxsize:=0;
  603. consume(_CASE);
  604. s:=pattern;
  605. getsym(s,false);
  606. { may be only a type: }
  607. if assigned(srsym) and (srsym^.typ in [typesym,unitsym]) then
  608. read_type(casetype,'')
  609. else
  610. begin
  611. consume(_ID);
  612. consume(_COLON);
  613. read_type(casetype,'');
  614. symtablestack^.insert(new(pvarsym,init(s,casetype)));
  615. end;
  616. if not(is_ordinal(casetype.def)) or is_64bitint(casetype.def) then
  617. Message(type_e_ordinal_expr_expected);
  618. consume(_OF);
  619. startvarrec:=symtablestack^.datasize;
  620. repeat
  621. repeat
  622. pt:=comp_expr(true);
  623. do_firstpass(pt);
  624. if not(pt^.treetype=ordconstn) then
  625. Message(cg_e_illegal_expression);
  626. disposetree(pt);
  627. if token=_COMMA then
  628. consume(_COMMA)
  629. else
  630. break;
  631. until false;
  632. consume(_COLON);
  633. { read the vars }
  634. consume(_LKLAMMER);
  635. inc(variantrecordlevel);
  636. if token<>_RKLAMMER then
  637. read_var_decs(true,false,false);
  638. dec(variantrecordlevel);
  639. consume(_RKLAMMER);
  640. { calculates maximal variant size }
  641. maxsize:=max(maxsize,symtablestack^.datasize);
  642. { the items of the next variant are overlayed }
  643. symtablestack^.datasize:=startvarrec;
  644. if (token<>_END) and (token<>_RKLAMMER) then
  645. consume(_SEMICOLON)
  646. else
  647. break;
  648. until (token=_END) or (token=_RKLAMMER);
  649. { at last set the record size to that of the biggest variant }
  650. symtablestack^.datasize:=maxsize;
  651. end;
  652. block_type:=old_block_type;
  653. end;
  654. procedure const_dec;
  655. var
  656. name : stringid;
  657. p : ptree;
  658. tt : ttype;
  659. sym : psym;
  660. storetokenpos,filepos : tfileposinfo;
  661. old_block_type : tblock_type;
  662. ps : pconstset;
  663. pd : pbestreal;
  664. sp : pchar;
  665. skipequal : boolean;
  666. begin
  667. consume(_CONST);
  668. old_block_type:=block_type;
  669. block_type:=bt_const;
  670. repeat
  671. name:=pattern;
  672. filepos:=tokenpos;
  673. consume(_ID);
  674. case token of
  675. _EQUAL:
  676. begin
  677. consume(_EQUAL);
  678. p:=comp_expr(true);
  679. do_firstpass(p);
  680. storetokenpos:=tokenpos;
  681. tokenpos:=filepos;
  682. case p^.treetype of
  683. ordconstn:
  684. begin
  685. if is_constintnode(p) then
  686. symtablestack^.insert(new(pconstsym,init_def(name,constint,p^.value,nil)))
  687. else if is_constcharnode(p) then
  688. symtablestack^.insert(new(pconstsym,init_def(name,constchar,p^.value,nil)))
  689. else if is_constboolnode(p) then
  690. symtablestack^.insert(new(pconstsym,init_def(name,constbool,p^.value,nil)))
  691. else if p^.resulttype^.deftype=enumdef then
  692. symtablestack^.insert(new(pconstsym,init_def(name,constord,p^.value,p^.resulttype)))
  693. else if p^.resulttype^.deftype=pointerdef then
  694. symtablestack^.insert(new(pconstsym,init_def(name,constord,p^.value,p^.resulttype)))
  695. else internalerror(111);
  696. end;
  697. stringconstn:
  698. begin
  699. getmem(sp,p^.length+1);
  700. move(p^.value_str^,sp^,p^.length+1);
  701. symtablestack^.insert(new(pconstsym,init_string(name,conststring,sp,p^.length)));
  702. end;
  703. realconstn :
  704. begin
  705. new(pd);
  706. pd^:=p^.value_real;
  707. symtablestack^.insert(new(pconstsym,init(name,constreal,longint(pd))));
  708. end;
  709. setconstn :
  710. begin
  711. new(ps);
  712. ps^:=p^.value_set^;
  713. symtablestack^.insert(new(pconstsym,init_def(name,constset,longint(ps),p^.resulttype)));
  714. end;
  715. pointerconstn :
  716. begin
  717. symtablestack^.insert(new(pconstsym,init_def(name,constpointer,p^.value,p^.resulttype)))
  718. end;
  719. niln :
  720. begin
  721. symtablestack^.insert(new(pconstsym,init_def(name,constnil,0,p^.resulttype)));
  722. end;
  723. else
  724. Message(cg_e_illegal_expression);
  725. end;
  726. tokenpos:=storetokenpos;
  727. consume(_SEMICOLON);
  728. disposetree(p);
  729. end;
  730. _COLON:
  731. begin
  732. { set the blocktype first so a consume also supports a
  733. caret, to support const s : ^string = nil }
  734. block_type:=bt_type;
  735. consume(_COLON);
  736. ignore_equal:=true;
  737. read_type(tt,'');
  738. ignore_equal:=false;
  739. block_type:=bt_const;
  740. skipequal:=false;
  741. { create symbol }
  742. storetokenpos:=tokenpos;
  743. tokenpos:=filepos;
  744. {$ifdef DELPHI_CONST_IN_RODATA}
  745. if m_delphi in aktmodeswitches then
  746. begin
  747. if assigned(readtypesym) then
  748. sym:=new(ptypedconstsym,initsym(name,readtypesym,true))
  749. else
  750. sym:=new(ptypedconstsym,init(name,def,true))
  751. end
  752. else
  753. {$endif DELPHI_CONST_IN_RODATA}
  754. begin
  755. sym:=new(ptypedconstsym,inittype(name,tt,false))
  756. end;
  757. tokenpos:=storetokenpos;
  758. symtablestack^.insert(sym);
  759. { procvar can have proc directives }
  760. if (tt.def^.deftype=procvardef) then
  761. begin
  762. { support p : procedure;stdcall=nil; }
  763. if (token=_SEMICOLON) then
  764. begin
  765. consume(_SEMICOLON);
  766. if is_proc_directive(token) then
  767. parse_var_proc_directives(sym)
  768. else
  769. begin
  770. Message(parser_e_proc_directive_expected);
  771. skipequal:=true;
  772. end;
  773. end
  774. else
  775. { support p : procedure stdcall=nil; }
  776. begin
  777. if is_proc_directive(token) then
  778. parse_var_proc_directives(sym);
  779. end;
  780. end;
  781. if not skipequal then
  782. begin
  783. { get init value }
  784. consume(_EQUAL);
  785. {$ifdef DELPHI_CONST_IN_RODATA}
  786. if m_delphi in aktmodeswitches then
  787. readtypedconst(tt.def,ptypedconstsym(sym),true)
  788. else
  789. {$endif DELPHI_CONST_IN_RODATA}
  790. readtypedconst(tt.def,ptypedconstsym(sym),false);
  791. consume(_SEMICOLON);
  792. end;
  793. end;
  794. else
  795. { generate an error }
  796. consume(_EQUAL);
  797. end;
  798. until token<>_ID;
  799. block_type:=old_block_type;
  800. end;
  801. procedure label_dec;
  802. var
  803. hl : pasmlabel;
  804. begin
  805. consume(_LABEL);
  806. if not(cs_support_goto in aktmoduleswitches) then
  807. Message(sym_e_goto_and_label_not_supported);
  808. repeat
  809. if not(token in [_ID,_INTCONST]) then
  810. consume(_ID)
  811. else
  812. begin
  813. getlabel(hl);
  814. symtablestack^.insert(new(plabelsym,init(pattern,hl)));
  815. consume(token);
  816. end;
  817. if token<>_SEMICOLON then consume(_COMMA);
  818. until not(token in [_ID,_INTCONST]);
  819. consume(_SEMICOLON);
  820. end;
  821. { search in symtablestack used, but not defined type }
  822. procedure resolve_type_forward(p : pnamedindexobject);{$ifndef FPC}far;{$endif}
  823. var
  824. hpd,pd : pdef;
  825. stpos : tfileposinfo;
  826. again : boolean;
  827. begin
  828. { Check only typesyms or record/object fields }
  829. case psym(p)^.typ of
  830. typesym :
  831. pd:=ptypesym(p)^.restype.def;
  832. varsym :
  833. if (psym(p)^.owner^.symtabletype in [objectsymtable,recordsymtable]) then
  834. pd:=pvarsym(p)^.vartype.def
  835. else
  836. exit;
  837. else
  838. exit;
  839. end;
  840. repeat
  841. again:=false;
  842. case pd^.deftype of
  843. arraydef :
  844. begin
  845. { elementtype could also be defined using a forwarddef }
  846. pd:=parraydef(pd)^.elementtype.def;
  847. again:=true;
  848. end;
  849. pointerdef,
  850. classrefdef :
  851. begin
  852. { classrefdef inherits from pointerdef }
  853. hpd:=ppointerdef(pd)^.pointertype.def;
  854. { still a forward def ? }
  855. if hpd^.deftype=forwarddef then
  856. begin
  857. { try to resolve the forward }
  858. { get the correct position for it }
  859. stpos:=tokenpos;
  860. tokenpos:=pforwarddef(hpd)^.forwardpos;
  861. resolving_forward:=true;
  862. getsym(pforwarddef(hpd)^.tosymname,false);
  863. resolving_forward:=false;
  864. tokenpos:=stpos;
  865. { we don't need the forwarddef anymore, dispose it }
  866. dispose(hpd,done);
  867. { was a type sym found ? }
  868. if assigned(srsym) and
  869. (srsym^.typ=typesym) then
  870. begin
  871. ppointerdef(pd)^.pointertype:=ptypesym(srsym)^.restype;
  872. {$ifdef GDB}
  873. if (cs_debuginfo in aktmoduleswitches) and assigned(debuglist) and
  874. (psym(p)^.owner^.symtabletype in [globalsymtable,staticsymtable]) then
  875. begin
  876. ptypesym(p)^.isusedinstab := true;
  877. psym(p)^.concatstabto(debuglist);
  878. end;
  879. {$endif GDB}
  880. { we need a class type for classrefdef }
  881. if (pd^.deftype=classrefdef) and
  882. not((ptypesym(srsym)^.restype.def^.deftype=objectdef) and
  883. pobjectdef(ptypesym(srsym)^.restype.def)^.is_class) then
  884. Message1(type_e_class_type_expected,ptypesym(srsym)^.restype.def^.typename);
  885. end
  886. else
  887. begin
  888. MessagePos1(psym(p)^.fileinfo,sym_e_forward_type_not_resolved,p^.name);
  889. { try to recover }
  890. ppointerdef(pd)^.pointertype.def:=generrordef;
  891. end;
  892. end;
  893. end;
  894. recorddef :
  895. precorddef(pd)^.symtable^.foreach({$ifndef TP}@{$endif}resolve_type_forward);
  896. objectdef :
  897. { Don't check objectdefs in objects/records, because these can't
  898. exist (anonymous objects aren't allowed) }
  899. if not(psym(p)^.owner^.symtabletype in [objectsymtable,recordsymtable]) then
  900. pobjectdef(pd)^.symtable^.foreach({$ifndef TP}@{$endif}resolve_type_forward);
  901. end;
  902. until not again;
  903. end;
  904. { reads a type declaration to the symbol table }
  905. procedure type_dec;
  906. var
  907. typename : stringid;
  908. newtype : ptypesym;
  909. sym : psym;
  910. tt : ttype;
  911. defpos,storetokenpos : tfileposinfo;
  912. old_block_type : tblock_type;
  913. begin
  914. old_block_type:=block_type;
  915. block_type:=bt_type;
  916. consume(_TYPE);
  917. typecanbeforward:=true;
  918. repeat
  919. typename:=pattern;
  920. defpos:=tokenpos;
  921. consume(_ID);
  922. consume(_EQUAL);
  923. { support 'ttype=type word' syntax }
  924. if token=_TYPE then
  925. Consume(_TYPE);
  926. { is the type already defined? }
  927. getsym(typename,false);
  928. sym:=srsym;
  929. newtype:=nil;
  930. { found a symbol with this name? }
  931. if assigned(sym) then
  932. begin
  933. if (sym^.typ=typesym) then
  934. begin
  935. if (token=_CLASS) and
  936. (assigned(ptypesym(sym)^.restype.def)) and
  937. (ptypesym(sym)^.restype.def^.deftype=objectdef) and
  938. pobjectdef(ptypesym(sym)^.restype.def)^.is_class and
  939. (oo_is_forward in pobjectdef(ptypesym(sym)^.restype.def)^.objectoptions) then
  940. begin
  941. { we can ignore the result }
  942. { the definition is modified }
  943. object_dec(typename,pobjectdef(ptypesym(sym)^.restype.def));
  944. newtype:=ptypesym(sym);
  945. end;
  946. end;
  947. end;
  948. { no old type reused ? Then insert this new type }
  949. if not assigned(newtype) then
  950. begin
  951. read_type(tt,typename);
  952. storetokenpos:=tokenpos;
  953. tokenpos:=defpos;
  954. newtype:=new(ptypesym,init(typename,tt));
  955. newtype:=ptypesym(symtablestack^.insert(newtype));
  956. tokenpos:=storetokenpos;
  957. end;
  958. consume(_SEMICOLON);
  959. if assigned(newtype^.restype.def) and
  960. (newtype^.restype.def^.deftype=procvardef) then
  961. parse_var_proc_directives(psym(newtype));
  962. until token<>_ID;
  963. typecanbeforward:=false;
  964. symtablestack^.foreach({$ifndef TP}@{$endif}resolve_type_forward);
  965. block_type:=old_block_type;
  966. end;
  967. procedure var_dec;
  968. { parses variable declarations and inserts them in }
  969. { the top symbol table of symtablestack }
  970. begin
  971. consume(_VAR);
  972. read_var_decs(false,false,false);
  973. end;
  974. procedure threadvar_dec;
  975. { parses thread variable declarations and inserts them in }
  976. { the top symbol table of symtablestack }
  977. begin
  978. consume(_THREADVAR);
  979. if not(symtablestack^.symtabletype in [staticsymtable,globalsymtable]) then
  980. message(parser_e_threadvars_only_sg);
  981. read_var_decs(false,false,true);
  982. end;
  983. procedure resourcestring_dec;
  984. var
  985. name : stringid;
  986. p : ptree;
  987. storetokenpos,filepos : tfileposinfo;
  988. old_block_type : tblock_type;
  989. sp : pchar;
  990. begin
  991. consume(_RESOURCESTRING);
  992. if not(symtablestack^.symtabletype in [staticsymtable,globalsymtable]) then
  993. message(parser_e_resourcestring_only_sg);
  994. old_block_type:=block_type;
  995. block_type:=bt_const;
  996. repeat
  997. name:=pattern;
  998. filepos:=tokenpos;
  999. consume(_ID);
  1000. case token of
  1001. _EQUAL:
  1002. begin
  1003. consume(_EQUAL);
  1004. p:=comp_expr(true);
  1005. do_firstpass(p);
  1006. storetokenpos:=tokenpos;
  1007. tokenpos:=filepos;
  1008. case p^.treetype of
  1009. ordconstn:
  1010. begin
  1011. if is_constcharnode(p) then
  1012. begin
  1013. getmem(sp,2);
  1014. sp[0]:=chr(p^.value);
  1015. sp[1]:=#0;
  1016. symtablestack^.insert(new(pconstsym,init_string(name,constresourcestring,sp,1)));
  1017. end
  1018. else
  1019. Message(cg_e_illegal_expression);
  1020. end;
  1021. stringconstn:
  1022. begin
  1023. getmem(sp,p^.length+1);
  1024. move(p^.value_str^,sp^,p^.length+1);
  1025. symtablestack^.insert(new(pconstsym,init_string(name,constresourcestring,sp,p^.length)));
  1026. end;
  1027. else
  1028. Message(cg_e_illegal_expression);
  1029. end;
  1030. tokenpos:=storetokenpos;
  1031. consume(_SEMICOLON);
  1032. disposetree(p);
  1033. end;
  1034. else consume(_EQUAL);
  1035. end;
  1036. until token<>_ID;
  1037. block_type:=old_block_type;
  1038. end;
  1039. procedure Not_supported_for_inline(t : ttoken);
  1040. begin
  1041. if assigned(aktprocsym) and
  1042. (pocall_inline in aktprocsym^.definition^.proccalloptions) then
  1043. Begin
  1044. Message1(parser_w_not_supported_for_inline,tokenstring(t));
  1045. Message(parser_w_inlining_disabled);
  1046. {$ifdef INCLUDEOK}
  1047. exclude(aktprocsym^.definition^.proccalloptions,pocall_inline);
  1048. {$else}
  1049. aktprocsym^.definition^.proccalloptions:=aktprocsym^.definition^.proccalloptions-[pocall_inline];
  1050. {$endif}
  1051. End;
  1052. end;
  1053. procedure read_declarations(islibrary : boolean);
  1054. begin
  1055. repeat
  1056. case token of
  1057. _LABEL:
  1058. begin
  1059. Not_supported_for_inline(token);
  1060. label_dec;
  1061. end;
  1062. _CONST:
  1063. begin
  1064. Not_supported_for_inline(token);
  1065. const_dec;
  1066. end;
  1067. _TYPE:
  1068. begin
  1069. Not_supported_for_inline(token);
  1070. type_dec;
  1071. end;
  1072. _VAR:
  1073. var_dec;
  1074. _THREADVAR:
  1075. threadvar_dec;
  1076. _CONSTRUCTOR,_DESTRUCTOR,
  1077. _FUNCTION,_PROCEDURE,_OPERATOR,_CLASS:
  1078. begin
  1079. Not_supported_for_inline(token);
  1080. read_proc;
  1081. end;
  1082. _RESOURCESTRING:
  1083. resourcestring_dec;
  1084. _EXPORTS:
  1085. begin
  1086. Not_supported_for_inline(token);
  1087. { here we should be at lexlevel 1, no ? PM }
  1088. if (lexlevel<>main_program_level) or
  1089. (current_module^.is_unit) then
  1090. begin
  1091. Message(parser_e_syntax_error);
  1092. consume_all_until(_SEMICOLON);
  1093. end
  1094. else if islibrary or (target_info.target=target_i386_WIN32) then
  1095. read_exports;
  1096. end
  1097. else break;
  1098. end;
  1099. until false;
  1100. end;
  1101. procedure read_interface_declarations;
  1102. begin
  1103. {Since the body is now parsed at lexlevel 1, and the declarations
  1104. must be parsed at the same lexlevel we increase the lexlevel.}
  1105. inc(lexlevel);
  1106. repeat
  1107. case token of
  1108. _CONST : const_dec;
  1109. _TYPE : type_dec;
  1110. _VAR : var_dec;
  1111. _THREADVAR : threadvar_dec;
  1112. _RESOURCESTRING:
  1113. resourcestring_dec;
  1114. _FUNCTION,
  1115. _PROCEDURE,
  1116. _OPERATOR : read_proc;
  1117. else
  1118. break;
  1119. end;
  1120. until false;
  1121. dec(lexlevel);
  1122. end;
  1123. end.
  1124. {
  1125. $Log$
  1126. Revision 1.176 2000-01-07 01:14:28 peter
  1127. * updated copyright to 2000
  1128. Revision 1.175 1999/12/10 10:04:21 peter
  1129. * also check elementtype of arraydef for forwarddef
  1130. Revision 1.174 1999/12/01 12:42:32 peter
  1131. * fixed bug 698
  1132. * removed some notes about unused vars
  1133. Revision 1.173 1999/11/30 10:40:44 peter
  1134. + ttype, tsymlist
  1135. Revision 1.172 1999/11/29 15:18:27 pierre
  1136. + allow exports in win32 executables
  1137. Revision 1.171 1999/11/09 23:43:08 pierre
  1138. * better browser info
  1139. Revision 1.170 1999/11/09 23:06:45 peter
  1140. * esi_offset -> selfpointer_offset to be newcg compatible
  1141. * hcogegen -> cgbase fixes for newcg
  1142. Revision 1.169 1999/11/09 12:58:29 peter
  1143. * support absolute unit.variable
  1144. Revision 1.168 1999/11/06 14:34:21 peter
  1145. * truncated log to 20 revs
  1146. Revision 1.167 1999/10/26 12:30:44 peter
  1147. * const parameter is now checked
  1148. * better and generic check if a node can be used for assigning
  1149. * export fixes
  1150. * procvar equal works now (it never had worked at least from 0.99.8)
  1151. * defcoll changed to linkedlist with pparaitem so it can easily be
  1152. walked both directions
  1153. Revision 1.166 1999/10/22 10:39:34 peter
  1154. * split type reading from pdecl to ptype unit
  1155. * parameter_dec routine is now used for procedure and procvars
  1156. Revision 1.165 1999/10/21 16:41:41 florian
  1157. * problems with readln fixed: esi wasn't restored correctly when
  1158. reading ordinal fields of objects futher the register allocation
  1159. didn't take care of the extra register when reading ordinal values
  1160. * enumerations can now be used in constant indexes of properties
  1161. Revision 1.164 1999/10/14 14:57:52 florian
  1162. - removed the hcodegen use in the new cg, use cgbase instead
  1163. Revision 1.163 1999/10/06 17:39:14 peter
  1164. * fixed stabs writting for forward types
  1165. Revision 1.162 1999/10/03 19:44:42 peter
  1166. * removed objpasunit reference, tvarrec is now searched in systemunit
  1167. where it already was located
  1168. Revision 1.161 1999/10/01 11:18:02 peter
  1169. * class/record type forward checking fixed
  1170. Revision 1.159 1999/10/01 10:05:42 peter
  1171. + procedure directive support in const declarations, fixes bug 232
  1172. Revision 1.158 1999/10/01 08:02:46 peter
  1173. * forward type declaration rewritten
  1174. Revision 1.157 1999/09/27 23:44:53 peter
  1175. * procinfo is now a pointer
  1176. * support for result setting in sub procedure
  1177. Revision 1.156 1999/09/26 21:30:19 peter
  1178. + constant pointer support which can happend with typecasting like
  1179. const p=pointer(1)
  1180. * better procvar parsing in typed consts
  1181. Revision 1.155 1999/09/20 16:38:59 peter
  1182. * cs_create_smart instead of cs_smartlink
  1183. * -CX is create smartlink
  1184. * -CD is create dynamic, but does nothing atm.
  1185. Revision 1.154 1999/09/15 22:09:24 florian
  1186. + rtti is now automatically generated for published classes, i.e.
  1187. they are handled like an implicit property
  1188. Revision 1.153 1999/09/14 11:09:08 florian
  1189. * per default a property is stored, fixed
  1190. Revision 1.152 1999/09/12 14:50:50 florian
  1191. + implemented creation of methodname/address tables
  1192. Revision 1.151 1999/09/12 08:48:09 florian
  1193. * bugs 593 and 607 fixed
  1194. * some other potential bugs with array constructors fixed
  1195. * for classes compiled in $M+ and it's childs, the default access method
  1196. is now published
  1197. * fixed copyright message (it is now 1998-2000)
  1198. Revision 1.150 1999/09/10 20:57:33 florian
  1199. * some more fixes for stored properties
  1200. Revision 1.149 1999/09/10 18:48:07 florian
  1201. * some bug fixes (e.g. must_be_valid and procinfo^.funcret_is_valid)
  1202. * most things for stored properties fixed
  1203. Revision 1.148 1999/09/08 21:06:06 michael
  1204. * Stored specifier for properties is now correctly parsed
  1205. Revision 1.147 1999/09/02 09:23:51 peter
  1206. * fixed double dispose of propsymlist
  1207. }