node.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. {
  2. $Id$
  3. Copyright (c) 2000 by Florian Klaempfl
  4. Basic node handling
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit node;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. cobjects,cclasses,
  23. globtype,globals,
  24. cpubase,
  25. aasm,
  26. symtype;
  27. type
  28. pconstset = ^tconstset;
  29. tconstset = array[0..31] of byte;
  30. tnodetype = (
  31. addn, {Represents the + operator.}
  32. muln, {Represents the * operator.}
  33. subn, {Represents the - operator.}
  34. divn, {Represents the div operator.}
  35. symdifn, {Represents the >< operator.}
  36. modn, {Represents the mod operator.}
  37. assignn, {Represents an assignment.}
  38. loadn, {Represents the use of a variabele.}
  39. rangen, {Represents a range (i.e. 0..9).}
  40. ltn, {Represents the < operator.}
  41. lten, {Represents the <= operator.}
  42. gtn, {Represents the > operator.}
  43. gten, {Represents the >= operator.}
  44. equaln, {Represents the = operator.}
  45. unequaln, {Represents the <> operator.}
  46. inn, {Represents the in operator.}
  47. orn, {Represents the or operator.}
  48. xorn, {Represents the xor operator.}
  49. shrn, {Represents the shr operator.}
  50. shln, {Represents the shl operator.}
  51. slashn, {Represents the / operator.}
  52. andn, {Represents the and operator.}
  53. subscriptn, {??? Field in a record/object?}
  54. derefn, {Dereferences a pointer.}
  55. addrn, {Represents the @ operator.}
  56. doubleaddrn, {Represents the @@ operator.}
  57. ordconstn, {Represents an ordinal value.}
  58. typeconvn, {Represents type-conversion/typecast.}
  59. calln, {Represents a call node.}
  60. callparan, {Represents a parameter.}
  61. realconstn, {Represents a real value.}
  62. unaryminusn, {Represents a sign change (i.e. -2).}
  63. asmn, {Represents an assembler node }
  64. vecn, {Represents array indexing.}
  65. pointerconstn,
  66. stringconstn, {Represents a string constant.}
  67. funcretn, {Represents the function result var.}
  68. selfn, {Represents the self parameter.}
  69. notn, {Represents the not operator.}
  70. inlinen, {Internal procedures (i.e. writeln).}
  71. niln, {Represents the nil pointer.}
  72. errorn, {This part of the tree could not be
  73. parsed because of a compiler error.}
  74. typen, {A type name. Used for i.e. typeof(obj).}
  75. hnewn, {The new operation, constructor call.}
  76. hdisposen, {The dispose operation with destructor call.}
  77. newn, {The new operation, constructor call.}
  78. simpledisposen, {The dispose operation.}
  79. setelementn, {A set element(s) (i.e. [a,b] and also [a..b]).}
  80. setconstn, {A set constant (i.e. [1,2]).}
  81. blockn, {A block of statements.}
  82. statementn, {One statement in a block of nodes.}
  83. loopn, { used in genloopnode, must be converted }
  84. ifn, {An if statement.}
  85. breakn, {A break statement.}
  86. continuen, {A continue statement.}
  87. repeatn, {A repeat until block.}
  88. whilen, {A while do statement.}
  89. forn, {A for loop.}
  90. exitn, {An exit statement.}
  91. withn, {A with statement.}
  92. casen, {A case statement.}
  93. labeln, {A label.}
  94. goton, {A goto statement.}
  95. simplenewn, {The new operation.}
  96. tryexceptn, {A try except block.}
  97. raisen, {A raise statement.}
  98. switchesn, {??? Currently unused...}
  99. tryfinallyn, {A try finally statement.}
  100. onn, { for an on statement in exception code }
  101. isn, {Represents the is operator.}
  102. asn, {Represents the as typecast.}
  103. caretn, {Represents the ^ operator.}
  104. failn, {Represents the fail statement.}
  105. starstarn, {Represents the ** operator exponentiation }
  106. procinlinen, {Procedures that can be inlined }
  107. arrayconstructorn, {Construction node for [...] parsing}
  108. arrayconstructorrangen, {Range element to allow sets in array construction tree}
  109. { added for optimizations where we cannot suppress }
  110. addoptn,
  111. nothingn,
  112. loadvmtn
  113. );
  114. const
  115. nodetype2str : array[tnodetype] of string[20] = (
  116. 'addn',
  117. 'muln',
  118. 'subn',
  119. 'divn',
  120. 'symdifn',
  121. 'modn',
  122. 'assignn',
  123. 'loadn',
  124. 'rangen',
  125. 'ltn',
  126. 'lten',
  127. 'gtn',
  128. 'gten',
  129. 'equaln',
  130. 'unequaln',
  131. 'inn',
  132. 'orn',
  133. 'xorn',
  134. 'shrn',
  135. 'shln',
  136. 'slashn',
  137. 'andn',
  138. 'subscriptn',
  139. 'derefn',
  140. 'addrn',
  141. 'doubleaddrn',
  142. 'ordconstn',
  143. 'typeconvn',
  144. 'calln',
  145. 'callparan',
  146. 'realconstn',
  147. 'umminusn',
  148. 'asmn',
  149. 'vecn',
  150. 'pointerconstn',
  151. 'stringconstn',
  152. 'funcretn',
  153. 'selfn',
  154. 'notn',
  155. 'inlinen',
  156. 'niln',
  157. 'errorn',
  158. 'typen',
  159. 'hnewn',
  160. 'hdisposen',
  161. 'newn',
  162. 'simpledisposen',
  163. 'setelementn',
  164. 'setconstn',
  165. 'blockn',
  166. 'statementn',
  167. 'loopn',
  168. 'ifn',
  169. 'breakn',
  170. 'continuen',
  171. 'repeatn',
  172. 'whilen',
  173. 'forn',
  174. 'exitn',
  175. 'withn',
  176. 'casen',
  177. 'labeln',
  178. 'goton',
  179. 'simplenewn',
  180. 'tryexceptn',
  181. 'raisen',
  182. 'switchesn',
  183. 'tryfinallyn',
  184. 'onn',
  185. 'isn',
  186. 'asn',
  187. 'caretn',
  188. 'failn',
  189. 'starstarn',
  190. 'procinlinen',
  191. 'arrayconstructn',
  192. 'arrayconstructrangen',
  193. 'addoptn',
  194. 'nothingn',
  195. 'loadvmtn');
  196. type
  197. { all boolean field of ttree are now collected in flags }
  198. tnodeflags = (
  199. nf_needs_truefalselabel,
  200. nf_swapable, { tbinop operands can be swaped }
  201. nf_swaped, { tbinop operands are swaped }
  202. nf_error,
  203. { flags used by tcallnode }
  204. nf_no_check,
  205. nf_unit_specific,
  206. nf_return_value_used,
  207. nf_static_call,
  208. { flags used by loop nodes }
  209. nf_backward, { set if it is a for ... downto ... do loop }
  210. nf_varstate, { do we need to parse childs to set var state }
  211. { taddrnode }
  212. nf_procvarload,
  213. { tvecnode }
  214. nf_memindex,
  215. nf_memseg,
  216. nf_callunique,
  217. { twithnode }
  218. nf_islocal,
  219. { tloadnode }
  220. nf_absolute,
  221. nf_first,
  222. { tassignmentnode }
  223. nf_concat_string,
  224. { tfuncretnode }
  225. nf_is_first_funcret, { 20th }
  226. { tarrayconstructnode }
  227. nf_cargs,
  228. nf_cargswap,
  229. nf_forcevaria,
  230. nf_novariaallowed,
  231. { ttypeconvnode }
  232. nf_explizit,
  233. { tinlinenode }
  234. nf_inlineconst,
  235. { general }
  236. nf_isproperty,
  237. nf_varstateset,
  238. { tasmnode }
  239. nf_object_preserved,
  240. { taddnode }
  241. nf_use_strconcat
  242. );
  243. tnodeflagset = set of tnodeflags;
  244. const
  245. { contains the flags which must be equal for the equality }
  246. { of nodes }
  247. flagsequal : tnodeflagset = [nf_error,nf_static_call,nf_backward];
  248. type
  249. tnodelist = class
  250. end;
  251. { later (for the newcg) tnode will inherit from tlinkedlist_item }
  252. tnode = class
  253. public
  254. nodetype : tnodetype;
  255. { the location of the result of this node }
  256. location : tlocation;
  257. { the parent node of this is node }
  258. { this field is set by concattolist }
  259. parent : tnode;
  260. { there are some properties about the node stored }
  261. flags : tnodeflagset;
  262. { the number of registers needed to evalute the node }
  263. registers32,registersfpu : longint; { must be longint !!!! }
  264. {$ifdef SUPPORT_MMX}
  265. registersmmx,registerskni : longint;
  266. {$endif SUPPORT_MMX}
  267. resulttype : ttype;
  268. fileinfo : tfileposinfo;
  269. localswitches : tlocalswitches;
  270. {$ifdef extdebug}
  271. oldresulttype : ttype; { to detect changed resulttype }
  272. maxfirstpasscount,
  273. firstpasscount : longint;
  274. {$endif extdebug}
  275. list : taasmoutput;
  276. constructor create(tt : tnodetype);
  277. { this constructor is only for creating copies of class }
  278. { the fields are copied by getcopy }
  279. constructor createforcopy;
  280. destructor destroy;override;
  281. { toggles the flag }
  282. procedure toggleflag(f : tnodeflags);
  283. { the 1.1 code generator may override pass_1 }
  284. { and it need not to implement det_* then }
  285. { 1.1: pass_1 returns a value<>0 if the node has been transformed }
  286. { 2.0: runs det_resulttype and det_temp }
  287. function pass_1 : tnode;virtual;abstract;
  288. { dermines the resulttype of the node }
  289. function det_resulttype : tnode;virtual;abstract;
  290. { dermines the number of necessary temp. locations to evaluate
  291. the node }
  292. procedure det_temp;virtual;abstract;
  293. procedure pass_2;virtual;abstract;
  294. { comparing of nodes }
  295. function isequal(p : tnode) : boolean;
  296. { to implement comparisation, override this method }
  297. function docompare(p : tnode) : boolean;virtual;
  298. { gets a copy of the node }
  299. function getcopy : tnode;virtual;
  300. procedure insertintolist(l : tnodelist);virtual;
  301. {$ifdef EXTDEBUG}
  302. { writes a node for debugging purpose, shouldn't be called }
  303. { direct, because there is no test for nil, use writenode }
  304. { to write a complete tree }
  305. procedure dowrite;virtual;
  306. procedure dowritenodetype;virtual;
  307. {$endif EXTDEBUG}
  308. procedure concattolist(l : tlinkedlist);virtual;
  309. function ischild(p : tnode) : boolean;virtual;
  310. procedure set_file_line(from : tnode);
  311. procedure set_tree_filepos(const filepos : tfileposinfo);
  312. end;
  313. { this node is the anchestor for all nodes with at least }
  314. { one child, you have to use it if you want to use }
  315. { true- and falselabel }
  316. tparentnode = class(tnode)
  317. {$ifdef newcg}
  318. falselabel,truelabel : pasmlabel;
  319. {$endif newcg}
  320. end;
  321. tnodeclass = class of tnode;
  322. punarynode = ^tunarynode;
  323. tunarynode = class(tparentnode)
  324. left : tnode;
  325. constructor create(tt : tnodetype;l : tnode);
  326. destructor destroy;override;
  327. procedure concattolist(l : tlinkedlist);override;
  328. function ischild(p : tnode) : boolean;override;
  329. function docompare(p : tnode) : boolean;override;
  330. function getcopy : tnode;override;
  331. procedure insertintolist(l : tnodelist);override;
  332. procedure left_max;
  333. {$ifdef extdebug}
  334. procedure dowrite;override;
  335. {$endif extdebug}
  336. end;
  337. pbinarynode = ^tbinarynode;
  338. tbinarynode = class(tunarynode)
  339. right : tnode;
  340. constructor create(tt : tnodetype;l,r : tnode);
  341. destructor destroy;override;
  342. procedure concattolist(l : tlinkedlist);override;
  343. function ischild(p : tnode) : boolean;override;
  344. function docompare(p : tnode) : boolean;override;
  345. procedure swapleftright;
  346. function getcopy : tnode;override;
  347. procedure insertintolist(l : tnodelist);override;
  348. procedure left_right_max;
  349. {$ifdef extdebug}
  350. procedure dowrite;override;
  351. {$endif extdebug}
  352. end;
  353. pbinopnode = ^tbinopnode;
  354. tbinopnode = class(tbinarynode)
  355. constructor create(tt : tnodetype;l,r : tnode);virtual;
  356. function docompare(p : tnode) : boolean;override;
  357. end;
  358. {$ifdef EXTDEBUG}
  359. var
  360. writenodeindention : string;
  361. procedure writenode(t:tnode);
  362. {$endif EXTDEBUG}
  363. implementation
  364. uses
  365. cutils;
  366. {****************************************************************************
  367. TNODE
  368. ****************************************************************************}
  369. constructor tnode.create(tt : tnodetype);
  370. begin
  371. inherited create;
  372. nodetype:=tt;
  373. { this allows easier error tracing }
  374. location.loc:=LOC_INVALID;
  375. { save local info }
  376. fileinfo:=aktfilepos;
  377. localswitches:=aktlocalswitches;
  378. resulttype.reset;
  379. registers32:=0;
  380. registersfpu:=0;
  381. {$ifdef SUPPORT_MMX}
  382. registersmmx:=0;
  383. {$endif SUPPORT_MMX}
  384. {$ifdef EXTDEBUG}
  385. oldresulttype.reset;
  386. maxfirstpasscount:=0;
  387. firstpasscount:=0;
  388. {$endif EXTDEBUG}
  389. flags:=[];
  390. end;
  391. constructor tnode.createforcopy;
  392. begin
  393. end;
  394. procedure tnode.toggleflag(f : tnodeflags);
  395. begin
  396. if f in flags then
  397. exclude(flags,f)
  398. else
  399. include(flags,f);
  400. end;
  401. destructor tnode.destroy;
  402. begin
  403. {$ifdef EXTDEBUG}
  404. if firstpasscount>maxfirstpasscount then
  405. maxfirstpasscount:=firstpasscount;
  406. {$endif EXTDEBUG}
  407. end;
  408. procedure tnode.concattolist(l : tlinkedlist);
  409. begin
  410. {$ifdef newcg}
  411. //!!!!!!! l^.concat(self);
  412. {$warning fixme}
  413. {$endif newcg}
  414. end;
  415. function tnode.ischild(p : tnode) : boolean;
  416. begin
  417. ischild:=false;
  418. end;
  419. {$ifdef EXTDEBUG}
  420. procedure tnode.dowrite;
  421. begin
  422. dowritenodetype;
  423. end;
  424. procedure tnode.dowritenodetype;
  425. begin
  426. write(writenodeindention,'(',nodetype2str[nodetype]);
  427. end;
  428. {$endif EXTDEBUG}
  429. function tnode.isequal(p : tnode) : boolean;
  430. begin
  431. isequal:=
  432. (not assigned(self) and not assigned(p)) or
  433. (assigned(self) and assigned(p) and
  434. { optimized subclasses have the same nodetype as their }
  435. { superclass (for compatibility), so also check the classtype (JM) }
  436. (p.classtype=classtype) and
  437. (p.nodetype=nodetype) and
  438. (flags*flagsequal=p.flags*flagsequal) and
  439. docompare(p));
  440. end;
  441. function tnode.docompare(p : tnode) : boolean;
  442. begin
  443. docompare:=true;
  444. end;
  445. function tnode.getcopy : tnode;
  446. var
  447. p : tnode;
  448. begin
  449. { this is quite tricky because we need a node of the current }
  450. { node type and not one of tnode! }
  451. p:=tnodeclass(classtype).createforcopy;
  452. p.nodetype:=nodetype;
  453. p.location:=location;
  454. p.parent:=parent;
  455. p.flags:=flags;
  456. p.registers32:=registers32;
  457. p.registersfpu:=registersfpu;
  458. {$ifdef SUPPORT_MMX}
  459. p.registersmmx:=registersmmx;
  460. p.registerskni:=registerskni;
  461. {$endif SUPPORT_MMX}
  462. p.resulttype:=resulttype;
  463. p.fileinfo:=fileinfo;
  464. p.localswitches:=localswitches;
  465. {$ifdef extdebug}
  466. p.firstpasscount:=firstpasscount;
  467. {$endif extdebug}
  468. p.list:=list;
  469. getcopy:=p;
  470. end;
  471. procedure tnode.insertintolist(l : tnodelist);
  472. begin
  473. end;
  474. procedure tnode.set_file_line(from : tnode);
  475. begin
  476. if assigned(from) then
  477. fileinfo:=from.fileinfo;
  478. end;
  479. procedure tnode.set_tree_filepos(const filepos : tfileposinfo);
  480. begin
  481. fileinfo:=filepos;
  482. end;
  483. {****************************************************************************
  484. TUNARYNODE
  485. ****************************************************************************}
  486. constructor tunarynode.create(tt : tnodetype;l : tnode);
  487. begin
  488. inherited create(tt);
  489. left:=l;
  490. end;
  491. destructor tunarynode.destroy;
  492. begin
  493. left.free;
  494. inherited destroy;
  495. end;
  496. function tunarynode.docompare(p : tnode) : boolean;
  497. begin
  498. docompare:=(inherited docompare(p) and
  499. ((left=nil) or left.isequal(tunarynode(p).left))
  500. );
  501. end;
  502. function tunarynode.getcopy : tnode;
  503. var
  504. p : tunarynode;
  505. begin
  506. p:=tunarynode(inherited getcopy);
  507. if assigned(left) then
  508. p.left:=left.getcopy
  509. else
  510. p.left:=nil;
  511. getcopy:=p;
  512. end;
  513. procedure tunarynode.insertintolist(l : tnodelist);
  514. begin
  515. end;
  516. {$ifdef extdebug}
  517. procedure tunarynode.dowrite;
  518. begin
  519. inherited dowrite;
  520. writeln(',');
  521. writenodeindention:=writenodeindention+' ';
  522. writenode(left);
  523. write(')');
  524. delete(writenodeindention,1,4);
  525. end;
  526. {$endif}
  527. procedure tunarynode.left_max;
  528. begin
  529. registers32:=left.registers32;
  530. registersfpu:=left.registersfpu;
  531. {$ifdef SUPPORT_MMX}
  532. registersmmx:=left.registersmmx;
  533. {$endif SUPPORT_MMX}
  534. end;
  535. procedure tunarynode.concattolist(l : tlinkedlist);
  536. begin
  537. left.parent:=self;
  538. left.concattolist(l);
  539. inherited concattolist(l);
  540. end;
  541. function tunarynode.ischild(p : tnode) : boolean;
  542. begin
  543. ischild:=p=left;
  544. end;
  545. {****************************************************************************
  546. TBINARYNODE
  547. ****************************************************************************}
  548. constructor tbinarynode.create(tt : tnodetype;l,r : tnode);
  549. begin
  550. inherited create(tt,l);
  551. right:=r
  552. end;
  553. destructor tbinarynode.destroy;
  554. begin
  555. right.free;
  556. inherited destroy;
  557. end;
  558. procedure tbinarynode.concattolist(l : tlinkedlist);
  559. begin
  560. { we could change that depending on the number of }
  561. { required registers }
  562. left.parent:=self;
  563. left.concattolist(l);
  564. left.parent:=self;
  565. left.concattolist(l);
  566. inherited concattolist(l);
  567. end;
  568. function tbinarynode.ischild(p : tnode) : boolean;
  569. begin
  570. ischild:=(p=right);
  571. end;
  572. function tbinarynode.docompare(p : tnode) : boolean;
  573. begin
  574. docompare:=(inherited docompare(p) and
  575. ((right=nil) or right.isequal(tbinarynode(p).right))
  576. );
  577. end;
  578. function tbinarynode.getcopy : tnode;
  579. var
  580. p : tbinarynode;
  581. begin
  582. p:=tbinarynode(inherited getcopy);
  583. if assigned(right) then
  584. p.right:=right.getcopy
  585. else
  586. p.right:=nil;
  587. getcopy:=p;
  588. end;
  589. procedure tbinarynode.insertintolist(l : tnodelist);
  590. begin
  591. end;
  592. procedure tbinarynode.swapleftright;
  593. var
  594. swapp : tnode;
  595. begin
  596. swapp:=right;
  597. right:=left;
  598. left:=swapp;
  599. if nf_swaped in flags then
  600. exclude(flags,nf_swaped)
  601. else
  602. include(flags,nf_swaped);
  603. end;
  604. procedure tbinarynode.left_right_max;
  605. begin
  606. if assigned(left) then
  607. begin
  608. if assigned(right) then
  609. begin
  610. registers32:=max(left.registers32,right.registers32);
  611. registersfpu:=max(left.registersfpu,right.registersfpu);
  612. {$ifdef SUPPORT_MMX}
  613. registersmmx:=max(left.registersmmx,right.registersmmx);
  614. {$endif SUPPORT_MMX}
  615. end
  616. else
  617. begin
  618. registers32:=left.registers32;
  619. registersfpu:=left.registersfpu;
  620. {$ifdef SUPPORT_MMX}
  621. registersmmx:=left.registersmmx;
  622. {$endif SUPPORT_MMX}
  623. end;
  624. end;
  625. end;
  626. {$ifdef extdebug}
  627. procedure tbinarynode.dowrite;
  628. begin
  629. inherited dowrite;
  630. writeln(',');
  631. writenodeindention:=writenodeindention+' ';
  632. writenode(right);
  633. write(')');
  634. delete(writenodeindention,1,4);
  635. end;
  636. {$endif}
  637. {****************************************************************************
  638. TBINOPYNODE
  639. ****************************************************************************}
  640. constructor tbinopnode.create(tt : tnodetype;l,r : tnode);
  641. begin
  642. inherited create(tt,l,r);
  643. end;
  644. function tbinopnode.docompare(p : tnode) : boolean;
  645. begin
  646. docompare:=(inherited docompare(p)) or
  647. { if that's in the flags, is p then always a tbinopnode (?) (JM) }
  648. ((nf_swapable in flags) and
  649. left.isequal(tbinopnode(p).right) and
  650. right.isequal(tbinopnode(p).left));
  651. end;
  652. {****************************************************************************
  653. WRITENODE
  654. ****************************************************************************}
  655. {$ifdef EXTDEBUG}
  656. procedure writenode(t:tnode);
  657. begin
  658. if assigned(t) then
  659. t.dowrite
  660. else
  661. write(writenodeindention,'nil');
  662. if writenodeindention='' then
  663. writeln;
  664. end;
  665. {$endif EXTDEBUG}
  666. end.
  667. {
  668. $Log$
  669. Revision 1.14 2001-04-02 21:20:31 peter
  670. * resulttype rewrite
  671. Revision 1.13 2001/01/13 00:08:09 peter
  672. * added missing addoptn
  673. Revision 1.12 2001/01/01 11:38:45 peter
  674. * forgot to remove node.inc and nodeh.inc that were merged into node.pas
  675. already.
  676. Revision 1.11 2000/12/25 00:07:26 peter
  677. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  678. tlinkedlist objects)
  679. Revision 1.10 2000/11/29 00:30:34 florian
  680. * unused units removed from uses clause
  681. * some changes for widestrings
  682. Revision 1.9 2000/10/31 22:02:49 peter
  683. * symtable splitted, no real code changes
  684. Revision 1.8 2000/10/01 19:48:24 peter
  685. * lot of compile updates for cg11
  686. Revision 1.7 2000/09/30 16:08:45 peter
  687. * more cg11 updates
  688. Revision 1.6 2000/09/28 19:49:52 florian
  689. *** empty log message ***
  690. Revision 1.5 2000/09/27 18:14:31 florian
  691. * fixed a lot of syntax errors in the n*.pas stuff
  692. Revision 1.4 2000/09/24 15:06:19 peter
  693. * use defines.inc
  694. Revision 1.3 2000/09/22 21:45:35 florian
  695. * some updates e.g. getcopy added
  696. Revision 1.2 2000/09/20 21:52:38 florian
  697. * removed a lot of errors
  698. Revision 1.1 2000/08/26 12:27:35 florian
  699. * initial release
  700. }