symconst.pas 9.1 KB

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