nodeh.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {
  2. $Id$
  3. Copyright (c) 1999-2000 by Florian Klaempfl
  4. The declarations of the nodes for the new code generator
  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. type
  19. tnodeflags = (nf_needs_truefalselabel,tf_callunique);
  20. tnodeflagset = set of tnodeflags;
  21. pnode = ^tnode;
  22. tnode = object(tlinkedlist_item)
  23. treetype : ttreetyp;
  24. { the location of the result of this node }
  25. location : tlocation;
  26. { do we need to parse childs to set var state }
  27. varstateset : boolean;
  28. { the parent node of this is node }
  29. { this field is set by concattolist }
  30. parent : pnode;
  31. { there are some properties about the node stored }
  32. flags : tnodeflagset;
  33. { the number of registers needed to evalute the node }
  34. registersint,registersfpu : longint; { must be longint !!!! }
  35. {$ifdef SUPPORT_MMX}
  36. registersmmx,registerskni : longint;
  37. {$endif SUPPORT_MMX}
  38. resulttype : pdef;
  39. fileinfo : tfileposinfo;
  40. localswitches : tlocalswitches;
  41. {$ifdef extdebug}
  42. firstpasscount : longint;
  43. {$endif extdebug}
  44. error : boolean;
  45. list : paasmoutput;
  46. constructor init;
  47. destructor done;virtual;
  48. { runs det_resulttype and det_temp }
  49. procedure pass_1;
  50. { dermines the resulttype of the node }
  51. procedure det_resulttype;virtual;
  52. { dermines the number of necessary temp. locations to evaluate
  53. the node }
  54. procedure det_temp;virtual;
  55. procedure secondpass;virtual;
  56. {$ifdef EXTDEBUG}
  57. { writes a node for debugging purpose, shouldn't be called }
  58. { direct, because there is no test for nil, use writenode }
  59. { to write a complete tree }
  60. procedure dowrite;virtual;
  61. {$endif EXTDEBUG}
  62. procedure concattolist(l : plinkedlist);virtual;
  63. function ischild(p : pnode) : boolean;virtual;
  64. end;
  65. { this node is the anchestor for all classes with at least }
  66. { one child, you have to use it if you want to use }
  67. { true- and falselabel }
  68. punarynode = ^tunarynode;
  69. tunarynode = object(tnode)
  70. left : pnode;
  71. truelabel,falselabel : pasmlabel;
  72. {$ifdef extdebug}
  73. procedure dowrite;virtual;
  74. {$endif extdebug}
  75. constructor init(l : pnode);
  76. procedure concattolist(l : plinkedlist);virtual;
  77. function ischild(p : pnode) : boolean;virtual;
  78. procedure det_resulttype;virtual;
  79. procedure det_temp;virtual;
  80. end;
  81. pbinarynode = ^tbinarynode;
  82. tbinarynode = object(tunarynode)
  83. right : pnode;
  84. constructor init(l,r : pnode);
  85. procedure concattolist(l : plinkedlist);virtual;
  86. function ischild(p : pnode) : boolean;virtual;
  87. procedure det_resulttype;virtual;
  88. procedure det_temp;virtual;
  89. end;
  90. pvecnode = ^tvecnode;
  91. tvecnode = object(tbinarynode)
  92. end;
  93. pbinopnode = ^tbinopnode;
  94. tbinopnode = object(tbinarynode)
  95. { is true, if the right and left operand are swaped }
  96. { against the original order }
  97. swaped : boolean;
  98. constructor init(l,r : pnode);
  99. end;
  100. {
  101. $Log$
  102. Revision 1.2 2000-07-13 11:32:55 michael
  103. + removed logs
  104. }