nset.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. {
  2. Copyright (c) 2000-2002 by Florian Klaempfl
  3. Type checking and register allocation for set/case nodes
  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 nset;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. cclasses,constexp,
  22. node,globtype,globals,
  23. aasmbase,aasmtai,aasmdata,symtype;
  24. type
  25. pcaselabel = ^tcaselabel;
  26. tcaselabel = record
  27. { range }
  28. _low,
  29. _high : TConstExprInt;
  30. { unique blockid }
  31. blockid : longint;
  32. { left and right tree node }
  33. less,
  34. greater : pcaselabel;
  35. end;
  36. pcaseblock = ^tcaseblock;
  37. tcaseblock = record
  38. { label (only used in pass_generate_code) }
  39. blocklabel : tasmlabel;
  40. { instructions }
  41. statement : tnode;
  42. end;
  43. tsetelementnode = class(tbinarynode)
  44. constructor create(l,r : tnode);virtual;
  45. function pass_typecheck:tnode;override;
  46. function pass_1 : tnode;override;
  47. end;
  48. tsetelementnodeclass = class of tsetelementnode;
  49. tinnode = class(tbinopnode)
  50. constructor create(l,r : tnode);virtual;reintroduce;
  51. function pass_typecheck:tnode;override;
  52. function pass_1 : tnode;override;
  53. end;
  54. tinnodeclass = class of tinnode;
  55. trangenode = class(tbinarynode)
  56. constructor create(l,r : tnode);virtual;
  57. function pass_typecheck:tnode;override;
  58. function pass_1 : tnode;override;
  59. end;
  60. trangenodeclass = class of trangenode;
  61. tcasenode = class(tunarynode)
  62. labels : pcaselabel;
  63. blocks : TFPList;
  64. elseblock : tnode;
  65. constructor create(l:tnode);virtual;
  66. destructor destroy;override;
  67. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  68. procedure ppuwrite(ppufile:tcompilerppufile);override;
  69. procedure buildderefimpl;override;
  70. procedure derefimpl;override;
  71. function dogetcopy : tnode;override;
  72. procedure insertintolist(l : tnodelist);override;
  73. function pass_typecheck:tnode;override;
  74. function pass_1 : tnode;override;
  75. function docompare(p: tnode): boolean; override;
  76. procedure addlabel(blockid:longint;l,h : TConstExprInt);
  77. procedure addblock(blockid:longint;instr:tnode);
  78. procedure addelseblock(instr:tnode);
  79. end;
  80. tcasenodeclass = class of tcasenode;
  81. var
  82. csetelementnode : tsetelementnodeclass;
  83. cinnode : tinnodeclass;
  84. crangenode : trangenodeclass;
  85. ccasenode : tcasenodeclass;
  86. { counts the labels }
  87. function case_count_labels(root : pcaselabel) : longint;
  88. { searches the highest label }
  89. function case_get_max(root : pcaselabel) : tconstexprint;
  90. { searches the lowest label }
  91. function case_get_min(root : pcaselabel) : tconstexprint;
  92. implementation
  93. uses
  94. systems,
  95. verbose,
  96. symconst,symdef,symsym,symtable,defutil,defcmp,
  97. htypechk,pass_1,
  98. nbas,ncnv,ncon,nld,cgobj,cgbase;
  99. {*****************************************************************************
  100. TSETELEMENTNODE
  101. *****************************************************************************}
  102. constructor tsetelementnode.create(l,r : tnode);
  103. begin
  104. inherited create(setelementn,l,r);
  105. end;
  106. function tsetelementnode.pass_typecheck:tnode;
  107. begin
  108. result:=nil;
  109. typecheckpass(left);
  110. if assigned(right) then
  111. typecheckpass(right);
  112. set_varstate(left,vs_read,[vsf_must_be_valid]);
  113. if codegenerror then
  114. exit;
  115. resultdef:=left.resultdef;
  116. end;
  117. function tsetelementnode.pass_1 : tnode;
  118. begin
  119. result:=nil;
  120. firstpass(left);
  121. if assigned(right) then
  122. firstpass(right);
  123. if codegenerror then
  124. exit;
  125. expectloc:=left.expectloc;
  126. end;
  127. {*****************************************************************************
  128. TINNODE
  129. *****************************************************************************}
  130. constructor tinnode.create(l,r : tnode);
  131. begin
  132. inherited create(inn,l,r);
  133. end;
  134. function tinnode.pass_typecheck:tnode;
  135. var
  136. t : tnode;
  137. pst : pconstset;
  138. function createsetconst(psd : tsetdef) : pconstset;
  139. var
  140. pcs : pconstset;
  141. pes : tenumsym;
  142. i : longint;
  143. begin
  144. new(pcs);
  145. case psd.elementdef.typ of
  146. enumdef :
  147. begin
  148. pes:=tenumsym(tenumdef(psd.elementdef).firstenum);
  149. while assigned(pes) do
  150. begin
  151. include(pcs^,pes.value);
  152. pes:=pes.nextenum;
  153. end;
  154. end;
  155. orddef :
  156. begin
  157. for i:=int64(torddef(psd.elementdef).low) to int64(torddef(psd.elementdef).high) do
  158. include(pcs^,i);
  159. end;
  160. end;
  161. createsetconst:=pcs;
  162. end;
  163. begin
  164. result:=nil;
  165. resultdef:=booltype;
  166. typecheckpass(right);
  167. set_varstate(right,vs_read,[vsf_must_be_valid]);
  168. if codegenerror then
  169. exit;
  170. { Convert array constructor first to set }
  171. if is_array_constructor(right.resultdef) then
  172. begin
  173. arrayconstructor_to_set(right);
  174. firstpass(right);
  175. if codegenerror then
  176. exit;
  177. end;
  178. if right.resultdef.typ<>setdef then
  179. CGMessage(sym_e_set_expected);
  180. if codegenerror then
  181. exit;
  182. if (right.nodetype=typen) then
  183. begin
  184. { we need to create a setconstn }
  185. pst:=createsetconst(tsetdef(ttypenode(right).resultdef));
  186. t:=csetconstnode.create(pst,ttypenode(right).resultdef);
  187. dispose(pst);
  188. right.free;
  189. right:=t;
  190. end;
  191. typecheckpass(left);
  192. set_varstate(left,vs_read,[vsf_must_be_valid]);
  193. if codegenerror then
  194. exit;
  195. if not assigned(left.resultdef) then
  196. internalerror(20021126);
  197. if (m_tp7 in current_settings.modeswitches) then
  198. begin
  199. { insert a hint that a range check error might occur on non-byte
  200. elements with the in operator.
  201. }
  202. if (
  203. (left.resultdef.typ = orddef) and not
  204. (torddef(left.resultdef).ordtype in [s8bit,u8bit,uchar,bool8bit])
  205. )
  206. or
  207. (
  208. (left.resultdef.typ = enumdef) and
  209. (tenumdef(left.resultdef).maxval > 255)
  210. )
  211. then
  212. CGMessage(type_h_in_range_check);
  213. { type conversion/check }
  214. if assigned(tsetdef(right.resultdef).elementdef) then
  215. inserttypeconv(left,tsetdef(right.resultdef).elementdef);
  216. end
  217. else if not is_ordinal(left.resultdef) or (left.resultdef.size > u32inttype.size) then
  218. begin
  219. CGMessage(type_h_in_range_check);
  220. if is_signed(left.resultdef) then
  221. inserttypeconv(left,s32inttype)
  222. else
  223. inserttypeconv(left,u32inttype);
  224. end
  225. else if assigned(tsetdef(right.resultdef).elementdef) and
  226. not(is_integer(tsetdef(right.resultdef).elementdef) and
  227. is_integer(left.resultdef)) then
  228. { Type conversion to check things like 'char in set_of_byte'. }
  229. { Can't use is_subequal because that will fail for }
  230. { 'widechar in set_of_char' }
  231. { Can't use the type conversion for integers because then }
  232. { "longint in set_of_byte" will give a range check error }
  233. { instead of false }
  234. inserttypeconv(left,tsetdef(right.resultdef).elementdef);
  235. { empty set then return false }
  236. if not assigned(tsetdef(right.resultdef).elementdef) or
  237. ((right.nodetype = setconstn) and
  238. (tnormalset(tsetconstnode(right).value_set^) = [])) then
  239. begin
  240. t:=cordconstnode.create(0,booltype,false);
  241. typecheckpass(t);
  242. result:=t;
  243. exit;
  244. end;
  245. { constant evaluation }
  246. if (left.nodetype=ordconstn) then
  247. begin
  248. if (right.nodetype=setconstn) then
  249. begin
  250. { tordconstnode.value is int64 -> signed -> the expression }
  251. { below will be converted to longint on 32 bit systems due }
  252. { to the rule above -> will give range check error if }
  253. { value > high(longint) if we don't take the signedness }
  254. { into account }
  255. if Tordconstnode(left).value.signed then
  256. t:=cordconstnode.create(byte(tordconstnode(left).value.svalue in Tsetconstnode(right).value_set^),
  257. booltype,true)
  258. else
  259. t:=cordconstnode.create(byte(tordconstnode(left).value.uvalue in Tsetconstnode(right).value_set^),
  260. booltype,true);
  261. typecheckpass(t);
  262. result:=t;
  263. exit;
  264. end
  265. else
  266. begin
  267. if (Tordconstnode(left).value<int64(tsetdef(right.resultdef).setbase)) or
  268. (Tordconstnode(left).value>int64(Tsetdef(right.resultdef).setmax)) then
  269. begin
  270. t:=cordconstnode.create(0, booltype, true);
  271. typecheckpass(t);
  272. result:=t;
  273. exit;
  274. end;
  275. end;
  276. end;
  277. end;
  278. function tinnode.pass_1 : tnode;
  279. begin
  280. result:=nil;
  281. expectloc:=LOC_REGISTER;
  282. firstpass(right);
  283. firstpass(left);
  284. if codegenerror then
  285. exit;
  286. end;
  287. {*****************************************************************************
  288. TRANGENODE
  289. *****************************************************************************}
  290. constructor trangenode.create(l,r : tnode);
  291. begin
  292. inherited create(rangen,l,r);
  293. end;
  294. function trangenode.pass_typecheck : tnode;
  295. begin
  296. result:=nil;
  297. typecheckpass(left);
  298. typecheckpass(right);
  299. set_varstate(left,vs_read,[vsf_must_be_valid]);
  300. set_varstate(right,vs_read,[vsf_must_be_valid]);
  301. if codegenerror then
  302. exit;
  303. { both types must be compatible }
  304. if compare_defs(left.resultdef,right.resultdef,left.nodetype)=te_incompatible then
  305. IncompatibleTypes(left.resultdef,right.resultdef);
  306. { Check if only when its a constant set }
  307. if (left.nodetype=ordconstn) and (right.nodetype=ordconstn) then
  308. begin
  309. { upper limit must be greater or equal than lower limit }
  310. if (tordconstnode(left).value>tordconstnode(right).value) and
  311. ((tordconstnode(left).value<0) or (tordconstnode(right).value>=0)) then
  312. CGMessage(parser_e_upper_lower_than_lower);
  313. end;
  314. resultdef:=left.resultdef;
  315. end;
  316. function trangenode.pass_1 : tnode;
  317. begin
  318. result:=nil;
  319. firstpass(left);
  320. firstpass(right);
  321. if codegenerror then
  322. exit;
  323. expectloc:=left.expectloc;
  324. end;
  325. {*****************************************************************************
  326. Case Helpers
  327. *****************************************************************************}
  328. function case_count_labels(root : pcaselabel) : longint;
  329. var
  330. _l : longint;
  331. procedure count(p : pcaselabel);
  332. begin
  333. inc(_l);
  334. if assigned(p^.less) then
  335. count(p^.less);
  336. if assigned(p^.greater) then
  337. count(p^.greater);
  338. end;
  339. begin
  340. _l:=0;
  341. count(root);
  342. case_count_labels:=_l;
  343. end;
  344. function case_get_max(root : pcaselabel) : tconstexprint;
  345. var
  346. hp : pcaselabel;
  347. begin
  348. hp:=root;
  349. while assigned(hp^.greater) do
  350. hp:=hp^.greater;
  351. case_get_max:=hp^._high;
  352. end;
  353. function case_get_min(root : pcaselabel) : tconstexprint;
  354. var
  355. hp : pcaselabel;
  356. begin
  357. hp:=root;
  358. while assigned(hp^.less) do
  359. hp:=hp^.less;
  360. case_get_min:=hp^._low;
  361. end;
  362. procedure deletecaselabels(p : pcaselabel);
  363. begin
  364. if assigned(p^.greater) then
  365. deletecaselabels(p^.greater);
  366. if assigned(p^.less) then
  367. deletecaselabels(p^.less);
  368. dispose(p);
  369. end;
  370. function copycaselabel(p : pcaselabel) : pcaselabel;
  371. var
  372. n : pcaselabel;
  373. begin
  374. new(n);
  375. n^:=p^;
  376. if assigned(p^.greater) then
  377. n^.greater:=copycaselabel(p^.greater);
  378. if assigned(p^.less) then
  379. n^.less:=copycaselabel(p^.less);
  380. copycaselabel:=n;
  381. end;
  382. procedure ppuwritecaselabel(ppufile:tcompilerppufile;p : pcaselabel);
  383. var
  384. b : byte;
  385. begin
  386. ppufile.putexprint(p^._low);
  387. ppufile.putexprint(p^._high);
  388. ppufile.putlongint(p^.blockid);
  389. b:=0;
  390. if assigned(p^.greater) then
  391. b:=b or 1;
  392. if assigned(p^.less) then
  393. b:=b or 2;
  394. ppufile.putbyte(b);
  395. if assigned(p^.greater) then
  396. ppuwritecaselabel(ppufile,p^.greater);
  397. if assigned(p^.less) then
  398. ppuwritecaselabel(ppufile,p^.less);
  399. end;
  400. function ppuloadcaselabel(ppufile:tcompilerppufile):pcaselabel;
  401. var
  402. b : byte;
  403. p : pcaselabel;
  404. begin
  405. new(p);
  406. p^._low:=ppufile.getexprint;
  407. p^._high:=ppufile.getexprint;
  408. p^.blockid:=ppufile.getlongint;
  409. b:=ppufile.getbyte;
  410. if (b and 1)=1 then
  411. p^.greater:=ppuloadcaselabel(ppufile)
  412. else
  413. p^.greater:=nil;
  414. if (b and 2)=2 then
  415. p^.less:=ppuloadcaselabel(ppufile)
  416. else
  417. p^.less:=nil;
  418. ppuloadcaselabel:=p;
  419. end;
  420. {*****************************************************************************
  421. TCASENODE
  422. *****************************************************************************}
  423. constructor tcasenode.create(l:tnode);
  424. begin
  425. inherited create(casen,l);
  426. labels:=nil;
  427. blocks:=TFPList.create;
  428. elseblock:=nil;
  429. end;
  430. destructor tcasenode.destroy;
  431. var
  432. i : longint;
  433. hp : pcaseblock;
  434. begin
  435. elseblock.free;
  436. deletecaselabels(labels);
  437. for i:=0 to blocks.count-1 do
  438. begin
  439. pcaseblock(blocks[i])^.statement.free;
  440. hp:=pcaseblock(blocks[i]);
  441. dispose(hp);
  442. end;
  443. blocks.free;
  444. inherited destroy;
  445. end;
  446. constructor tcasenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  447. var
  448. cnt,i : longint;
  449. begin
  450. inherited ppuload(t,ppufile);
  451. elseblock:=ppuloadnode(ppufile);
  452. cnt:=ppufile.getlongint();
  453. blocks:=TFPList.create;
  454. for i:=0 to cnt-1 do
  455. addblock(i,ppuloadnode(ppufile));
  456. labels:=ppuloadcaselabel(ppufile);
  457. end;
  458. procedure tcasenode.ppuwrite(ppufile:tcompilerppufile);
  459. var
  460. i : longint;
  461. begin
  462. inherited ppuwrite(ppufile);
  463. ppuwritenode(ppufile,elseblock);
  464. ppufile.putlongint(blocks.count);
  465. for i:=0 to blocks.count-1 do
  466. ppuwritenode(ppufile,pcaseblock(blocks[i])^.statement);
  467. ppuwritecaselabel(ppufile,labels);
  468. end;
  469. procedure tcasenode.buildderefimpl;
  470. var
  471. i : integer;
  472. begin
  473. inherited buildderefimpl;
  474. if assigned(elseblock) then
  475. elseblock.buildderefimpl;
  476. for i:=0 to blocks.count-1 do
  477. pcaseblock(blocks[i])^.statement.buildderefimpl;
  478. end;
  479. procedure tcasenode.derefimpl;
  480. var
  481. i : integer;
  482. begin
  483. inherited derefimpl;
  484. if assigned(elseblock) then
  485. elseblock.derefimpl;
  486. for i:=0 to blocks.count-1 do
  487. pcaseblock(blocks[i])^.statement.derefimpl;
  488. end;
  489. function tcasenode.pass_typecheck : tnode;
  490. begin
  491. result:=nil;
  492. resultdef:=voidtype;
  493. end;
  494. function tcasenode.pass_1 : tnode;
  495. var
  496. old_t_times : longint;
  497. i : integer;
  498. begin
  499. result:=nil;
  500. expectloc:=LOC_VOID;
  501. { evalutes the case expression }
  502. firstpass(left);
  503. set_varstate(left,vs_read,[vsf_must_be_valid]);
  504. if codegenerror then
  505. exit;
  506. { walk through all instructions }
  507. { estimates the repeat of each instruction }
  508. old_t_times:=cg.t_times;
  509. if not(cs_opt_size in current_settings.optimizerswitches) then
  510. begin
  511. cg.t_times:=cg.t_times div case_count_labels(labels);
  512. if cg.t_times<1 then
  513. cg.t_times:=1;
  514. end;
  515. { first case }
  516. for i:=0 to blocks.count-1 do
  517. firstpass(pcaseblock(blocks[i])^.statement);
  518. { may be handle else tree }
  519. if assigned(elseblock) then
  520. firstpass(elseblock);
  521. cg.t_times:=old_t_times;
  522. end;
  523. function tcasenode.dogetcopy : tnode;
  524. var
  525. n : tcasenode;
  526. i : longint;
  527. begin
  528. n:=tcasenode(inherited dogetcopy);
  529. if assigned(elseblock) then
  530. n.elseblock:=elseblock.dogetcopy
  531. else
  532. n.elseblock:=nil;
  533. if assigned(labels) then
  534. n.labels:=copycaselabel(labels)
  535. else
  536. n.labels:=nil;
  537. if assigned(blocks) then
  538. begin
  539. n.blocks:=TFPList.create;
  540. for i:=0 to blocks.count-1 do
  541. begin
  542. if not assigned(blocks[i]) then
  543. internalerror(200411302);
  544. n.addblock(i,pcaseblock(blocks[i])^.statement.dogetcopy);
  545. end;
  546. end
  547. else
  548. n.labels:=nil;
  549. dogetcopy:=n;
  550. end;
  551. procedure tcasenode.insertintolist(l : tnodelist);
  552. begin
  553. end;
  554. function caselabelsequal(n1,n2: pcaselabel): boolean;
  555. begin
  556. result :=
  557. (not assigned(n1) and not assigned(n2)) or
  558. (assigned(n1) and assigned(n2) and
  559. (n1^._low = n2^._low) and
  560. (n1^._high = n2^._high) and
  561. { the rest of the fields don't matter for equality (JM) }
  562. caselabelsequal(n1^.less,n2^.less) and
  563. caselabelsequal(n1^.greater,n2^.greater))
  564. end;
  565. function caseblocksequal(b1,b2:TFPList): boolean;
  566. var
  567. i : longint;
  568. begin
  569. result:=false;
  570. if b1.count<>b2.count then
  571. exit;
  572. for i:=0 to b1.count-1 do
  573. begin
  574. if not pcaseblock(b1[i])^.statement.isequal(pcaseblock(b2[i])^.statement) then
  575. exit;
  576. end;
  577. result:=true;
  578. end;
  579. function tcasenode.docompare(p: tnode): boolean;
  580. begin
  581. result :=
  582. inherited docompare(p) and
  583. caselabelsequal(labels,tcasenode(p).labels) and
  584. caseblocksequal(blocks,tcasenode(p).blocks) and
  585. elseblock.isequal(tcasenode(p).elseblock);
  586. end;
  587. procedure tcasenode.addblock(blockid:longint;instr:tnode);
  588. var
  589. hcaseblock : pcaseblock;
  590. begin
  591. new(hcaseblock);
  592. fillchar(hcaseblock^,sizeof(hcaseblock^),0);
  593. hcaseblock^.statement:=instr;
  594. if blockid>=blocks.count then
  595. blocks.count:=blockid+1;
  596. blocks[blockid]:=hcaseblock;
  597. end;
  598. procedure tcasenode.addelseblock(instr:tnode);
  599. begin
  600. elseblock:=instr;
  601. end;
  602. procedure tcasenode.addlabel(blockid:longint;l,h : TConstExprInt);
  603. var
  604. hcaselabel : pcaselabel;
  605. function insertlabel(var p : pcaselabel):pcaselabel;
  606. begin
  607. if p=nil then
  608. begin
  609. p:=hcaselabel;
  610. result:=p;
  611. end
  612. else
  613. if (p^._low>hcaselabel^._low) and
  614. (p^._low>hcaselabel^._high) then
  615. begin
  616. if (hcaselabel^.blockid = p^.blockid) and
  617. (p^._low = hcaselabel^._high + 1) then
  618. begin
  619. p^._low := hcaselabel^._low;
  620. dispose(hcaselabel);
  621. result:=p;
  622. end
  623. else
  624. result:=insertlabel(p^.less)
  625. end
  626. else
  627. if (p^._high<hcaselabel^._low) and
  628. (p^._high<hcaselabel^._high) then
  629. begin
  630. if (hcaselabel^.blockid = p^.blockid) and
  631. (p^._high+1 = hcaselabel^._low) then
  632. begin
  633. p^._high := hcaselabel^._high;
  634. dispose(hcaselabel);
  635. result:=p;
  636. end
  637. else
  638. result:=insertlabel(p^.greater);
  639. end
  640. else
  641. Message(parser_e_double_caselabel);
  642. end;
  643. begin
  644. new(hcaselabel);
  645. fillchar(hcaselabel^,sizeof(tcaselabel),0);
  646. hcaselabel^.blockid:=blockid;
  647. hcaselabel^._low:=l;
  648. hcaselabel^._high:=h;
  649. insertlabel(labels);
  650. end;
  651. begin
  652. csetelementnode:=tsetelementnode;
  653. cinnode:=tinnode;
  654. crangenode:=trangenode;
  655. ccasenode:=tcasenode;
  656. end.