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