symconst.pas 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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. {$ifdef FPC}
  21. {$ifdef PACKENUMFIXED}
  22. {$PACKENUM 1}
  23. {$endif}
  24. {$endif}
  25. const
  26. def_alignment = 4;
  27. type
  28. { symbol options }
  29. tsymoption=(sp_none,
  30. sp_public,
  31. sp_private,
  32. sp_published,
  33. sp_protected,
  34. sp_static,
  35. sp_primary_typesym { this is for typesym, to know who is the primary symbol of a def }
  36. );
  37. tsymoptions=set of tsymoption;
  38. { flags for a definition }
  39. tdefoption=(df_none,
  40. df_need_rtti, { the definitions needs rtti }
  41. df_has_rtti { the rtti is generated }
  42. );
  43. tdefoptions=set of tdefoption;
  44. { base types for orddef }
  45. tbasetype = (
  46. uauto,uvoid,uchar,
  47. u8bit,u16bit,u32bit,
  48. s8bit,s16bit,s32bit,
  49. bool8bit,bool16bit,bool32bit,
  50. u64bit,s64bit,uwidechar
  51. );
  52. { float types }
  53. tfloattype = (
  54. s32real,s64real,s80real,
  55. s64comp,
  56. f16bit,f32bit
  57. );
  58. { string types }
  59. tstringtype = (st_default,
  60. st_shortstring, st_longstring, st_ansistring, st_widestring
  61. );
  62. { set types }
  63. tsettype = (
  64. normset,smallset,varset
  65. );
  66. { calling convention for tprocdef and tprocvardef }
  67. tproccalloption=(pocall_none,
  68. pocall_clearstack, { Use IBM flat calling convention. (Used by GCC.) }
  69. pocall_leftright, { Push parameters from left to right }
  70. pocall_cdecl, { procedure uses C styled calling }
  71. pocall_register, { procedure uses register (fastcall) calling }
  72. pocall_stdcall, { procedure uses stdcall call }
  73. pocall_safecall, { safe call calling conventions }
  74. pocall_palmossyscall, { procedure is a PalmOS system call }
  75. pocall_system,
  76. pocall_inline, { Procedure is an assembler macro }
  77. pocall_internproc, { Procedure has compiler magic}
  78. pocall_internconst { procedure has constant evaluator intern }
  79. );
  80. tproccalloptions=set of tproccalloption;
  81. { basic type for tprocdef and tprocvardef }
  82. tproctypeoption=(potype_none,
  83. potype_proginit, { Program initialization }
  84. potype_unitinit, { unit initialization }
  85. potype_unitfinalize, { unit finalization }
  86. potype_constructor, { Procedure is a constructor }
  87. potype_destructor, { Procedure is a destructor }
  88. potype_operator { Procedure defines an operator }
  89. );
  90. tproctypeoptions=set of tproctypeoption;
  91. { other options for tprocdef and tprocvardef }
  92. tprocoption=(po_none,
  93. po_classmethod, { class method }
  94. po_virtualmethod, { Procedure is a virtual method }
  95. po_abstractmethod, { Procedure is an abstract method }
  96. po_staticmethod, { static method }
  97. po_overridingmethod, { method with override directive }
  98. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  99. po_containsself, { self is passed explicit to the compiler }
  100. po_interrupt, { Procedure is an interrupt handler }
  101. po_iocheck, { IO checking should be done after a call to the procedure }
  102. po_assembler, { Procedure is written in assembler }
  103. po_msgstr, { method for string message handling }
  104. po_msgint, { method for int message handling }
  105. po_exports, { Procedure has export directive (needed for OS/2) }
  106. po_external, { Procedure is external (in other object or lib)}
  107. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  108. po_saveregisters, { save all registers }
  109. po_overload { procedure is declared with overload directive }
  110. );
  111. tprocoptions=set of tprocoption;
  112. { options for objects and classes }
  113. tobjectoption=(oo_none,
  114. oo_is_class,
  115. oo_is_forward, { the class is only a forward declared yet }
  116. oo_has_virtual, { the object/class has virtual methods }
  117. oo_has_private,
  118. oo_has_protected,
  119. oo_has_constructor, { the object/class has a constructor }
  120. oo_has_destructor, { the object/class has a destructor }
  121. oo_has_vmt, { the object/class has a vmt }
  122. oo_has_msgstr,
  123. oo_has_msgint,
  124. oo_has_abstract, { the object/class has an abstract method => no instances can be created }
  125. oo_can_have_published, { the class has rtti, i.e. you can publish properties }
  126. oo_is_cppclass, { the object/class uses an C++ compatible }
  127. { class layout }
  128. oo_is_interface { delphi styled interface }
  129. );
  130. tobjectoptions=set of tobjectoption;
  131. { options for properties }
  132. tpropertyoption=(ppo_none,
  133. ppo_indexed,
  134. ppo_defaultproperty,
  135. ppo_stored,
  136. ppo_hasparameters,
  137. ppo_is_override
  138. );
  139. tpropertyoptions=set of tpropertyoption;
  140. { options for variables }
  141. tvaroption=(vo_none,
  142. vo_regable,
  143. vo_is_C_var,
  144. vo_is_external,
  145. vo_is_dll_var,
  146. vo_is_thread_var,
  147. vo_fpuregable,
  148. vo_is_local_copy,
  149. vo_is_const, { variable is declared as const (parameter) and can't be written to }
  150. vo_is_exported
  151. );
  152. tvaroptions=set of tvaroption;
  153. { definition contains the informations about a type }
  154. tdeftype = (abstractdef,arraydef,recorddef,pointerdef,orddef,
  155. stringdef,enumdef,procdef,objectdef,errordef,
  156. filedef,formaldef,setdef,procvardef,floatdef,
  157. classrefdef,forwarddef);
  158. { possible types for symtable entries }
  159. tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,programsym,
  160. constsym,enumsym,typedconstsym,errorsym,syssym,
  161. labelsym,absolutesym,propertysym,funcretsym,
  162. macrosym);
  163. { State of the variable, if it's declared, assigned or used }
  164. tvarstate=(vs_none,
  165. vs_declared,vs_declared_and_first_found,
  166. vs_set_but_first_not_passed,vs_assigned,vs_used
  167. );
  168. absolutetyp = (tovar,toasm,toaddr);
  169. tconsttyp = (constnone,
  170. constord,conststring,constreal,constbool,
  171. constint,constchar,constset,constpointer,constnil,
  172. constresourcestring
  173. );
  174. const
  175. { relevant options for assigning a proc or a procvar to a procvar }
  176. po_compatibility_options = [
  177. po_classmethod,
  178. po_staticmethod,
  179. po_methodpointer,
  180. po_containsself,
  181. po_interrupt,
  182. po_iocheck,
  183. po_exports
  184. ];
  185. const
  186. SymTypeName : array[tsymtyp] of string[12] =
  187. ('abstractsym','variable','type','proc','unit','program',
  188. 'const','enum','typed const','errorsym','system sym',
  189. 'label','absolute','property','funcret',
  190. 'macrosym');
  191. implementation
  192. end.
  193. {
  194. $Log$
  195. Revision 1.4 2000-08-05 13:25:06 peter
  196. * packenum 1 fixes (merged)
  197. Revision 1.3 2000/07/13 12:08:27 michael
  198. + patched to 1.1.0 with former 1.09patch from peter
  199. Revision 1.2 2000/07/13 11:32:49 michael
  200. + removed logs
  201. }