pdecl.pas 25 KB

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