ncal.pas 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  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 ncal;
  18. {$i defines.inc}
  19. interface
  20. uses
  21. node,symtable;
  22. type
  23. tcallnode = class(tbinarynode)
  24. { the symbol containing the definition of the procedure }
  25. { to call }
  26. symtableprocentry : pprocsym;
  27. { the symtable containing symtableprocentry }
  28. symtableproc : psymtable;
  29. { the definition of the procedure to call }
  30. procdefinition : pabstractprocdef;
  31. methodpointer : tnode;
  32. { only the processor specific nodes need to override this }
  33. { constructor }
  34. constructor create(v : pprocsym;st : psymtable);virtual;
  35. end;
  36. tcallparanode = class(tbinarynode)
  37. hightree : tnode;
  38. { only the processor specific nodes need to override this }
  39. { constructor }
  40. constructor create(expr,next : tnode);virtual;
  41. destructor destroy;override;
  42. end;
  43. function gencallparanode(expr,next : tnode) : tnode;
  44. function gencallnode(v : pprocsym;st : psymtable) : tnode;
  45. var
  46. ccallnode : class of tcallnode;
  47. ccallparanode : class of tcallparanode;
  48. implementation
  49. {****************************************************************************
  50. TCALLPARANODE
  51. ****************************************************************************}
  52. function gencallparanode(expr,next : tnode) : tnode;
  53. begin
  54. gencallparanode:=ccallparanode.create(expr,next);
  55. end;
  56. constructor tcallparanode.create(expr,next : tnode);
  57. begin
  58. inherited create(callparan,expr,next);
  59. hightree:=nil;
  60. expr.set_file_line(self);
  61. end;
  62. destructor tcallparanode.destroy;
  63. begin
  64. hightree.free;
  65. inherited destroy;
  66. end;
  67. {****************************************************************************
  68. TCALLNODE
  69. ****************************************************************************}
  70. function gencallnode(v : pprocsym;st : psymtable) : tnode;
  71. begin
  72. gencallnode:=ccallnode.create(v,st);
  73. end;
  74. constructor tcallnode.create(v : pprocsym;st : psymtable);
  75. begin
  76. inherited create(calln,nil,nil);
  77. symtableprocentry:=v;
  78. symtableproc:=st;
  79. include(flags,nf_return_value_used);
  80. methodpointer:=nil;
  81. procdefinition:=nil;
  82. end;
  83. begin
  84. ccallnode:=tcallnode;
  85. ccallparanode:=tcallparanode;
  86. end.
  87. {
  88. $Log$
  89. Revision 1.3 2000-09-24 15:06:19 peter
  90. * use defines.inc
  91. Revision 1.2 2000/09/20 21:52:38 florian
  92. * removed a lot of errors
  93. Revision 1.1 2000/09/20 20:52:16 florian
  94. * initial revision
  95. }