node.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  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. 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_return_value_used,
  205. nf_static_call,
  206. { flags used by tcallparanode }
  207. nf_varargs_para, { belongs this para to varargs }
  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. { type of this node }
  255. nodetype : tnodetype;
  256. { type of the current code block, general/const/type }
  257. blocktype : tblock_type;
  258. { the location of the result of this node }
  259. location : tlocation;
  260. { the parent node of this is node }
  261. { this field is set by concattolist }
  262. parent : tnode;
  263. { there are some properties about the node stored }
  264. flags : tnodeflagset;
  265. { the number of registers needed to evalute the node }
  266. registers32,registersfpu : longint; { must be longint !!!! }
  267. {$ifdef SUPPORT_MMX}
  268. registersmmx,registerskni : longint;
  269. {$endif SUPPORT_MMX}
  270. resulttype : ttype;
  271. fileinfo : tfileposinfo;
  272. localswitches : tlocalswitches;
  273. {$ifdef extdebug}
  274. maxfirstpasscount,
  275. firstpasscount : longint;
  276. {$endif extdebug}
  277. list : taasmoutput;
  278. constructor create(tt : tnodetype);
  279. { this constructor is only for creating copies of class }
  280. { the fields are copied by getcopy }
  281. constructor createforcopy;
  282. destructor destroy;override;
  283. { toggles the flag }
  284. procedure toggleflag(f : tnodeflags);
  285. { the 1.1 code generator may override pass_1 }
  286. { and it need not to implement det_* then }
  287. { 1.1: pass_1 returns a value<>0 if the node has been transformed }
  288. { 2.0: runs det_resulttype and det_temp }
  289. function pass_1 : tnode;virtual;abstract;
  290. { dermines the resulttype of the node }
  291. function det_resulttype : tnode;virtual;abstract;
  292. { dermines the number of necessary temp. locations to evaluate
  293. the node }
  294. procedure det_temp;virtual;abstract;
  295. procedure pass_2;virtual;abstract;
  296. { comparing of nodes }
  297. function isequal(p : tnode) : boolean;
  298. { to implement comparisation, override this method }
  299. function docompare(p : tnode) : boolean;virtual;
  300. { gets a copy of the node }
  301. function getcopy : tnode;virtual;
  302. procedure insertintolist(l : tnodelist);virtual;
  303. {$ifdef EXTDEBUG}
  304. { writes a node for debugging purpose, shouldn't be called }
  305. { direct, because there is no test for nil, use writenode }
  306. { to write a complete tree }
  307. procedure dowrite;virtual;
  308. procedure dowritenodetype;virtual;
  309. {$endif EXTDEBUG}
  310. procedure concattolist(l : tlinkedlist);virtual;
  311. function ischild(p : tnode) : boolean;virtual;
  312. procedure set_file_line(from : tnode);
  313. procedure set_tree_filepos(const filepos : tfileposinfo);
  314. end;
  315. { this node is the anchestor for all nodes with at least }
  316. { one child, you have to use it if you want to use }
  317. { true- and falselabel }
  318. tparentnode = class(tnode)
  319. {$ifdef newcg}
  320. falselabel,truelabel : tasmlabel;
  321. {$endif newcg}
  322. end;
  323. tnodeclass = class of tnode;
  324. punarynode = ^tunarynode;
  325. tunarynode = class(tparentnode)
  326. left : tnode;
  327. constructor create(tt : tnodetype;l : tnode);
  328. destructor destroy;override;
  329. procedure concattolist(l : tlinkedlist);override;
  330. function ischild(p : tnode) : boolean;override;
  331. function docompare(p : tnode) : boolean;override;
  332. function getcopy : tnode;override;
  333. procedure insertintolist(l : tnodelist);override;
  334. procedure left_max;
  335. {$ifdef extdebug}
  336. procedure dowrite;override;
  337. {$endif extdebug}
  338. end;
  339. pbinarynode = ^tbinarynode;
  340. tbinarynode = class(tunarynode)
  341. right : tnode;
  342. constructor create(tt : tnodetype;l,r : tnode);
  343. destructor destroy;override;
  344. procedure concattolist(l : tlinkedlist);override;
  345. function ischild(p : tnode) : boolean;override;
  346. function docompare(p : tnode) : boolean;override;
  347. procedure swapleftright;
  348. function getcopy : tnode;override;
  349. procedure insertintolist(l : tnodelist);override;
  350. procedure left_right_max;
  351. {$ifdef extdebug}
  352. procedure dowrite;override;
  353. {$endif extdebug}
  354. end;
  355. pbinopnode = ^tbinopnode;
  356. tbinopnode = class(tbinarynode)
  357. constructor create(tt : tnodetype;l,r : tnode);virtual;
  358. function docompare(p : tnode) : boolean;override;
  359. end;
  360. {$ifdef EXTDEBUG}
  361. var
  362. writenodeindention : string;
  363. procedure writenode(t:tnode);
  364. {$endif EXTDEBUG}
  365. implementation
  366. uses
  367. cutils;
  368. {****************************************************************************
  369. TNODE
  370. ****************************************************************************}
  371. constructor tnode.create(tt : tnodetype);
  372. begin
  373. inherited create;
  374. nodetype:=tt;
  375. blocktype:=block_type;
  376. { this allows easier error tracing }
  377. location.loc:=LOC_INVALID;
  378. { save local info }
  379. fileinfo:=aktfilepos;
  380. localswitches:=aktlocalswitches;
  381. resulttype.reset;
  382. registers32:=0;
  383. registersfpu:=0;
  384. {$ifdef SUPPORT_MMX}
  385. registersmmx:=0;
  386. {$endif SUPPORT_MMX}
  387. {$ifdef EXTDEBUG}
  388. maxfirstpasscount:=0;
  389. firstpasscount:=0;
  390. {$endif EXTDEBUG}
  391. flags:=[];
  392. end;
  393. constructor tnode.createforcopy;
  394. begin
  395. end;
  396. procedure tnode.toggleflag(f : tnodeflags);
  397. begin
  398. if f in flags then
  399. exclude(flags,f)
  400. else
  401. include(flags,f);
  402. end;
  403. destructor tnode.destroy;
  404. begin
  405. {$ifdef EXTDEBUG}
  406. if firstpasscount>maxfirstpasscount then
  407. maxfirstpasscount:=firstpasscount;
  408. {$endif EXTDEBUG}
  409. end;
  410. procedure tnode.concattolist(l : tlinkedlist);
  411. begin
  412. {$ifdef newcg}
  413. //!!!!!!! l^.concat(self);
  414. {$warning fixme}
  415. {$endif newcg}
  416. end;
  417. function tnode.ischild(p : tnode) : boolean;
  418. begin
  419. ischild:=false;
  420. end;
  421. {$ifdef EXTDEBUG}
  422. procedure tnode.dowrite;
  423. begin
  424. dowritenodetype;
  425. end;
  426. procedure tnode.dowritenodetype;
  427. begin
  428. write(writenodeindention,'(',nodetype2str[nodetype]);
  429. end;
  430. {$endif EXTDEBUG}
  431. function tnode.isequal(p : tnode) : boolean;
  432. begin
  433. isequal:=
  434. (not assigned(self) and not assigned(p)) or
  435. (assigned(self) and assigned(p) and
  436. { optimized subclasses have the same nodetype as their }
  437. { superclass (for compatibility), so also check the classtype (JM) }
  438. (p.classtype=classtype) and
  439. (p.nodetype=nodetype) and
  440. (flags*flagsequal=p.flags*flagsequal) and
  441. docompare(p));
  442. end;
  443. function tnode.docompare(p : tnode) : boolean;
  444. begin
  445. docompare:=true;
  446. end;
  447. function tnode.getcopy : tnode;
  448. var
  449. p : tnode;
  450. begin
  451. { this is quite tricky because we need a node of the current }
  452. { node type and not one of tnode! }
  453. p:=tnodeclass(classtype).createforcopy;
  454. p.nodetype:=nodetype;
  455. p.location:=location;
  456. p.parent:=parent;
  457. p.flags:=flags;
  458. p.registers32:=registers32;
  459. p.registersfpu:=registersfpu;
  460. {$ifdef SUPPORT_MMX}
  461. p.registersmmx:=registersmmx;
  462. p.registerskni:=registerskni;
  463. {$endif SUPPORT_MMX}
  464. p.resulttype:=resulttype;
  465. p.fileinfo:=fileinfo;
  466. p.localswitches:=localswitches;
  467. {$ifdef extdebug}
  468. p.firstpasscount:=firstpasscount;
  469. {$endif extdebug}
  470. p.list:=list;
  471. getcopy:=p;
  472. end;
  473. procedure tnode.insertintolist(l : tnodelist);
  474. begin
  475. end;
  476. procedure tnode.set_file_line(from : tnode);
  477. begin
  478. if assigned(from) then
  479. fileinfo:=from.fileinfo;
  480. end;
  481. procedure tnode.set_tree_filepos(const filepos : tfileposinfo);
  482. begin
  483. fileinfo:=filepos;
  484. end;
  485. {****************************************************************************
  486. TUNARYNODE
  487. ****************************************************************************}
  488. constructor tunarynode.create(tt : tnodetype;l : tnode);
  489. begin
  490. inherited create(tt);
  491. left:=l;
  492. end;
  493. destructor tunarynode.destroy;
  494. begin
  495. left.free;
  496. inherited destroy;
  497. end;
  498. function tunarynode.docompare(p : tnode) : boolean;
  499. begin
  500. docompare:=(inherited docompare(p) and
  501. ((left=nil) or left.isequal(tunarynode(p).left))
  502. );
  503. end;
  504. function tunarynode.getcopy : tnode;
  505. var
  506. p : tunarynode;
  507. begin
  508. p:=tunarynode(inherited getcopy);
  509. if assigned(left) then
  510. p.left:=left.getcopy
  511. else
  512. p.left:=nil;
  513. getcopy:=p;
  514. end;
  515. procedure tunarynode.insertintolist(l : tnodelist);
  516. begin
  517. end;
  518. {$ifdef extdebug}
  519. procedure tunarynode.dowrite;
  520. begin
  521. inherited dowrite;
  522. writeln(',');
  523. writenodeindention:=writenodeindention+' ';
  524. writenode(left);
  525. write(')');
  526. delete(writenodeindention,1,4);
  527. end;
  528. {$endif}
  529. procedure tunarynode.left_max;
  530. begin
  531. registers32:=left.registers32;
  532. registersfpu:=left.registersfpu;
  533. {$ifdef SUPPORT_MMX}
  534. registersmmx:=left.registersmmx;
  535. {$endif SUPPORT_MMX}
  536. end;
  537. procedure tunarynode.concattolist(l : tlinkedlist);
  538. begin
  539. left.parent:=self;
  540. left.concattolist(l);
  541. inherited concattolist(l);
  542. end;
  543. function tunarynode.ischild(p : tnode) : boolean;
  544. begin
  545. ischild:=p=left;
  546. end;
  547. {****************************************************************************
  548. TBINARYNODE
  549. ****************************************************************************}
  550. constructor tbinarynode.create(tt : tnodetype;l,r : tnode);
  551. begin
  552. inherited create(tt,l);
  553. right:=r
  554. end;
  555. destructor tbinarynode.destroy;
  556. begin
  557. right.free;
  558. inherited destroy;
  559. end;
  560. procedure tbinarynode.concattolist(l : tlinkedlist);
  561. begin
  562. { we could change that depending on the number of }
  563. { required registers }
  564. left.parent:=self;
  565. left.concattolist(l);
  566. left.parent:=self;
  567. left.concattolist(l);
  568. inherited concattolist(l);
  569. end;
  570. function tbinarynode.ischild(p : tnode) : boolean;
  571. begin
  572. ischild:=(p=right);
  573. end;
  574. function tbinarynode.docompare(p : tnode) : boolean;
  575. begin
  576. docompare:=(inherited docompare(p) and
  577. ((right=nil) or right.isequal(tbinarynode(p).right))
  578. );
  579. end;
  580. function tbinarynode.getcopy : tnode;
  581. var
  582. p : tbinarynode;
  583. begin
  584. p:=tbinarynode(inherited getcopy);
  585. if assigned(right) then
  586. p.right:=right.getcopy
  587. else
  588. p.right:=nil;
  589. getcopy:=p;
  590. end;
  591. procedure tbinarynode.insertintolist(l : tnodelist);
  592. begin
  593. end;
  594. procedure tbinarynode.swapleftright;
  595. var
  596. swapp : tnode;
  597. begin
  598. swapp:=right;
  599. right:=left;
  600. left:=swapp;
  601. if nf_swaped in flags then
  602. exclude(flags,nf_swaped)
  603. else
  604. include(flags,nf_swaped);
  605. end;
  606. procedure tbinarynode.left_right_max;
  607. begin
  608. if assigned(left) then
  609. begin
  610. if assigned(right) then
  611. begin
  612. registers32:=max(left.registers32,right.registers32);
  613. registersfpu:=max(left.registersfpu,right.registersfpu);
  614. {$ifdef SUPPORT_MMX}
  615. registersmmx:=max(left.registersmmx,right.registersmmx);
  616. {$endif SUPPORT_MMX}
  617. end
  618. else
  619. begin
  620. registers32:=left.registers32;
  621. registersfpu:=left.registersfpu;
  622. {$ifdef SUPPORT_MMX}
  623. registersmmx:=left.registersmmx;
  624. {$endif SUPPORT_MMX}
  625. end;
  626. end;
  627. end;
  628. {$ifdef extdebug}
  629. procedure tbinarynode.dowrite;
  630. begin
  631. inherited dowrite;
  632. writeln(',');
  633. writenodeindention:=writenodeindention+' ';
  634. writenode(right);
  635. write(')');
  636. delete(writenodeindention,1,4);
  637. end;
  638. {$endif}
  639. {****************************************************************************
  640. TBINOPYNODE
  641. ****************************************************************************}
  642. constructor tbinopnode.create(tt : tnodetype;l,r : tnode);
  643. begin
  644. inherited create(tt,l,r);
  645. end;
  646. function tbinopnode.docompare(p : tnode) : boolean;
  647. begin
  648. docompare:=(inherited docompare(p)) or
  649. { if that's in the flags, is p then always a tbinopnode (?) (JM) }
  650. ((nf_swapable in flags) and
  651. left.isequal(tbinopnode(p).right) and
  652. right.isequal(tbinopnode(p).left));
  653. end;
  654. {****************************************************************************
  655. WRITENODE
  656. ****************************************************************************}
  657. {$ifdef EXTDEBUG}
  658. procedure writenode(t:tnode);
  659. begin
  660. if assigned(t) then
  661. t.dowrite
  662. else
  663. write(writenodeindention,'nil');
  664. if writenodeindention='' then
  665. writeln;
  666. end;
  667. {$endif EXTDEBUG}
  668. end.
  669. {
  670. $Log$
  671. Revision 1.17 2001-06-04 18:14:16 peter
  672. * store blocktype info in tnode
  673. Revision 1.16 2001/06/04 11:53:13 peter
  674. + varargs directive
  675. Revision 1.15 2001/04/13 01:22:10 peter
  676. * symtable change to classes
  677. * range check generation and errors fixed, make cycle DEBUG=1 works
  678. * memory leaks fixed
  679. Revision 1.14 2001/04/02 21:20:31 peter
  680. * resulttype rewrite
  681. Revision 1.13 2001/01/13 00:08:09 peter
  682. * added missing addoptn
  683. Revision 1.12 2001/01/01 11:38:45 peter
  684. * forgot to remove node.inc and nodeh.inc that were merged into node.pas
  685. already.
  686. Revision 1.11 2000/12/25 00:07:26 peter
  687. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  688. tlinkedlist objects)
  689. Revision 1.10 2000/11/29 00:30:34 florian
  690. * unused units removed from uses clause
  691. * some changes for widestrings
  692. Revision 1.9 2000/10/31 22:02:49 peter
  693. * symtable splitted, no real code changes
  694. Revision 1.8 2000/10/01 19:48:24 peter
  695. * lot of compile updates for cg11
  696. Revision 1.7 2000/09/30 16:08:45 peter
  697. * more cg11 updates
  698. Revision 1.6 2000/09/28 19:49:52 florian
  699. *** empty log message ***
  700. Revision 1.5 2000/09/27 18:14:31 florian
  701. * fixed a lot of syntax errors in the n*.pas stuff
  702. Revision 1.4 2000/09/24 15:06:19 peter
  703. * use defines.inc
  704. Revision 1.3 2000/09/22 21:45:35 florian
  705. * some updates e.g. getcopy added
  706. Revision 1.2 2000/09/20 21:52:38 florian
  707. * removed a lot of errors
  708. Revision 1.1 2000/08/26 12:27:35 florian
  709. * initial release
  710. }