node.pas 24 KB

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