symconst.pas 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. pocall_cppdecl { C++ calling conventions }
  126. );
  127. tproccalloptions=set of tproccalloption;
  128. { basic type for tprocdef and tprocvardef }
  129. tproctypeoption=(potype_none,
  130. potype_proginit, { Program initialization }
  131. potype_unitinit, { unit initialization }
  132. potype_unitfinalize, { unit finalization }
  133. potype_constructor, { Procedure is a constructor }
  134. potype_destructor, { Procedure is a destructor }
  135. potype_operator { Procedure defines an operator }
  136. );
  137. tproctypeoptions=set of tproctypeoption;
  138. { other options for tprocdef and tprocvardef }
  139. tprocoption=(po_none,
  140. po_classmethod, { class method }
  141. po_virtualmethod, { Procedure is a virtual method }
  142. po_abstractmethod, { Procedure is an abstract method }
  143. po_staticmethod, { static method }
  144. po_overridingmethod, { method with override directive }
  145. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  146. po_containsself, { self is passed explicit to the compiler }
  147. po_interrupt, { Procedure is an interrupt handler }
  148. po_iocheck, { IO checking should be done after a call to the procedure }
  149. po_assembler, { Procedure is written in assembler }
  150. po_msgstr, { method for string message handling }
  151. po_msgint, { method for int message handling }
  152. po_exports, { Procedure has export directive (needed for OS/2) }
  153. po_external, { Procedure is external (in other object or lib)}
  154. po_savestdregs, { save std regs cdecl and stdcall need that ! }
  155. po_saveregisters, { save all registers }
  156. po_overload { procedure is declared with overload directive }
  157. );
  158. tprocoptions=set of tprocoption;
  159. { options for objects and classes }
  160. tobjectoption=(oo_none,
  161. oo_is_class,
  162. oo_is_forward, { the class is only a forward declared yet }
  163. oo_has_virtual, { the object/class has virtual methods }
  164. oo_has_private,
  165. oo_has_protected,
  166. oo_has_constructor, { the object/class has a constructor }
  167. oo_has_destructor, { the object/class has a destructor }
  168. oo_has_vmt, { the object/class has a vmt }
  169. oo_has_msgstr,
  170. oo_has_msgint,
  171. oo_has_abstract, { the object/class has an abstract method => no instances can be created }
  172. oo_can_have_published, { the class has rtti, i.e. you can publish properties }
  173. oo_is_cppclass, { the object/class uses an C++ compatible }
  174. { class layout }
  175. oo_is_interface { delphi styled interface }
  176. );
  177. tobjectoptions=set of tobjectoption;
  178. { options for properties }
  179. tpropertyoption=(ppo_none,
  180. ppo_indexed,
  181. ppo_defaultproperty,
  182. ppo_stored,
  183. ppo_hasparameters,
  184. ppo_is_override
  185. );
  186. tpropertyoptions=set of tpropertyoption;
  187. { options for variables }
  188. tvaroption=(vo_none,
  189. vo_regable,
  190. vo_is_C_var,
  191. vo_is_external,
  192. vo_is_dll_var,
  193. vo_is_thread_var,
  194. vo_fpuregable,
  195. vo_is_local_copy,
  196. vo_is_const, { variable is declared as const (parameter) and can't be written to }
  197. vo_is_exported
  198. );
  199. tvaroptions=set of tvaroption;
  200. { definition contains the informations about a type }
  201. tdeftype = (abstractdef,arraydef,recorddef,pointerdef,orddef,
  202. stringdef,enumdef,procdef,objectdef,errordef,
  203. filedef,formaldef,setdef,procvardef,floatdef,
  204. classrefdef,forwarddef);
  205. { possible types for symtable entries }
  206. tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,
  207. constsym,enumsym,typedconstsym,errorsym,syssym,
  208. labelsym,absolutesym,propertysym,funcretsym,
  209. macrosym);
  210. { State of the variable, if it's declared, assigned or used }
  211. tvarstate=(vs_none,
  212. vs_declared,vs_declared_and_first_found,
  213. vs_set_but_first_not_passed,vs_assigned,vs_used
  214. );
  215. absolutetyp = (tovar,toasm,toaddr);
  216. tconsttyp = (constnone,
  217. constord,conststring,constreal,constbool,
  218. constint,constchar,constset,constpointer,constnil,
  219. constresourcestring
  220. );
  221. {$ifdef GDB}
  222. tdefstabstatus = (
  223. not_written,
  224. being_written,
  225. written);
  226. {$endif GDB}
  227. const
  228. { relevant options for assigning a proc or a procvar to a procvar }
  229. po_compatibility_options = [
  230. po_classmethod,
  231. po_staticmethod,
  232. po_methodpointer,
  233. po_containsself,
  234. po_interrupt,
  235. po_iocheck,
  236. po_exports
  237. ];
  238. const
  239. SymTypeName : array[tsymtyp] of string[12] =
  240. ('abstractsym','variable','type','proc','unit',
  241. 'const','enum','typed const','errorsym','system sym',
  242. 'label','absolute','property','funcret',
  243. 'macrosym');
  244. implementation
  245. end.
  246. {
  247. $Log$
  248. Revision 1.9 2000-10-15 07:47:52 peter
  249. * unit names and procedure names are stored mixed case
  250. Revision 1.8 2000/10/14 10:14:52 peter
  251. * moehrendorf oct 2000 rewrite
  252. Revision 1.7 2000/09/24 15:06:28 peter
  253. * use defines.inc
  254. Revision 1.6 2000/08/21 11:27:44 pierre
  255. * fix the stabs problems
  256. Revision 1.5 2000/08/06 19:39:28 peter
  257. * default parameters working !
  258. Revision 1.4 2000/08/05 13:25:06 peter
  259. * packenum 1 fixes (merged)
  260. Revision 1.3 2000/07/13 12:08:27 michael
  261. + patched to 1.1.0 with former 1.09patch from peter
  262. Revision 1.2 2000/07/13 11:32:49 michael
  263. + removed logs
  264. }