2
0

pdecl.pas 25 KB

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