pdecl.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Does declaration (but not type) parsing for Free Pascal
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit pdecl;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. { global }
  22. globals,
  23. { symtable }
  24. symsym,
  25. { pass_1 }
  26. node;
  27. function readconstant(const orgname:string;const filepos:tfileposinfo):tconstsym;
  28. procedure const_dec;
  29. procedure label_dec;
  30. procedure type_dec;
  31. procedure var_dec;
  32. procedure threadvar_dec;
  33. procedure property_dec;
  34. procedure resourcestring_dec;
  35. procedure formal_dec;
  36. implementation
  37. uses
  38. { common }
  39. cutils,cclasses,
  40. { global }
  41. globtype,tokens,verbose,widestr,
  42. systems,
  43. { aasm }
  44. aasmbase,aasmtai,fmodule,
  45. { symtable }
  46. symconst,symbase,symtype,symdef,symtable,paramgr,defutil,
  47. { pass 1 }
  48. nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,nobj,
  49. { codegen }
  50. ncgutil,
  51. { parser }
  52. scanner,
  53. pbase,pexpr,ptype,ptconst,pdecsub,pdecvar,pdecobj,pdecformal,
  54. { cpu-information }
  55. cpuinfo,
  56. pass_1
  57. ;
  58. function readconstant(const orgname:string;const filepos:tfileposinfo):tconstsym;
  59. var
  60. hp : tconstsym;
  61. p : tnode;
  62. ps : pconstset;
  63. pd : pbestreal;
  64. pg : pguid;
  65. sp : pchar;
  66. pw : pcompilerwidestring;
  67. storetokenpos : tfileposinfo;
  68. begin
  69. readconstant:=nil;
  70. if orgname='' then
  71. internalerror(9584582);
  72. hp:=nil;
  73. p:=comp_expr(true);
  74. storetokenpos:=akttokenpos;
  75. akttokenpos:=filepos;
  76. case p.nodetype of
  77. ordconstn:
  78. begin
  79. if p.resulttype.def.deftype=pointerdef then
  80. hp:=tconstsym.create_ordptr(orgname,constpointer,tordconstnode(p).value,p.resulttype)
  81. else
  82. hp:=tconstsym.create_ord(orgname,constord,tordconstnode(p).value,p.resulttype);
  83. end;
  84. stringconstn:
  85. begin
  86. if is_widestring(p.resulttype.def) then
  87. begin
  88. initwidestring(pw);
  89. copywidestring(pcompilerwidestring(tstringconstnode(p).value_str),pw);
  90. hp:=tconstsym.create_wstring(orgname,constwstring,pw);
  91. end
  92. else
  93. begin
  94. getmem(sp,tstringconstnode(p).len+1);
  95. move(tstringconstnode(p).value_str^,sp^,tstringconstnode(p).len+1);
  96. hp:=tconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len);
  97. end;
  98. end;
  99. realconstn :
  100. begin
  101. new(pd);
  102. pd^:=trealconstnode(p).value_real;
  103. hp:=tconstsym.create_ptr(orgname,constreal,pd,p.resulttype);
  104. end;
  105. setconstn :
  106. begin
  107. new(ps);
  108. ps^:=tsetconstnode(p).value_set^;
  109. hp:=tconstsym.create_ptr(orgname,constset,ps,p.resulttype);
  110. end;
  111. pointerconstn :
  112. begin
  113. hp:=tconstsym.create_ordptr(orgname,constpointer,tpointerconstnode(p).value,p.resulttype);
  114. end;
  115. niln :
  116. begin
  117. hp:=tconstsym.create_ord(orgname,constnil,0,p.resulttype);
  118. end;
  119. typen :
  120. begin
  121. if is_interface(p.resulttype.def) then
  122. begin
  123. if assigned(tobjectdef(p.resulttype.def).iidguid) then
  124. begin
  125. new(pg);
  126. pg^:=tobjectdef(p.resulttype.def).iidguid^;
  127. hp:=tconstsym.create_ptr(orgname,constguid,pg,p.resulttype);
  128. end
  129. else
  130. Message1(parser_e_interface_has_no_guid,tobjectdef(p.resulttype.def).objrealname^);
  131. end
  132. else
  133. Message(parser_e_illegal_expression);
  134. end;
  135. else
  136. Message(parser_e_illegal_expression);
  137. end;
  138. akttokenpos:=storetokenpos;
  139. p.free;
  140. readconstant:=hp;
  141. end;
  142. procedure const_dec;
  143. var
  144. orgname : stringid;
  145. tt : ttype;
  146. sym : tsym;
  147. dummysymoptions : tsymoptions;
  148. storetokenpos,filepos : tfileposinfo;
  149. old_block_type : tblock_type;
  150. skipequal : boolean;
  151. begin
  152. consume(_CONST);
  153. old_block_type:=block_type;
  154. block_type:=bt_const;
  155. repeat
  156. orgname:=orgpattern;
  157. filepos:=akttokenpos;
  158. consume(_ID);
  159. case token of
  160. _EQUAL:
  161. begin
  162. consume(_EQUAL);
  163. sym:=readconstant(orgname,filepos);
  164. { Support hint directives }
  165. dummysymoptions:=[];
  166. try_consume_hintdirective(dummysymoptions);
  167. if assigned(sym) then
  168. begin
  169. sym.symoptions:=sym.symoptions+dummysymoptions;
  170. symtablestack.insert(sym);
  171. end;
  172. consume(_SEMICOLON);
  173. end;
  174. _COLON:
  175. begin
  176. { set the blocktype first so a consume also supports a
  177. caret, to support const s : ^string = nil }
  178. block_type:=bt_type;
  179. consume(_COLON);
  180. ignore_equal:=true;
  181. read_type(tt,'',false);
  182. ignore_equal:=false;
  183. block_type:=bt_const;
  184. skipequal:=false;
  185. { create symbol }
  186. storetokenpos:=akttokenpos;
  187. akttokenpos:=filepos;
  188. sym:=ttypedconstsym.createtype(orgname,tt,(cs_typed_const_writable in aktlocalswitches));
  189. akttokenpos:=storetokenpos;
  190. symtablestack.insert(sym);
  191. { procvar can have proc directives, but not type references }
  192. if (tt.def.deftype=procvardef) and
  193. (tt.sym=nil) then
  194. begin
  195. { support p : procedure;stdcall=nil; }
  196. if try_to_consume(_SEMICOLON) then
  197. begin
  198. if check_proc_directive(true) then
  199. parse_var_proc_directives(sym)
  200. else
  201. begin
  202. Message(parser_e_proc_directive_expected);
  203. skipequal:=true;
  204. end;
  205. end
  206. else
  207. { support p : procedure stdcall=nil; }
  208. begin
  209. if check_proc_directive(true) then
  210. parse_var_proc_directives(sym);
  211. end;
  212. { add default calling convention }
  213. handle_calling_convention(tabstractprocdef(tt.def));
  214. end;
  215. if not skipequal then
  216. begin
  217. { get init value }
  218. consume(_EQUAL);
  219. readtypedconst(tt,ttypedconstsym(sym),(cs_typed_const_writable in aktlocalswitches));
  220. try_consume_hintdirective(sym.symoptions);
  221. consume(_SEMICOLON);
  222. end;
  223. end;
  224. else
  225. { generate an error }
  226. consume(_EQUAL);
  227. end;
  228. until token<>_ID;
  229. block_type:=old_block_type;
  230. end;
  231. procedure label_dec;
  232. var
  233. hl : tasmlabel;
  234. begin
  235. consume(_LABEL);
  236. if not(cs_support_goto in aktmoduleswitches) then
  237. Message(sym_e_goto_and_label_not_supported);
  238. repeat
  239. if not(token in [_ID,_INTCONST]) then
  240. consume(_ID)
  241. else
  242. begin
  243. if token=_ID then
  244. symtablestack.insert(tlabelsym.create(orgpattern))
  245. else
  246. symtablestack.insert(tlabelsym.create(pattern));
  247. consume(token);
  248. end;
  249. if token<>_SEMICOLON then consume(_COMMA);
  250. until not(token in [_ID,_INTCONST]);
  251. consume(_SEMICOLON);
  252. end;
  253. { search in symtablestack used, but not defined type }
  254. procedure resolve_type_forward(p : tnamedindexitem;arg:pointer);
  255. var
  256. hpd,pd : tdef;
  257. stpos : tfileposinfo;
  258. again : boolean;
  259. srsym : tsym;
  260. srsymtable : tsymtable;
  261. {$ifdef gdb_notused}
  262. stab_str:Pchar;
  263. {$endif gdb_notused}
  264. begin
  265. { Check only typesyms or record/object fields }
  266. case tsym(p).typ of
  267. typesym :
  268. pd:=ttypesym(p).restype.def;
  269. fieldvarsym :
  270. pd:=tfieldvarsym(p).vartype.def
  271. else
  272. exit;
  273. end;
  274. repeat
  275. again:=false;
  276. case pd.deftype of
  277. arraydef :
  278. begin
  279. { elementtype could also be defined using a forwarddef }
  280. pd:=tarraydef(pd).elementtype.def;
  281. again:=true;
  282. end;
  283. pointerdef,
  284. classrefdef :
  285. begin
  286. { classrefdef inherits from pointerdef }
  287. hpd:=tpointerdef(pd).pointertype.def;
  288. { still a forward def ? }
  289. if hpd.deftype=forwarddef then
  290. begin
  291. { try to resolve the forward }
  292. { get the correct position for it }
  293. stpos:=akttokenpos;
  294. akttokenpos:=tforwarddef(hpd).forwardpos;
  295. resolving_forward:=true;
  296. make_ref:=false;
  297. if not assigned(tforwarddef(hpd).tosymname) then
  298. internalerror(20021120);
  299. searchsym(tforwarddef(hpd).tosymname^,srsym,srsymtable);
  300. make_ref:=true;
  301. resolving_forward:=false;
  302. akttokenpos:=stpos;
  303. { we don't need the forwarddef anymore, dispose it }
  304. hpd.free;
  305. tpointerdef(pd).pointertype.def:=nil; { if error occurs }
  306. { was a type sym found ? }
  307. if assigned(srsym) and
  308. (srsym.typ=typesym) then
  309. begin
  310. tpointerdef(pd).pointertype.setsym(srsym);
  311. { avoid wrong unused warnings web bug 801 PM }
  312. inc(ttypesym(srsym).refs);
  313. {$ifdef GDB_UNUSED}
  314. if (cs_debuginfo in aktmoduleswitches) and assigned(debuglist) and
  315. (tsym(p).owner.symtabletype in [globalsymtable,staticsymtable]) then
  316. begin
  317. ttypesym(p).isusedinstab:=true;
  318. { ttypesym(p).concatstabto(debuglist);}
  319. {not stabs for forward defs }
  320. if not Ttypesym(p).isstabwritten then
  321. begin
  322. if Ttypesym(p).restype.def.typesym=p then
  323. Tstoreddef(Ttypesym(p).restype.def).concatstabto(debuglist)
  324. else
  325. begin
  326. stab_str:=Ttypesym(p).stabstring;
  327. if assigned(stab_str) then
  328. debuglist.concat(Tai_stabs.create(stab_str));
  329. Ttypesym(p).isstabwritten:=true;
  330. end;
  331. end;
  332. end;
  333. {$endif GDB_UNUSED}
  334. { we need a class type for classrefdef }
  335. if (pd.deftype=classrefdef) and
  336. not(is_class(ttypesym(srsym).restype.def)) then
  337. Message1(type_e_class_type_expected,ttypesym(srsym).restype.def.typename);
  338. end
  339. else
  340. begin
  341. MessagePos1(tsym(p).fileinfo,sym_e_forward_type_not_resolved,tsym(p).realname);
  342. { try to recover }
  343. tpointerdef(pd).pointertype:=generrortype;
  344. end;
  345. end;
  346. end;
  347. recorddef :
  348. trecorddef(pd).symtable.foreach_static(@resolve_type_forward,nil);
  349. objectdef :
  350. begin
  351. if not(m_fpc in aktmodeswitches) and
  352. (oo_is_forward in tobjectdef(pd).objectoptions) then
  353. begin
  354. { only give an error as the implementation may follow in an
  355. other type block which is allowed by FPC modes }
  356. MessagePos1(tsym(p).fileinfo,sym_e_forward_type_not_resolved,tsym(p).realname);
  357. end
  358. else
  359. begin
  360. { Check all fields of the object declaration, but don't
  361. check objectdefs in objects/records, because these
  362. can't exist (anonymous objects aren't allowed) }
  363. if not(tsym(p).owner.symtabletype in [objectsymtable,recordsymtable]) then
  364. tobjectdef(pd).symtable.foreach_static(@resolve_type_forward,nil);
  365. end;
  366. end;
  367. end;
  368. until not again;
  369. end;
  370. { reads a type declaration to the symbol table }
  371. procedure type_dec;
  372. var
  373. typename,orgtypename : stringid;
  374. newtype : ttypesym;
  375. sym : tsym;
  376. srsymtable : tsymtable;
  377. tt : ttype;
  378. oldfilepos,
  379. defpos,storetokenpos : tfileposinfo;
  380. old_block_type : tblock_type;
  381. ch : tclassheader;
  382. unique,istyperenaming : boolean;
  383. begin
  384. old_block_type:=block_type;
  385. block_type:=bt_type;
  386. consume(_TYPE);
  387. typecanbeforward:=true;
  388. repeat
  389. typename:=pattern;
  390. orgtypename:=orgpattern;
  391. defpos:=akttokenpos;
  392. istyperenaming:=false;
  393. consume(_ID);
  394. consume(_EQUAL);
  395. { support 'ttype=type word' syntax }
  396. unique:=try_to_consume(_TYPE);
  397. { MacPas object model is more like Delphi's than like TP's, but }
  398. { uses the object keyword instead of class }
  399. if (m_mac in aktmodeswitches) and
  400. (token = _OBJECT) then
  401. token := _CLASS;
  402. { is the type already defined? }
  403. searchsym(typename,sym,srsymtable);
  404. newtype:=nil;
  405. { found a symbol with this name? }
  406. if assigned(sym) then
  407. begin
  408. if (sym.typ=typesym) then
  409. begin
  410. if ((token=_CLASS) or
  411. (token=_INTERFACE)) and
  412. (assigned(ttypesym(sym).restype.def)) and
  413. is_class_or_interface(ttypesym(sym).restype.def) and
  414. (oo_is_forward in tobjectdef(ttypesym(sym).restype.def).objectoptions) then
  415. begin
  416. { we can ignore the result }
  417. { the definition is modified }
  418. object_dec(orgtypename,tobjectdef(ttypesym(sym).restype.def));
  419. newtype:=ttypesym(sym);
  420. tt:=newtype.restype;
  421. end
  422. else
  423. message1(parser_h_type_redef,orgtypename);
  424. end;
  425. end;
  426. { no old type reused ? Then insert this new type }
  427. if not assigned(newtype) then
  428. begin
  429. { insert the new type first with an errordef, so that
  430. referencing the type before it's really set it
  431. will give an error (PFV) }
  432. tt:=generrortype;
  433. storetokenpos:=akttokenpos;
  434. newtype:=ttypesym.create(orgtypename,tt);
  435. symtablestack.insert(newtype);
  436. akttokenpos:=defpos;
  437. akttokenpos:=storetokenpos;
  438. { read the type definition }
  439. read_type(tt,orgtypename,false);
  440. { update the definition of the type }
  441. newtype.restype:=tt;
  442. if assigned(tt.sym) then
  443. istyperenaming:=true
  444. else
  445. tt.sym:=newtype;
  446. if unique and assigned(tt.def) then
  447. begin
  448. tt.setdef(tstoreddef(tt.def).getcopy);
  449. include(tt.def.defoptions,df_unique);
  450. newtype.restype:=tt;
  451. end;
  452. if assigned(tt.def) and not assigned(tt.def.typesym) then
  453. tt.def.typesym:=newtype;
  454. { KAZ: handle TGUID declaration in system unit }
  455. if (cs_compilesystem in aktmoduleswitches) and not assigned(rec_tguid) and
  456. (typename='TGUID') and { name: TGUID and size=16 bytes that is 128 bits }
  457. assigned(tt.def) and (tt.def.deftype=recorddef) and (tt.def.size=16) then
  458. rec_tguid:=trecorddef(tt.def);
  459. end;
  460. if assigned(tt.def) then
  461. begin
  462. case tt.def.deftype of
  463. pointerdef :
  464. begin
  465. consume(_SEMICOLON);
  466. if try_to_consume(_FAR) then
  467. begin
  468. tpointerdef(tt.def).is_far:=true;
  469. consume(_SEMICOLON);
  470. end;
  471. end;
  472. procvardef :
  473. begin
  474. { in case of type renaming, don't parse proc directives }
  475. if istyperenaming then
  476. consume(_SEMICOLON)
  477. else
  478. begin
  479. if not check_proc_directive(true) then
  480. consume(_SEMICOLON);
  481. parse_var_proc_directives(tsym(newtype));
  482. handle_calling_convention(tprocvardef(tt.def));
  483. end;
  484. end;
  485. objectdef,
  486. recorddef :
  487. begin
  488. try_consume_hintdirective(newtype.symoptions);
  489. consume(_SEMICOLON);
  490. end;
  491. else
  492. consume(_SEMICOLON);
  493. end;
  494. end;
  495. { Write tables if we are the typesym that defines
  496. this type. This will not be done for simple type renamings }
  497. if (tt.def.typesym=newtype) then
  498. begin
  499. { file position }
  500. oldfilepos:=aktfilepos;
  501. aktfilepos:=newtype.fileinfo;
  502. { generate persistent init/final tables when it's declared in the interface so it can
  503. be reused in other used }
  504. if current_module.in_interface and
  505. ((is_class(tt.def) and
  506. tobjectdef(tt.def).members_need_inittable) or
  507. tt.def.needs_inittable) then
  508. generate_inittable(newtype);
  509. { for objects we should write the vmt and interfaces.
  510. This need to be done after the rtti has been written, because
  511. it can contain a reference to that data (PFV)
  512. This is not for forward classes }
  513. if (tt.def.deftype=objectdef) and
  514. (tt.def.owner.symtabletype in [staticsymtable,globalsymtable]) then
  515. with Tobjectdef(tt.def) do
  516. begin
  517. if not(oo_is_forward in objectoptions) then
  518. begin
  519. ch:=tclassheader.create(tobjectdef(tt.def));
  520. { generate and check virtual methods, must be done
  521. before RTTI is written }
  522. ch.genvmt;
  523. { Generate RTTI for class }
  524. generate_rtti(newtype);
  525. if is_interface(tobjectdef(tt.def)) then
  526. ch.writeinterfaceids;
  527. if (oo_has_vmt in objectoptions) then
  528. ch.writevmt;
  529. ch.free;
  530. end;
  531. end
  532. else
  533. begin
  534. { Always generate RTTI info for all types. This is to have typeinfo() return
  535. the same pointer }
  536. generate_rtti(newtype);
  537. end;
  538. aktfilepos:=oldfilepos;
  539. end;
  540. until token<>_ID;
  541. typecanbeforward:=false;
  542. symtablestack.foreach_static(@resolve_type_forward,nil);
  543. block_type:=old_block_type;
  544. end;
  545. procedure var_dec;
  546. { parses variable declarations and inserts them in }
  547. { the top symbol table of symtablestack }
  548. begin
  549. consume(_VAR);
  550. read_var_decs(false,false,false);
  551. end;
  552. procedure formal_dec;
  553. begin
  554. consume(_OPEN_FORMAL);
  555. read_formal_decs;
  556. end;
  557. procedure property_dec;
  558. var
  559. old_block_type : tblock_type;
  560. begin
  561. consume(_PROPERTY);
  562. if not(symtablestack.symtabletype in [staticsymtable,globalsymtable]) then
  563. message(parser_e_resourcestring_only_sg);
  564. old_block_type:=block_type;
  565. block_type:=bt_const;
  566. repeat
  567. read_property_dec(nil);
  568. consume(_SEMICOLON);
  569. until token<>_ID;
  570. block_type:=old_block_type;
  571. end;
  572. procedure threadvar_dec;
  573. { parses thread variable declarations and inserts them in }
  574. { the top symbol table of symtablestack }
  575. begin
  576. consume(_THREADVAR);
  577. if not(symtablestack.symtabletype in [staticsymtable,globalsymtable]) then
  578. message(parser_e_threadvars_only_sg);
  579. read_var_decs(false,false,true);
  580. end;
  581. procedure resourcestring_dec;
  582. var
  583. orgname : stringid;
  584. p : tnode;
  585. dummysymoptions : tsymoptions;
  586. storetokenpos,filepos : tfileposinfo;
  587. old_block_type : tblock_type;
  588. sp : pchar;
  589. sym : tsym;
  590. begin
  591. consume(_RESOURCESTRING);
  592. if not(symtablestack.symtabletype in [staticsymtable,globalsymtable]) then
  593. message(parser_e_resourcestring_only_sg);
  594. old_block_type:=block_type;
  595. block_type:=bt_const;
  596. repeat
  597. orgname:=orgpattern;
  598. filepos:=akttokenpos;
  599. consume(_ID);
  600. case token of
  601. _EQUAL:
  602. begin
  603. consume(_EQUAL);
  604. p:=comp_expr(true);
  605. storetokenpos:=akttokenpos;
  606. akttokenpos:=filepos;
  607. sym:=nil;
  608. case p.nodetype of
  609. ordconstn:
  610. begin
  611. if is_constcharnode(p) then
  612. begin
  613. getmem(sp,2);
  614. sp[0]:=chr(tordconstnode(p).value);
  615. sp[1]:=#0;
  616. sym:=tconstsym.create_string(orgname,constresourcestring,sp,1);
  617. end
  618. else
  619. Message(parser_e_illegal_expression);
  620. end;
  621. stringconstn:
  622. with Tstringconstnode(p) do
  623. begin
  624. getmem(sp,len+1);
  625. move(value_str^,sp^,len+1);
  626. sym:=tconstsym.create_string(orgname,constresourcestring,sp,len);
  627. end;
  628. else
  629. Message(parser_e_illegal_expression);
  630. end;
  631. akttokenpos:=storetokenpos;
  632. { Support hint directives }
  633. dummysymoptions:=[];
  634. try_consume_hintdirective(dummysymoptions);
  635. if assigned(sym) then
  636. begin
  637. sym.symoptions:=sym.symoptions+dummysymoptions;
  638. symtablestack.insert(sym);
  639. end;
  640. consume(_SEMICOLON);
  641. p.free;
  642. end;
  643. else consume(_EQUAL);
  644. end;
  645. until token<>_ID;
  646. block_type:=old_block_type;
  647. end;
  648. end.