symconst.pas 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. { if you change one of the following contants, }
  28. { you have also to change the typinfo unit}
  29. { and the rtl/i386,template/rttip.inc files }
  30. tkUnknown = 0;
  31. tkInteger = 1;
  32. tkChar = 2;
  33. tkEnumeration = 3;
  34. tkFloat = 4;
  35. tkSet = 5;
  36. tkMethod = 6;
  37. tkSString = 7;
  38. tkString = tkSString;
  39. tkLString = 8;
  40. tkAString = 9;
  41. tkWString = 10;
  42. tkVariant = 11;
  43. tkArray = 12;
  44. tkRecord = 13;
  45. tkInterface= 14;
  46. tkClass = 15;
  47. tkObject = 16;
  48. tkWChar = 17;
  49. tkBool = 18;
  50. tkInt64 = 19;
  51. tkQWord = 20;
  52. otSByte = 0;
  53. otUByte = 1;
  54. otSWord = 2;
  55. otUWord = 3;
  56. otSLong = 4;
  57. otULong = 5;
  58. ftSingle = 0;
  59. ftDouble = 1;
  60. ftExtended = 2;
  61. ftComp = 3;
  62. ftCurr = 4;
  63. ftFixed16 = 5;
  64. ftFixed32 = 6;
  65. mkProcedure= 0;
  66. mkFunction = 1;
  67. mkConstructor = 2;
  68. mkDestructor = 3;
  69. mkClassProcedure= 4;
  70. mkClassFunction = 5;
  71. pfvar = 1;
  72. pfConst = 2;
  73. pfArray = 4;
  74. pfAddress = 8;
  75. pfReference= 16;
  76. pfOut = 32;
  77. type
  78. { symbol options }
  79. tsymoption=(sp_none,
  80. sp_public,
  81. sp_private,
  82. sp_published,
  83. sp_protected,
  84. sp_static,
  85. sp_primary_typesym { this is for typesym, to know who is the primary symbol of a def }
  86. );
  87. tsymoptions=set of tsymoption;
  88. { flags for a definition }
  89. tdefoption=(df_none,
  90. df_need_rtti, { the definitions needs rtti }
  91. df_has_rtti { the rtti is generated }
  92. );
  93. tdefoptions=set of tdefoption;
  94. { base types for orddef }
  95. tbasetype = (
  96. uauto,uvoid,uchar,
  97. u8bit,u16bit,u32bit,
  98. s8bit,s16bit,s32bit,
  99. bool8bit,bool16bit,bool32bit,
  100. u64bit,s64bit,uwidechar
  101. );
  102. { float types }
  103. tfloattype = (
  104. s32real,s64real,s80real,
  105. s64comp,
  106. f16bit,f32bit
  107. );
  108. { string types }
  109. tstringtype = (st_default,
  110. st_shortstring, st_longstring, st_ansistring, st_widestring
  111. );
  112. { set types }
  113. tsettype = (
  114. normset,smallset,varset
  115. );
  116. { calling convention for tprocdef and tprocvardef }
  117. tproccalloption=(pocall_none,
  118. pocall_clearstack, { Use IBM flat calling convention. (Used by GCC.) }
  119. pocall_leftright, { Push parameters from left to right }
  120. pocall_cdecl, { procedure uses C styled calling }
  121. pocall_register, { procedure uses register (fastcall) calling }
  122. pocall_stdcall, { procedure uses stdcall call }
  123. pocall_safecall, { safe call calling conventions }
  124. pocall_palmossyscall, { procedure is a PalmOS system call }
  125. pocall_system,
  126. pocall_inline, { Procedure is an assembler macro }
  127. pocall_internproc, { Procedure has compiler magic}
  128. pocall_internconst { procedure has constant evaluator intern }
  129. );
  130. tproccalloptions=set of tproccalloption;
  131. { basic type for tprocdef and tprocvardef }
  132. tproctypeoption=(potype_none,
  133. potype_proginit, { Program initialization }
  134. potype_unitinit, { unit initialization }
  135. potype_unitfinalize, { unit finalization }
  136. potype_constructor, { Procedure is a constructor }
  137. potype_destructor, { Procedure is a destructor }
  138. potype_operator { Procedure defines an operator }
  139. );
  140. tproctypeoptions=set of tproctypeoption;
  141. { other options for tprocdef and tprocvardef }
  142. tprocoption=(po_none,
  143. po_classmethod, { class method }
  144. po_virtualmethod, { Procedure is a virtual method }
  145. po_abstractmethod, { Procedure is an abstract method }
  146. po_staticmethod, { static method }
  147. po_overridingmethod, { method with override directive }
  148. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  149. po_containsself, { self is passed explicit to the compiler }
  150. po_interrupt, { Procedure is an interrupt handler }
  151. po_iocheck, { IO checking should be done after a call to the procedure }
  152. po_assembler, { Procedure is written in assembler }
  153. po_msgstr, { method for string message handling }
  154. po_msgint, { method for int message handling }
  155. po_exports, { Procedure has export directive (needed for OS/2) }
  156. po_external, { Procedure is external (in other object or lib)}
  157. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  158. po_saveregisters, { save all registers }
  159. po_overload { procedure is declared with overload directive }
  160. );
  161. tprocoptions=set of tprocoption;
  162. { options for objects and classes }
  163. tobjectoption=(oo_none,
  164. oo_is_class,
  165. oo_is_forward, { the class is only a forward declared yet }
  166. oo_has_virtual, { the object/class has virtual methods }
  167. oo_has_private,
  168. oo_has_protected,
  169. oo_has_constructor, { the object/class has a constructor }
  170. oo_has_destructor, { the object/class has a destructor }
  171. oo_has_vmt, { the object/class has a vmt }
  172. oo_has_msgstr,
  173. oo_has_msgint,
  174. oo_has_abstract, { the object/class has an abstract method => no instances can be created }
  175. oo_can_have_published, { the class has rtti, i.e. you can publish properties }
  176. oo_is_cppclass, { the object/class uses an C++ compatible }
  177. { class layout }
  178. oo_is_interface { delphi styled interface }
  179. );
  180. tobjectoptions=set of tobjectoption;
  181. { options for properties }
  182. tpropertyoption=(ppo_none,
  183. ppo_indexed,
  184. ppo_defaultproperty,
  185. ppo_stored,
  186. ppo_hasparameters,
  187. ppo_is_override
  188. );
  189. tpropertyoptions=set of tpropertyoption;
  190. { options for variables }
  191. tvaroption=(vo_none,
  192. vo_regable,
  193. vo_is_C_var,
  194. vo_is_external,
  195. vo_is_dll_var,
  196. vo_is_thread_var,
  197. vo_fpuregable,
  198. vo_is_local_copy,
  199. vo_is_const, { variable is declared as const (parameter) and can't be written to }
  200. vo_is_exported
  201. );
  202. tvaroptions=set of tvaroption;
  203. { definition contains the informations about a type }
  204. tdeftype = (abstractdef,arraydef,recorddef,pointerdef,orddef,
  205. stringdef,enumdef,procdef,objectdef,errordef,
  206. filedef,formaldef,setdef,procvardef,floatdef,
  207. classrefdef,forwarddef);
  208. { possible types for symtable entries }
  209. tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,programsym,
  210. constsym,enumsym,typedconstsym,errorsym,syssym,
  211. labelsym,absolutesym,propertysym,funcretsym,
  212. macrosym);
  213. { State of the variable, if it's declared, assigned or used }
  214. tvarstate=(vs_none,
  215. vs_declared,vs_declared_and_first_found,
  216. vs_set_but_first_not_passed,vs_assigned,vs_used
  217. );
  218. absolutetyp = (tovar,toasm,toaddr);
  219. tconsttyp = (constnone,
  220. constord,conststring,constreal,constbool,
  221. constint,constchar,constset,constpointer,constnil,
  222. constresourcestring
  223. );
  224. {$ifdef GDB}
  225. tdefstabstatus = (
  226. not_written,
  227. being_written,
  228. written);
  229. {$endif GDB}
  230. const
  231. { relevant options for assigning a proc or a procvar to a procvar }
  232. po_compatibility_options = [
  233. po_classmethod,
  234. po_staticmethod,
  235. po_methodpointer,
  236. po_containsself,
  237. po_interrupt,
  238. po_iocheck,
  239. po_exports
  240. ];
  241. const
  242. SymTypeName : array[tsymtyp] of string[12] =
  243. ('abstractsym','variable','type','proc','unit','program',
  244. 'const','enum','typed const','errorsym','system sym',
  245. 'label','absolute','property','funcret',
  246. 'macrosym');
  247. implementation
  248. end.
  249. {
  250. $Log$
  251. Revision 1.6 2000-08-21 11:27:44 pierre
  252. * fix the stabs problems
  253. Revision 1.5 2000/08/06 19:39:28 peter
  254. * default parameters working !
  255. Revision 1.4 2000/08/05 13:25:06 peter
  256. * packenum 1 fixes (merged)
  257. Revision 1.3 2000/07/13 12:08:27 michael
  258. + patched to 1.1.0 with former 1.09patch from peter
  259. Revision 1.2 2000/07/13 11:32:49 michael
  260. + removed logs
  261. }