pdecl.pas 48 KB

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