pinline.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Generates nodes for routines that need compiler support
  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 pinline;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symtype,
  22. node,
  23. globals;
  24. function new_dispose_statement(is_new:boolean) : tnode;
  25. function new_function : tnode;
  26. function inline_setlength : tnode;
  27. function inline_setstring : tnode;
  28. function inline_initialize : tnode;
  29. function inline_finalize : tnode;
  30. function inline_copy : tnode;
  31. function inline_insert : tnode;
  32. function inline_delete : tnode;
  33. implementation
  34. uses
  35. { global }
  36. globtype,tokens,verbose,constexp,
  37. systems,compinnr,
  38. { symtable }
  39. symbase,symconst,symdef,symsym,symtable,defutil,
  40. { pass 1 }
  41. pass_1,htypechk,
  42. ncal,nmem,ncnv,ninl,ncon,nld,nbas,ngenutil,
  43. { parser }
  44. scanner,
  45. pbase,pexpr;
  46. function new_dispose_statement(is_new:boolean) : tnode;
  47. var
  48. newstatement : tstatementnode;
  49. temp : ttempcreatenode;
  50. para : tcallparanode;
  51. p,p2 : tnode;
  52. again : boolean; { dummy for do_proc_call }
  53. destructorname : TIDString;
  54. sym : tsym;
  55. classh : tobjectdef;
  56. callflag : tcallnodeflag;
  57. destructorpos,
  58. storepos : tfileposinfo;
  59. variantdesc : pvariantrecdesc;
  60. found : boolean;
  61. j,i : longint;
  62. variantselectsymbol : tfieldvarsym;
  63. begin
  64. if target_info.system in systems_managed_vm then
  65. message(parser_e_feature_unsupported_for_vm);
  66. consume(_LKLAMMER);
  67. p:=comp_expr([ef_accept_equal]);
  68. { calc return type }
  69. if is_new then
  70. begin
  71. set_varstate(p,vs_written,[]);
  72. valid_for_var(p,true);
  73. end
  74. else
  75. set_varstate(p,vs_readwritten,[vsf_must_be_valid]);
  76. if (m_mac in current_settings.modeswitches) and
  77. is_class(p.resultdef) then
  78. begin
  79. classh:=tobjectdef(p.resultdef);
  80. { make sure we call ObjPas.TObject.Create/Free and not a random }
  81. { create/free method in a macpas descendent object (since those }
  82. { are not supposed to be called automatically when you call }
  83. { new/dispose) }
  84. while assigned(classh.childof) do
  85. classh := classh.childof;
  86. if is_new then
  87. begin
  88. sym:=search_struct_member(classh,'CREATE');
  89. p2 := cloadvmtaddrnode.create(ctypenode.create(p.resultdef));
  90. end
  91. else
  92. begin
  93. sym:=search_struct_member(classh,'FREE');
  94. p2 := p;
  95. end;
  96. if not(assigned(sym)) then
  97. begin
  98. p.free;
  99. if is_new then
  100. p2.free;
  101. new_dispose_statement := cerrornode.create;
  102. consume_all_until(_RKLAMMER);
  103. consume(_RKLAMMER);
  104. exit;
  105. end;
  106. do_member_read(classh,false,sym,p2,again,[],nil);
  107. { we need the real called method }
  108. do_typecheckpass(p2);
  109. if (p2.nodetype=calln) and
  110. assigned(tcallnode(p2).procdefinition) then
  111. begin
  112. if is_new then
  113. begin
  114. if (tcallnode(p2).procdefinition.proctypeoption<>potype_constructor) then
  115. Message(parser_e_expr_have_to_be_constructor_call);
  116. p2.resultdef:=p.resultdef;
  117. p2:=cassignmentnode.create(p,p2);
  118. typecheckpass(p2);
  119. end
  120. else
  121. begin
  122. { Free is not a destructor
  123. if (tcallnode(p2).procdefinition.proctypeoption<>potype_destructor) then
  124. Message(parser_e_expr_have_to_be_destructor_call);
  125. }
  126. end
  127. end
  128. else
  129. internalerror(2005061202);
  130. new_dispose_statement := p2;
  131. end
  132. { constructor,destructor specified }
  133. else if (([m_mac,m_iso,m_extpas]*current_settings.modeswitches)=[]) and
  134. try_to_consume(_COMMA) then
  135. begin
  136. { extended syntax of new and dispose }
  137. { function styled new is handled in factor }
  138. { destructors have no parameters }
  139. destructorname:=pattern;
  140. destructorpos:=current_tokenpos;
  141. consume(_ID);
  142. if is_typeparam(p.resultdef) then
  143. begin
  144. p.free;
  145. p:=factor(false,[]);
  146. p.free;
  147. consume(_RKLAMMER);
  148. new_dispose_statement:=cnothingnode.create;
  149. exit;
  150. end;
  151. if (p.resultdef.typ<>pointerdef) then
  152. begin
  153. Message1(type_e_pointer_type_expected,p.resultdef.typename);
  154. p.free;
  155. p:=factor(false,[]);
  156. p.free;
  157. consume(_RKLAMMER);
  158. new_dispose_statement:=cerrornode.create;
  159. exit;
  160. end;
  161. { first parameter must be an object or class }
  162. if tpointerdef(p.resultdef).pointeddef.typ<>objectdef then
  163. begin
  164. Message(parser_e_pointer_to_class_expected);
  165. p.free;
  166. new_dispose_statement:=factor(false,[]);
  167. consume_all_until(_RKLAMMER);
  168. consume(_RKLAMMER);
  169. exit;
  170. end;
  171. { check, if the first parameter is a pointer to a _class_ }
  172. classh:=tobjectdef(tpointerdef(p.resultdef).pointeddef);
  173. if is_class(classh) then
  174. begin
  175. Message(parser_e_no_new_or_dispose_for_classes);
  176. new_dispose_statement:=factor(false,[]);
  177. consume_all_until(_RKLAMMER);
  178. consume(_RKLAMMER);
  179. exit;
  180. end;
  181. { search cons-/destructor, also in parent classes }
  182. storepos:=current_tokenpos;
  183. current_tokenpos:=destructorpos;
  184. sym:=search_struct_member(classh,destructorname);
  185. current_tokenpos:=storepos;
  186. { the second parameter of new/dispose must be a call }
  187. { to a cons-/destructor }
  188. if (not assigned(sym)) or (sym.typ<>procsym) then
  189. begin
  190. if is_new then
  191. Message(parser_e_expr_have_to_be_constructor_call)
  192. else
  193. Message(parser_e_expr_have_to_be_destructor_call);
  194. p.free;
  195. new_dispose_statement:=cerrornode.create;
  196. end
  197. else
  198. begin
  199. { For new(var,constructor) we need to take a copy because
  200. p is also used in the assignmentn below }
  201. if is_new then
  202. begin
  203. p2:=cderefnode.create(p.getcopy);
  204. include(p2.flags,nf_no_checkpointer);
  205. end
  206. else
  207. p2:=cderefnode.create(p);
  208. do_typecheckpass(p2);
  209. if is_new then
  210. callflag:=cnf_new_call
  211. else
  212. callflag:=cnf_dispose_call;
  213. if is_new then
  214. do_member_read(classh,false,sym,p2,again,[callflag],nil)
  215. else
  216. begin
  217. if not(m_fpc in current_settings.modeswitches) then
  218. do_member_read(classh,false,sym,p2,again,[callflag],nil)
  219. else
  220. begin
  221. p2:=ccallnode.create(nil,tprocsym(sym),sym.owner,p2,[callflag],nil);
  222. { support dispose(p,done()); }
  223. if try_to_consume(_LKLAMMER) then
  224. begin
  225. if not try_to_consume(_RKLAMMER) then
  226. begin
  227. Message(parser_e_no_paras_for_destructor);
  228. consume_all_until(_RKLAMMER);
  229. consume(_RKLAMMER);
  230. end;
  231. end;
  232. end;
  233. end;
  234. { we need the real called method }
  235. do_typecheckpass(p2);
  236. if (p2.nodetype=calln) and
  237. assigned(tcallnode(p2).procdefinition) then
  238. begin
  239. if is_new then
  240. begin
  241. if (tcallnode(p2).procdefinition.proctypeoption<>potype_constructor) then
  242. Message(parser_e_expr_have_to_be_constructor_call);
  243. p2.resultdef:=p.resultdef;
  244. p2:=cassignmentnode.create(p,p2);
  245. end
  246. else
  247. begin
  248. if (tcallnode(p2).procdefinition.proctypeoption<>potype_destructor) then
  249. Message(parser_e_expr_have_to_be_destructor_call);
  250. end;
  251. end
  252. else
  253. begin
  254. if is_new then
  255. CGMessage(parser_e_expr_have_to_be_constructor_call)
  256. else
  257. CGMessage(parser_e_expr_have_to_be_destructor_call);
  258. end;
  259. result:=p2;
  260. end;
  261. end
  262. else
  263. begin
  264. if (p.resultdef.typ<>pointerdef) then
  265. Begin
  266. if is_typeparam(p.resultdef) then
  267. begin
  268. p.free;
  269. consume(_RKLAMMER);
  270. new_dispose_statement:=cnothingnode.create;
  271. exit;
  272. end
  273. else
  274. begin
  275. Message1(type_e_pointer_type_expected,p.resultdef.typename);
  276. new_dispose_statement:=cerrornode.create;
  277. end;
  278. end
  279. else
  280. begin
  281. if (tpointerdef(p.resultdef).pointeddef.typ=objectdef) and
  282. (oo_has_vmt in tobjectdef(tpointerdef(p.resultdef).pointeddef).objectoptions) then
  283. Message(parser_w_use_extended_syntax_for_objects);
  284. if (tpointerdef(p.resultdef).pointeddef.typ=orddef) and
  285. (torddef(tpointerdef(p.resultdef).pointeddef).ordtype=uvoid) then
  286. begin
  287. if (m_tp7 in current_settings.modeswitches) or
  288. (m_delphi in current_settings.modeswitches) then
  289. Message(parser_w_no_new_dispose_on_void_pointers)
  290. else
  291. Message(parser_e_no_new_dispose_on_void_pointers);
  292. end;
  293. { create statements with call to getmem+initialize or
  294. finalize+freemem }
  295. new_dispose_statement:=internalstatements(newstatement);
  296. if is_new then
  297. begin
  298. { create temp for result }
  299. temp := ctempcreatenode.create(p.resultdef,p.resultdef.size,tt_persistent,true);
  300. addstatement(newstatement,temp);
  301. { create call to fpc_getmem }
  302. para := ccallparanode.create(cordconstnode.create
  303. (tpointerdef(p.resultdef).pointeddef.size,s32inttype,true),nil);
  304. addstatement(newstatement,cassignmentnode.create(
  305. ctemprefnode.create(temp),
  306. ccallnode.createintern('fpc_getmem',para)));
  307. { create call to fpc_initialize }
  308. if is_managed_type(tpointerdef(p.resultdef).pointeddef) or
  309. ((m_isolike_io in current_settings.modeswitches) and (tpointerdef(p.resultdef).pointeddef.typ=filedef)) then
  310. addstatement(newstatement,cnodeutils.initialize_data_node(cderefnode.create(ctemprefnode.create(temp)),false));
  311. { copy the temp to the destination }
  312. addstatement(newstatement,cassignmentnode.create(
  313. p,
  314. ctemprefnode.create(temp)));
  315. if (([m_iso,m_extpas]*current_settings.modeswitches)<>[]) and (is_record(tpointerdef(p.resultdef).pointeddef)) then
  316. begin
  317. variantdesc:=trecorddef(tpointerdef(p.resultdef).pointeddef).variantrecdesc;
  318. while (token=_COMMA) and assigned(variantdesc) do
  319. begin
  320. consume(_COMMA);
  321. p2:=factor(false,[]);
  322. do_typecheckpass(p2);
  323. if p2.nodetype=ordconstn then
  324. begin
  325. found:=false;
  326. { we do not have dynamic dfa, so avoid warning on variantselectsymbol below }
  327. variantselectsymbol:=nil;
  328. for i:=0 to high(variantdesc^.branches) do
  329. begin
  330. for j:=0 to high(variantdesc^.branches[i].values) do
  331. if variantdesc^.branches[i].values[j]=tordconstnode(p2).value then
  332. begin
  333. found:=true;
  334. variantselectsymbol:=tfieldvarsym(variantdesc^.variantselector);
  335. variantdesc:=variantdesc^.branches[i].nestedvariant;
  336. break;
  337. end;
  338. if found then
  339. break;
  340. end;
  341. if found then
  342. begin
  343. { if no tag-field is given, do not create an assignment statement for it }
  344. if assigned(variantselectsymbol) then
  345. { setup variant selector }
  346. addstatement(newstatement,cassignmentnode.create(
  347. csubscriptnode.create(variantselectsymbol,
  348. cderefnode.create(ctemprefnode.create(temp))),
  349. p2));
  350. end
  351. else
  352. Message(parser_e_illegal_expression);
  353. end
  354. else
  355. Message(parser_e_illegal_expression);
  356. end;
  357. end;
  358. { release temp }
  359. addstatement(newstatement,ctempdeletenode.create(temp));
  360. end
  361. else
  362. begin
  363. { create call to fpc_finalize }
  364. if is_managed_type(tpointerdef(p.resultdef).pointeddef) then
  365. addstatement(newstatement,cnodeutils.finalize_data_node(cderefnode.create(p.getcopy)));
  366. { create call to fpc_freemem }
  367. para := ccallparanode.create(p,nil);
  368. addstatement(newstatement,ccallnode.createintern('fpc_freemem',para));
  369. end;
  370. end;
  371. end;
  372. consume(_RKLAMMER);
  373. end;
  374. function new_function : tnode;
  375. var
  376. p1,p2 : tnode;
  377. classh : tobjectdef;
  378. srsym : tsym;
  379. srsymtable : TSymtable;
  380. again : boolean; { dummy for do_proc_call }
  381. begin
  382. if target_info.system in systems_managed_vm then
  383. message(parser_e_feature_unsupported_for_vm);
  384. consume(_LKLAMMER);
  385. p1:=factor(false,[]);
  386. if p1.nodetype<>typen then
  387. begin
  388. Message(type_e_type_id_expected);
  389. consume_all_until(_RKLAMMER);
  390. consume(_RKLAMMER);
  391. p1.destroy;
  392. new_function:=cerrornode.create;
  393. exit;
  394. end;
  395. if (p1.resultdef.typ<>pointerdef) then
  396. begin
  397. Message1(type_e_pointer_type_expected,p1.resultdef.typename);
  398. consume_all_until(_RKLAMMER);
  399. consume(_RKLAMMER);
  400. p1.destroy;
  401. new_function:=cerrornode.create;
  402. exit;
  403. end;
  404. if try_to_consume(_RKLAMMER) then
  405. begin
  406. if (tpointerdef(p1.resultdef).pointeddef.typ=objectdef) and
  407. (oo_has_vmt in tobjectdef(tpointerdef(p1.resultdef).pointeddef).objectoptions) then
  408. Message(parser_w_use_extended_syntax_for_objects);
  409. if p1.nodetype=typen then
  410. ttypenode(p1).allowed:=true;
  411. p1:=cinlinenode.create(in_new_x,false,p1);
  412. end
  413. else
  414. begin
  415. consume(_COMMA);
  416. if tpointerdef(p1.resultdef).pointeddef.typ<>objectdef then
  417. begin
  418. Message(parser_e_pointer_to_class_expected);
  419. consume_all_until(_RKLAMMER);
  420. consume(_RKLAMMER);
  421. p1.destroy;
  422. new_function:=cerrornode.create;
  423. exit;
  424. end;
  425. classh:=tobjectdef(tpointerdef(p1.resultdef).pointeddef);
  426. { use the objectdef for loading the VMT }
  427. p2:=p1;
  428. p1:=ctypenode.create(tpointerdef(p1.resultdef).pointeddef);
  429. do_typecheckpass(p1);
  430. { search the constructor also in the symbol tables of
  431. the parents }
  432. afterassignment:=false;
  433. searchsym_in_class(classh,classh,pattern,srsym,srsymtable,[ssf_search_helper]);
  434. consume(_ID);
  435. do_member_read(classh,false,srsym,p1,again,[cnf_new_call],nil);
  436. { we need to know which procedure is called }
  437. do_typecheckpass(p1);
  438. if not(
  439. (p1.nodetype=calln) and
  440. assigned(tcallnode(p1).procdefinition) and
  441. (tcallnode(p1).procdefinition.proctypeoption=potype_constructor)
  442. ) then
  443. Message(parser_e_expr_have_to_be_constructor_call);
  444. { constructors return boolean, update resultdef to return
  445. the pointer to the object }
  446. p1.resultdef:=p2.resultdef;
  447. p2.free;
  448. consume(_RKLAMMER);
  449. end;
  450. new_function:=p1;
  451. end;
  452. function inline_setlength : tnode;
  453. var
  454. paras: tnode;
  455. begin
  456. consume(_LKLAMMER);
  457. paras:=parse_paras(false,false,_RKLAMMER);
  458. consume(_RKLAMMER);
  459. if not assigned(paras) then
  460. begin
  461. result:=cerrornode.create;
  462. CGMessage1(parser_e_wrong_parameter_size,'SetLength');
  463. exit;
  464. end;
  465. result:=cinlinenode.create(in_setlength_x,false,paras);
  466. end;
  467. function inline_setstring : tnode;
  468. var
  469. paras, strpara, pcharpara: tnode;
  470. procname: string;
  471. cp: tstringencoding;
  472. begin
  473. consume(_LKLAMMER);
  474. paras:=parse_paras(false,false,_RKLAMMER);
  475. consume(_RKLAMMER);
  476. procname:='';
  477. if assigned(paras) and
  478. assigned(tcallparanode(paras).right) and
  479. assigned(tcallparanode(tcallparanode(paras).right).right) then
  480. begin
  481. do_typecheckpass(tcallparanode(tcallparanode(paras).right).left);
  482. do_typecheckpass(tcallparanode(tcallparanode(tcallparanode(paras).right).right).left);
  483. pcharpara:=tcallparanode(tcallparanode(paras).right).left;
  484. strpara:=tcallparanode(tcallparanode(tcallparanode(paras).right).right).left;
  485. if strpara.resultdef.typ=stringdef then
  486. begin
  487. { if there are three parameters and the first parameter
  488. ( = paras.right.right) is an ansistring, add a codepage
  489. parameter }
  490. if is_ansistring(strpara.resultdef) then
  491. begin
  492. cp:=tstringdef(strpara.resultdef).encoding;
  493. if (cp=globals.CP_NONE) then
  494. cp:=0;
  495. paras:=ccallparanode.create(genintconstnode(cp),paras);
  496. end;
  497. procname:='fpc_setstring_'+tstringdef(strpara.resultdef).stringtypname;
  498. { decide which version to call based on the second parameter }
  499. if not is_shortstring(strpara.resultdef) then
  500. if is_pwidechar(pcharpara.resultdef) or
  501. is_widechar(pcharpara.resultdef) or
  502. ((pcharpara.resultdef.typ=arraydef) and
  503. is_widechar(tarraydef(pcharpara.resultdef).elementdef)) then
  504. procname:=procname+'_pwidechar'
  505. else
  506. procname:=procname+'_pansichar';
  507. end;
  508. end;
  509. { default version (for error message) in case of missing or wrong
  510. parameters }
  511. if procname='' then
  512. if m_default_unicodestring in current_settings.modeswitches then
  513. procname:='fpc_setstring_unicodestr_pwidechar'
  514. else if m_default_ansistring in current_settings.modeswitches then
  515. procname:='fpc_setstring_ansistr_pansichar'
  516. else
  517. procname:='fpc_setstring_shortstr';
  518. result:=ccallnode.createintern(procname,paras)
  519. end;
  520. function inline_initfinal(isinit: boolean): tnode;
  521. var
  522. newblock,
  523. paras : tnode;
  524. npara,
  525. destppn,
  526. ppn : tcallparanode;
  527. begin
  528. { for easy exiting if something goes wrong }
  529. result := cerrornode.create;
  530. consume(_LKLAMMER);
  531. paras:=parse_paras(false,false,_RKLAMMER);
  532. consume(_RKLAMMER);
  533. ppn:=tcallparanode(paras);
  534. if not assigned(paras) or
  535. (assigned(ppn.right) and
  536. assigned(tcallparanode(ppn.right).right)) then
  537. begin
  538. if isinit then
  539. CGMessage1(parser_e_wrong_parameter_size,'Initialize')
  540. else
  541. CGMessage1(parser_e_wrong_parameter_size,'Finalize');
  542. exit;
  543. end;
  544. { 2 arguments? }
  545. if assigned(ppn.right) then
  546. begin
  547. destppn:=tcallparanode(ppn.right);
  548. { create call to fpc_initialize/finalize_array }
  549. npara:=ccallparanode.create(ctypeconvnode.create
  550. (ppn.left,s32inttype),
  551. ccallparanode.create(caddrnode.create_internal
  552. (crttinode.create(tstoreddef(destppn.left.resultdef),initrtti,rdt_normal)),
  553. ccallparanode.create(caddrnode.create_internal
  554. (destppn.left),nil)));
  555. if isinit then
  556. newblock:=ccallnode.createintern('fpc_initialize_array',npara)
  557. else
  558. newblock:=ccallnode.createintern('fpc_finalize_array',npara);
  559. destppn.left:=nil;
  560. end
  561. else
  562. begin
  563. if isinit then
  564. newblock:=cnodeutils.initialize_data_node(ppn.left,true)
  565. else
  566. newblock:=cnodeutils.finalize_data_node(ppn.left);
  567. end;
  568. ppn.left:=nil;
  569. paras.free;
  570. result.free;
  571. result:=newblock;
  572. end;
  573. function inline_initialize : tnode;
  574. begin
  575. result:=inline_initfinal(true);
  576. end;
  577. function inline_finalize : tnode;
  578. begin
  579. result:=inline_initfinal(false);
  580. end;
  581. function inline_copy_insert_delete(nr:tinlinenumber;name:string) : tnode;
  582. var
  583. paras : tnode;
  584. { for easy exiting if something goes wrong }
  585. begin
  586. result := cerrornode.create;
  587. consume(_LKLAMMER);
  588. paras:=parse_paras(false,false,_RKLAMMER);
  589. consume(_RKLAMMER);
  590. if not assigned(paras) then
  591. begin
  592. CGMessage1(parser_e_wrong_parameter_size,name);
  593. exit;
  594. end;
  595. result.free;
  596. result:=cinlinenode.create(nr,false,paras);
  597. end;
  598. function inline_copy: tnode;
  599. begin
  600. result:=inline_copy_insert_delete(in_copy_x,'Copy');
  601. end;
  602. function inline_insert: tnode;
  603. begin
  604. result:=inline_copy_insert_delete(in_insert_x_y_z,'Insert');
  605. end;
  606. function inline_delete: tnode;
  607. begin
  608. result:=inline_copy_insert_delete(in_delete_x_y_z,'Delete');
  609. end;
  610. end.