symconst.inc 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
  4. Symbol table constants
  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 symconst;
  19. interface
  20. type
  21. { calling convention for tprocdef and tprocvardef }
  22. pocalloption=(pocall_none,
  23. pocall_clearstack, { Use IBM flat calling convention. (Used by GCC.) }
  24. pocall_leftright, { Push parameters from left to right }
  25. pocall_cdecl, { procedure uses C styled calling }
  26. pocall_register, { procedure uses register (fastcall) calling }
  27. pocall_stdcall, { procedure uses stdcall call }
  28. pocall_safecall, { safe call calling conventions }
  29. pocall_palmossyscall { procedure is a PalmOS system call }
  30. );
  31. { basic type for tprocdef and tprocvardef }
  32. potypeoption=(potype_none,
  33. potype_proginit, { Program initialization }
  34. potype_unitinit, { unit initialization }
  35. potype_unitfinalize, { unit finalization }
  36. potype_constructor, { Procedure is a constructor }
  37. potype_destructor, { Procedure is a destructor }
  38. potype_internproc, { Procedure has compiler magic}
  39. potype_internconst, { procedure has constant evaluator intern }
  40. potype_operator { Procedure defines an operator }
  41. );
  42. { other options for tprocdef and tprocvardef }
  43. pooption=(po_none,
  44. po_classmethod, { class method }
  45. po_virtualmethod, { Procedure is a virtual method }
  46. po_abstractmethod, { Procedure is an abstract method }
  47. po_staticmethod, { static method }
  48. po_overridingmethod, { method with override directive }
  49. po_inline, { Procedure is an assembler macro }
  50. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  51. po_containsself, { self is passed explicit to the compiler }
  52. po_interrupt, { Procedure is an interrupt handler }
  53. po_iocheck, { IO checking should be done after a call to the procedure }
  54. po_assembler, { Procedure is written in assembler }
  55. po_msgstr, { method for string message handling }
  56. po_msgint, { method for int message handling }
  57. po_exports, { Procedure has export directive (needed for OS/2) }
  58. po_external, { Procedure is external (in other object or lib)}
  59. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  60. po_saveregisters { save all registers }
  61. );
  62. pooptions=set of pooption;
  63. { symbol options }
  64. spoption=(sp_none,
  65. sp_public,
  66. sp_private,
  67. sp_published,
  68. sp_protected,
  69. sp_forwarddef,
  70. sp_static
  71. sp_primary_typesym; { this is for typesym, to know who is the primary symbol of a def }
  72. );
  73. spoptions=set of spoption;
  74. { options for objects and classes }
  75. oooption=(
  76. oo_is_class,
  77. oo_is_forward, { the class is only a forward declared yet }
  78. oo_has_virtual, { the object/class has virtual methods }
  79. oo_has_private,
  80. oo_has_protected,
  81. oo_has_constructor, { the object/class has a constructor }
  82. oo_has_destructor, { the object/class has a destructor }
  83. oo_has_vmt, { the object/class has a vmt }
  84. oo_has_msgstr,
  85. oo_has_msgint,
  86. oo_has_abstract, { the object/class has an abstract method => no instances can be created }
  87. oo_can_have_published, { the class has rtti, i.e. you can publish properties }
  88. oo_cppvmt, { the object/class uses an C++ compatible }
  89. { vmt, all members of the same class tree }
  90. { must use then a C++ compatible vmt }
  91. );
  92. oooptions=set of oooption;
  93. const
  94. def_alignment = 4;
  95. { flags for a definition }
  96. df_needsrtti = $1; { the definitions needs rtti }
  97. df_hasrtti = $2; { the rtti is generated }
  98. { relevant options for assigning a proc or a procvar to a procvar }
  99. po_compatibility_options = [
  100. po_classmethod,
  101. po_staticmethod,
  102. po_inline,
  103. po_methodpointer,
  104. po_containsself,
  105. po_interrupt,
  106. po_iocheck,
  107. po_exports,
  108. ];
  109. { options for properties }
  110. ppo_indexed = $1;
  111. ppo_defaultproperty = $2;
  112. ppo_stored = $4;
  113. { options for variables }
  114. vo_regable = $1;
  115. vo_is_C_var = $2;
  116. vo_is_external = $4;
  117. vo_is_dll_var = $8;
  118. vo_is_thread_var = $10;
  119. {
  120. $Log$
  121. Revision 1.13 1999-08-03 22:03:13 peter
  122. * moved bitmask constants to sets
  123. * some other type/const renamings
  124. Revision 1.12 1999/07/06 21:48:26 florian
  125. * a lot bug fixes:
  126. - po_external isn't any longer necessary for procedure compatibility
  127. - m_tp_procvar is in -Sd now available
  128. - error messages of procedure variables improved
  129. - return values with init./finalization fixed
  130. - data types with init./finalization aren't any longer allowed in variant
  131. record
  132. Revision 1.11 1999/06/03 09:34:11 peter
  133. * better methodpointer check for proc->procvar
  134. Revision 1.10 1999/06/01 19:27:56 peter
  135. * better checks for procvar and methodpointer
  136. Revision 1.9 1999/05/24 08:55:29 florian
  137. * non working safecall directiv implemented, I don't know if we
  138. need it
  139. Revision 1.8 1999/05/20 22:22:42 pierre
  140. + added synonym filed for ttypesym
  141. allows a clean disposal of tdefs and related ttypesyms
  142. Revision 1.7 1999/05/12 22:36:13 florian
  143. * override isn't allowed in objects!
  144. Revision 1.6 1999/04/28 06:02:10 florian
  145. * changes of Bruessel:
  146. + message handler can now take an explicit self
  147. * typinfo fixed: sometimes the type names weren't written
  148. * the type checking for pointer comparisations and subtraction
  149. and are now more strict (was also buggy)
  150. * small bug fix to link.pas to support compiling on another
  151. drive
  152. * probable bug in popt386 fixed: call/jmp => push/jmp
  153. transformation didn't count correctly the jmp references
  154. + threadvar support
  155. * warning if ln/sqrt gets an invalid constant argument
  156. Revision 1.5 1999/04/26 13:31:46 peter
  157. * release storenumber,double_checksum
  158. Revision 1.4 1999/04/16 10:28:26 pierre
  159. + added posavestdregs used for cdecl AND stdcall functions
  160. (saves ESI EDI and EBX for i386)
  161. Revision 1.3 1999/03/05 01:14:23 pierre
  162. * bug0198 : call conventions for methods
  163. not yet implemented is the control of same calling convention
  164. for virtual and child's virtual
  165. * msgstr and msgint only created if message was found
  166. who implemented this by the way ?
  167. it leaks lots of plabels !!!! (check with heaptrc !)
  168. Revision 1.2 1999/02/22 20:13:37 florian
  169. + first implementation of message keyword
  170. Revision 1.1 1999/01/12 14:32:49 peter
  171. * splitted from symtable.pas
  172. }