symconst.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. Symbol table constants
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit symconst;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. globtype;
  22. const
  23. def_alignment = 4;
  24. C_alignment = -1;
  25. bit_alignment = -2;
  26. mac68k_alignment = -3;
  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. tkDynArray = 21;
  53. tkInterfaceCorba = 22;
  54. tkProcVar = 23;
  55. tkUString = 24;
  56. tkUChar = 25;
  57. tkHelper = 26;
  58. tkFile = 27;
  59. tkClassRef = 28;
  60. tkPointer = 29;
  61. otSByte = 0;
  62. otUByte = 1;
  63. otSWord = 2;
  64. otUWord = 3;
  65. otSLong = 4;
  66. otULong = 5;
  67. otSLongLong = 6;
  68. otULongLong = 7;
  69. ftSingle = 0;
  70. ftDouble = 1;
  71. ftExtended = 2;
  72. ftComp = 3;
  73. ftCurr = 4;
  74. ftFloat128 = 5;
  75. mkProcedure = 0;
  76. mkFunction = 1;
  77. mkConstructor = 2;
  78. mkDestructor = 3;
  79. mkClassProcedure = 4;
  80. mkClassFunction = 5;
  81. mkClassConstructor = 6;
  82. mkClassDestructor = 7;
  83. mkOperatorOverload = 8;
  84. // delphi has the next too:
  85. //mkSafeProcedure = 9;
  86. //mkSafeFunction = 10;
  87. pfvar = 1;
  88. pfConst = 2;
  89. pfArray = 4;
  90. pfAddress = 8;
  91. pfReference= 16;
  92. pfOut = 32;
  93. pfConstRef = 64;
  94. unknown_level = 0;
  95. main_program_level = 1;
  96. normal_function_level = 2;
  97. { implicit parameter positions, normal parameters start at 10
  98. and will increase with 10 for each parameter. The high parameters
  99. will be inserted with n+1 }
  100. paranr_blockselfpara = 1;
  101. paranr_parentfp = 2;
  102. paranr_parentfp_delphi_cc_leftright = 2;
  103. paranr_self = 3;
  104. paranr_result = 4;
  105. paranr_vmt = 5;
  106. { the implicit parameters for Objective-C methods need to come
  107. after the hidden result parameter }
  108. paranr_objc_self = 5;
  109. paranr_objc_cmd = 6;
  110. { Required to support variations of syscalls on MorphOS }
  111. paranr_syscall_basesysv = 9;
  112. paranr_syscall_sysvbase = high(word)-5;
  113. paranr_syscall_r12base = high(word)-4;
  114. paranr_syscall_legacy = high(word)-3;
  115. paranr_result_leftright = high(word)-2;
  116. paranr_parentfp_delphi_cc = high(word)-1;
  117. { prefix for names of class helper procsyms added to regular symtables }
  118. class_helper_prefix = 'CH$';
  119. type
  120. { keep this in sync with TIntfFlag in rtl/objpas/typinfo.pp }
  121. TCompilerIntfFlag = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
  122. { Deref entry options }
  123. tdereftype = (deref_nil,
  124. deref_unit,
  125. deref_symid,
  126. deref_defid
  127. );
  128. { symbol visibility }
  129. tvisibility=(
  130. vis_hidden,
  131. vis_strictprivate,
  132. vis_private,
  133. vis_strictprotected,
  134. vis_protected,
  135. vis_public,
  136. vis_published,
  137. vis_none
  138. );
  139. { symbol options }
  140. tsymoption=(sp_none,
  141. sp_static, { static symbol in class/object/record }
  142. sp_hint_deprecated,
  143. sp_hint_platform,
  144. sp_hint_library,
  145. sp_hint_unimplemented,
  146. sp_has_overloaded,
  147. sp_internal, { internal symbol, not reported as unused }
  148. sp_implicitrename,
  149. sp_hint_experimental,
  150. sp_generic_para,
  151. sp_has_deprecated_msg,
  152. sp_generic_dummy, { this is used for symbols that are generated when a
  153. generic is encountered to ease inline
  154. specializations, etc; those symbols can be
  155. "overridden" with a completely different symbol }
  156. sp_explicitrename { this is used to keep track of type renames created
  157. by the user }
  158. );
  159. tsymoptions=set of tsymoption;
  160. { flags for a definition }
  161. tdefoption=(df_none,
  162. { type is unique, i.e. declared with type = type <tdef>; }
  163. df_unique,
  164. { type is a generic }
  165. df_generic,
  166. { type is a specialization of a generic type }
  167. df_specialization,
  168. { def has been copied from another def so symtable is not owned }
  169. df_copied_def,
  170. { def was created as a generic constraint and thus is only "shallow" }
  171. df_genconstraint
  172. );
  173. tdefoptions=set of tdefoption;
  174. tdefstate=(ds_none,
  175. ds_vmt_written,
  176. ds_rtti_table_used,
  177. ds_init_table_used,
  178. ds_rtti_table_written,
  179. ds_init_table_written,
  180. ds_dwarf_dbg_info_used,
  181. ds_dwarf_dbg_info_written
  182. );
  183. tdefstates=set of tdefstate;
  184. { flags for generic type constraints }
  185. tgenericconstraintflag=(gcf_none,
  186. gcf_constructor, { specialization type needs to have a constructor }
  187. gcf_class, { specialization type needs to be a class }
  188. gcf_record { specialization type needs to be a record type }
  189. );
  190. tgenericconstraintflags=set of tgenericconstraintflag;
  191. { tsymlist entry types }
  192. tsltype = (sl_none,
  193. sl_load,
  194. sl_call,
  195. sl_subscript,
  196. sl_vec,
  197. sl_typeconv,
  198. sl_absolutetype
  199. );
  200. { base types for orddef }
  201. tordtype = (
  202. uvoid,
  203. u8bit,u16bit,u32bit,u64bit,
  204. s8bit,s16bit,s32bit,s64bit,
  205. pasbool8,pasbool16,pasbool32,pasbool64,
  206. bool8bit,bool16bit,bool32bit,bool64bit,
  207. uchar,uwidechar,scurrency
  208. );
  209. { string types }
  210. tstringtype = (
  211. st_shortstring,
  212. st_longstring,
  213. st_ansistring,
  214. st_widestring,
  215. st_unicodestring
  216. );
  217. tvarianttype = (
  218. vt_normalvariant,vt_olevariant
  219. );
  220. tcallercallee = (callnoside,callerside,calleeside,callbothsides);
  221. { basic type for tprocdef and tprocvardef }
  222. tproctypeoption=(potype_none,
  223. potype_proginit, { Program initialization }
  224. potype_unitinit, { unit initialization }
  225. potype_unitfinalize, { unit finalization }
  226. potype_constructor, { Procedure is a constructor }
  227. potype_destructor, { Procedure is a destructor }
  228. potype_operator, { Procedure defines an operator }
  229. potype_procedure,
  230. potype_function,
  231. potype_class_constructor, { class constructor }
  232. potype_class_destructor, { class destructor }
  233. potype_propgetter, { Dispinterface property accessors }
  234. potype_propsetter,
  235. potype_exceptfilter { SEH exception filter or termination handler }
  236. );
  237. tproctypeoptions=set of tproctypeoption;
  238. { other options for tprocdef and tprocvardef }
  239. tprocoption=(po_none,
  240. po_classmethod, { class method }
  241. po_virtualmethod, { Procedure is a virtual method }
  242. po_abstractmethod, { Procedure is an abstract method }
  243. po_finalmethod, { Procedure is a final method }
  244. po_staticmethod, { static method }
  245. po_overridingmethod, { method with override directive }
  246. po_methodpointer, { method pointer, only in procvardef, also used for 'with object do' }
  247. po_interrupt, { Procedure is an interrupt handler }
  248. po_iocheck, { IO checking should be done after a call to the procedure }
  249. po_assembler, { Procedure is written in assembler }
  250. po_msgstr, { method for string message handling }
  251. po_msgint, { method for int message handling }
  252. po_exports, { Procedure has export directive (needed for OS/2) }
  253. po_external, { Procedure is external (in other object or lib)}
  254. po_overload, { procedure is declared with overload directive }
  255. po_varargs, { printf like arguments }
  256. po_internconst, { procedure has constant evaluator intern }
  257. { flag that only the address of a method is returned and not a full methodpointer }
  258. po_addressonly,
  259. { procedure is exported }
  260. po_public,
  261. { calling convention is specified explicitly }
  262. po_hascallingconvention,
  263. { reintroduce flag }
  264. po_reintroduce,
  265. { location of parameters is given explicitly as it is necessary for some syscall
  266. conventions like that one of MorphOS }
  267. po_explicitparaloc,
  268. { no stackframe will be generated, used by lowlevel assembler like get_frame }
  269. po_nostackframe,
  270. po_has_mangledname,
  271. po_has_public_name,
  272. po_forward,
  273. po_global,
  274. { The different kind of syscalls on MorphOS }
  275. po_syscall_legacy,
  276. po_syscall_sysv,
  277. po_syscall_basesysv,
  278. po_syscall_sysvbase,
  279. po_syscall_r12base,
  280. { Used to record the fact that a symbol is asociated to this syscall }
  281. po_syscall_has_libsym,
  282. { Procedure can be inlined }
  283. po_inline,
  284. { Procedure is used for internal compiler calls }
  285. po_compilerproc,
  286. { importing }
  287. po_has_importdll,
  288. po_has_importname,
  289. po_kylixlocal,
  290. po_dispid,
  291. { weakly linked (i.e., may or may not exist at run time) }
  292. po_weakexternal,
  293. { Objective-C method }
  294. po_objc,
  295. { enumerator support }
  296. po_enumerator_movenext,
  297. { optional Objective-C protocol method }
  298. po_optional,
  299. { nested procedure that uses Delphi-style calling convention for passing
  300. the frame pointer (pushed on the stack, always the last parameter,
  301. removed by the caller). Required for nested procvar compatibility,
  302. because such procvars can hold both regular and nested procedures
  303. (when calling a regular procedure using the above convention, it will
  304. simply not see the frame pointer parameter, and since the caller cleans
  305. up the stack will also remain balanced) }
  306. po_delphi_nested_cc,
  307. { allows the routine's RawByteString var/out parameters to accept parameters
  308. that do not match exactly (without typeconversion) }
  309. po_rtlproc,
  310. { Non-virtual method of a Java class that has been transformed into a
  311. "virtual; final;" method for JVM-implementation reasons }
  312. po_java_nonvirtual,
  313. { automatically inherited routine from parent class, ignore for resolving
  314. overloads (on the JVM target, constructors are not automatically
  315. inherited, so we explicitly have to add the constructors of the parent
  316. class to the child class; this influences the overload resolution logic
  317. though, so ignore them there) }
  318. po_ignore_for_overload_resolution,
  319. { the visibility of of this procdef was raised automatically by the
  320. compiler, e.g. because it was designated as a getter/setter for a property
  321. with a higher visibility on the JVM target }
  322. po_auto_raised_visibility,
  323. { procedure is far (x86 only) }
  324. po_far,
  325. { the procedure never returns, this information is usefull for dfa }
  326. po_noreturn,
  327. { procvar is a function reference }
  328. po_is_function_ref,
  329. { procvar is a block (http://en.wikipedia.org/wiki/Blocks_(C_language_extension) ) }
  330. po_is_block
  331. );
  332. tprocoptions=set of tprocoption;
  333. { options that should not trigger the recompilation of a unit if they change
  334. between the interface and the implementation }
  335. timplprocoption = (
  336. { the routine contains no code }
  337. pio_empty,
  338. { the inline body of this routine is available }
  339. pio_has_inlininginfo
  340. );
  341. timplprocoptions = set of timplprocoption;
  342. { kinds of synthetic procdefs that can be generated }
  343. tsynthetickind = (
  344. tsk_none,
  345. tsk_anon_inherited, // anonymous inherited call
  346. tsk_jvm_clone, // Java-style clone method
  347. tsk_record_deepcopy, // deepcopy for records field by field
  348. tsk_record_initialize, // initialize for records field by field (explicit rather than via rtti)
  349. tsk_empty, // an empty routine
  350. tsk_tcinit, // initialisation of typed constants
  351. tsk_callthrough, // call through to another routine with the same parameters/return type (its def is stored in the skpara field)
  352. tsk_callthrough_nonabstract,// call through to another routine if the current class not abstract (otherwise do the same as tsk_empty)
  353. tsk_jvm_enum_values, // Java "values" class method of JLEnum descendants
  354. tsk_jvm_enum_valueof, // Java "valueOf" class method of JLEnum descendants
  355. tsk_jvm_enum_classconstr, // Java class constructor for JLEnum descendants
  356. tsk_jvm_enum_jumps_constr, // Java constructor for JLEnum descendants for enums with jumps
  357. tsk_jvm_enum_fpcordinal, // Java FPCOrdinal function that returns the enum's ordinal value from an FPC POV
  358. tsk_jvm_enum_fpcvalueof, // Java FPCValueOf function that returns the enum instance corresponding to an ordinal from an FPC POV
  359. tsk_jvm_enum_long2set, // Java fpcLongToEnumSet function that returns an enumset corresponding to a bit pattern in a jlong
  360. tsk_jvm_enum_bitset2set, // Java fpcBitSetToEnumSet function that returns an enumset corresponding to a BitSet
  361. tsk_jvm_enum_set2Set, // Java fpcEnumSetToEnumSet function that returns an enumset corresponding to another enumset (different enum kind)
  362. tsk_jvm_procvar_invoke, // Java invoke method that calls a wrapped procvar
  363. tsk_jvm_procvar_intconstr, // Java procvar class constructor that accepts an interface instance for easy Java interoperation
  364. tsk_jvm_virtual_clmethod, // Java wrapper for virtual class method
  365. tsk_field_getter, // getter for a field (callthrough property is passed in skpara)
  366. tsk_field_setter, // Setter for a field (callthrough property is passed in skpara)
  367. tsk_block_invoke_procvar // Call a procvar to invoke inside a block
  368. );
  369. { options for objects and classes }
  370. tobjecttyp = (odt_none,
  371. odt_class,
  372. odt_object,
  373. odt_interfacecom,
  374. odt_interfacecom_property,
  375. odt_interfacecom_function,
  376. odt_interfacecorba,
  377. odt_cppclass,
  378. odt_dispinterface,
  379. odt_objcclass,
  380. odt_objcprotocol,
  381. odt_objccategory, { note that these are changed into odt_class afterwards }
  382. odt_helper,
  383. odt_javaclass,
  384. odt_interfacejava
  385. );
  386. { defines the type of the extended "structure"; only used for parsing }
  387. thelpertype=(ht_none,
  388. ht_class,
  389. ht_record,
  390. ht_type
  391. );
  392. { Variations in interfaces implementation }
  393. { Beware, this data is duplicated in the compiler and rtl. }
  394. { Do not change the order of the fields. }
  395. tinterfaceentrytype = (etStandard,
  396. etVirtualMethodResult,
  397. etStaticMethodResult,
  398. etFieldValue,
  399. etVirtualMethodClass,
  400. etStaticMethodClass,
  401. etFieldValueClass
  402. );
  403. { options for objects and classes }
  404. tobjectoption=(oo_none,
  405. oo_is_forward, { the class is only a forward declared yet }
  406. oo_is_abstract, { the class is abstract - only descendants can be used }
  407. oo_is_sealed, { the class is sealed - can't have descendants }
  408. oo_has_virtual, { the object/class has virtual methods }
  409. oo_has_private,
  410. oo_has_protected,
  411. oo_has_strictprivate,
  412. oo_has_strictprotected,
  413. oo_has_constructor, { the object/class has a constructor }
  414. oo_has_destructor, { the object/class has a destructor }
  415. oo_has_vmt, { the object/class has a vmt }
  416. oo_has_msgstr,
  417. oo_has_msgint,
  418. oo_can_have_published,{ the class has rtti, i.e. you can publish properties }
  419. oo_has_default_property,
  420. oo_has_valid_guid,
  421. oo_has_enumerator_movenext,
  422. oo_has_enumerator_current,
  423. oo_is_external, { the class is externally implemented (objcclass, cppclass) }
  424. oo_is_formal, { the class is only formally defined in this module (x = objcclass; external [name 'x'];) }
  425. oo_is_classhelper, { objcclasses that represent categories, and Delpi-style class helpers, are marked like this }
  426. oo_has_class_constructor, { the object/class has a class constructor }
  427. oo_has_class_destructor, { the object/class has a class destructor }
  428. oo_is_enum_class, { the class represents an enum (JVM) }
  429. oo_has_new_destructor { the object/class declares a destructor (apart from potentially inherting one from the parent) }
  430. );
  431. tobjectoptions=set of tobjectoption;
  432. tarraydefoption=(
  433. ado_IsConvertedPointer, // array created from pointer (e.g. PInteger(Ptr)[1])
  434. ado_IsDynamicArray, // dynamic array
  435. ado_IsVariant, //
  436. ado_IsConstructor, // array constructor (e.g. something = [1,2,3])
  437. ado_IsArrayOfConst, // array of const
  438. ado_IsConstString, // string constant
  439. ado_IsBitPacked // bitpacked array
  440. );
  441. tarraydefoptions=set of tarraydefoption;
  442. { options for properties }
  443. tpropertyoption=(ppo_none,
  444. ppo_indexed, { delcared wwith "index" keyword }
  445. ppo_defaultproperty,
  446. ppo_stored,
  447. ppo_hasparameters, { has parameters: prop[param1, param2: type] }
  448. ppo_implements,
  449. ppo_enumerator_current, { implements current property for enumerator }
  450. ppo_overrides, { overrides ancestor property }
  451. ppo_dispid_write { no longer used }
  452. );
  453. tpropertyoptions=set of tpropertyoption;
  454. { options for variables }
  455. tvaroption=(vo_none,
  456. vo_is_external,
  457. vo_is_dll_var,
  458. vo_is_thread_var,
  459. vo_has_local_copy,
  460. vo_is_const, { variable is declared as const (parameter) and can't be written to }
  461. vo_is_public,
  462. vo_is_high_para,
  463. vo_is_funcret,
  464. vo_is_self,
  465. vo_is_vmt,
  466. vo_is_result, { special result variable }
  467. vo_is_parentfp,
  468. vo_is_loop_counter, { used to detect assignments to loop counter }
  469. vo_is_hidden_para,
  470. vo_has_explicit_paraloc,
  471. vo_is_syscall_lib,
  472. vo_has_mangledname,
  473. vo_is_typed_const,
  474. vo_is_range_check,
  475. vo_is_overflow_check,
  476. vo_is_typinfo_para,
  477. vo_is_weak_external,
  478. { Objective-C message selector parameter }
  479. vo_is_msgsel,
  480. { first field of variant part of a record }
  481. vo_is_first_field,
  482. vo_volatile,
  483. vo_has_section,
  484. { variable contains a winlike WideString which should be finalized
  485. even in $J- state }
  486. vo_force_finalize,
  487. { this is an internal variable that is used for Default() intrinsic in code
  488. sections }
  489. vo_is_default_var
  490. );
  491. tvaroptions=set of tvaroption;
  492. { register variable }
  493. tvarregable=(vr_none,
  494. vr_intreg,
  495. vr_fpureg,
  496. vr_mmreg,
  497. { does not mean "needs address register", but "if it's a parameter which is }
  498. { passed by reference, then its address can be put in a register }
  499. vr_addr
  500. );
  501. { types of the symtables }
  502. TSymtabletype = (
  503. abstractsymtable, { not a real symtable }
  504. globalsymtable, { unit interface symtable }
  505. staticsymtable, { unit implementation symtable }
  506. ObjectSymtable, { object symtable }
  507. recordsymtable, { record symtable }
  508. localsymtable, { subroutine symtable }
  509. parasymtable, { arguments symtable }
  510. withsymtable, { with operator symtable }
  511. stt_excepTSymtable, { try/except symtable }
  512. exportedmacrosymtable, { }
  513. localmacrosymtable, { }
  514. enumsymtable, { symtable for enum members }
  515. arraysymtable { used to store parameterised type
  516. in array }
  517. );
  518. { options for symtables }
  519. tsymtableoption = (
  520. sto_has_helper, { contains at least one helper symbol }
  521. sto_has_generic, { contains at least one generic symbol }
  522. sto_has_operator, { contains at least one operator overload }
  523. sto_needs_init_final { the symtable needs initialization and/or
  524. finalization of variables/constants }
  525. );
  526. tsymtableoptions = set of tsymtableoption;
  527. { definition contains the informations about a type }
  528. tdeftyp = (abstractdef,
  529. arraydef,recorddef,pointerdef,orddef,
  530. stringdef,enumdef,procdef,objectdef,errordef,
  531. filedef,formaldef,setdef,procvardef,floatdef,
  532. classrefdef,forwarddef,variantdef,undefineddef
  533. );
  534. { possible types for symtable entries }
  535. tsymtyp = (abstractsym,
  536. staticvarsym,localvarsym,paravarsym,fieldvarsym,
  537. typesym,procsym,unitsym,constsym,enumsym,
  538. errorsym,syssym,labelsym,absolutevarsym,propertysym,
  539. macrosym,namespacesym,undefinedsym
  540. );
  541. { State of the variable:
  542. vs_declared: variable has been declared, not initialised
  543. (e.g. normal variable, out parameter)
  544. vs_initialised: variable has been declared and is valid
  545. (e.g. typed constant, var/const parameter)
  546. vs_read: variable has been read and the read was checked for validity
  547. (so a warning has been given if necessary)
  548. vs_read_not_warned: variable has been read, but we didn't warn about
  549. whether or not the variable was valid
  550. (e.g. read of global variable -> warn at end of compilation unit if
  551. the state is vs_read_not_warned, since that means it's only read and
  552. never written)
  553. vs_referred_not_inited: variable has been used in length/low/high/@/...
  554. expression, was not yet initialised and needn't be at that time
  555. (e.g. length() of a statically allocated array, or sizeof(variable))
  556. vs_written: variable has been assigned/written to, but not yet read
  557. (e.g. assigning something to a variable/parameter)
  558. vs_readwritten: variable has been written to and read from }
  559. tvarstate=(vs_none,
  560. vs_declared,vs_initialised,vs_read,vs_read_not_warned,
  561. vs_referred_not_inited,vs_written,vs_readwritten
  562. );
  563. tvarspez = (vs_value,vs_const,vs_var,vs_out,vs_constref,vs_final);
  564. absolutetyp = (tovar,toasm,toaddr);
  565. tconsttyp = (constnone,
  566. constord,conststring,constreal,
  567. constset,constpointer,constnil,
  568. constresourcestring,constwstring,constguid
  569. );
  570. { RTTI information to store }
  571. trttitype = (
  572. fullrtti,initrtti,
  573. { Objective-C }
  574. objcmetartti,objcmetarortti,
  575. objcclassrtti,objcclassrortti
  576. );
  577. { The order is from low priority to high priority,
  578. Note: the operators > and < are used on this list }
  579. tequaltype = (
  580. te_incompatible,
  581. te_convert_operator,
  582. te_convert_l6,
  583. te_convert_l5, { ad infinitum... }
  584. te_convert_l4, { and yet even less preferred conversion }
  585. te_convert_l3, { even less preferred conversion (possibly with loss of data) }
  586. te_convert_l2, { compatible less preferred conversion }
  587. te_convert_l1, { compatible conversion }
  588. te_equal, { the definitions are equal }
  589. te_exact
  590. );
  591. tvariantequaltype = (
  592. tve_incompatible,
  593. tve_chari64,
  594. tve_sstring,
  595. tve_astring,
  596. tve_wstring,
  597. tve_ustring,
  598. tve_boolformal,
  599. tve_extended,
  600. tve_dblcurrency,
  601. tve_single,
  602. tve_cardinal,
  603. tve_longint,
  604. tve_smallint,
  605. tve_word,
  606. tve_shortint,
  607. tve_byte
  608. );
  609. tvariantequaltypes = set of tvariantequaltype;
  610. tdefdbgstatus = (
  611. dbg_state_unused,
  612. dbg_state_used,
  613. dbg_state_writing,
  614. dbg_state_written,
  615. dbg_state_queued
  616. );
  617. tx86pointertyp = (x86pt_near, x86pt_near_cs, x86pt_near_ds, x86pt_near_ss,
  618. x86pt_near_es, x86pt_near_fs, x86pt_near_gs, x86pt_far, x86pt_huge);
  619. var
  620. clearstack_pocalls : tproccalloptions;
  621. cdecl_pocalls : tproccalloptions;
  622. const
  623. {$ifndef jvm}
  624. inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has_protected,
  625. oo_has_strictprotected,oo_has_strictprivate,oo_has_constructor,oo_has_destructor,
  626. oo_can_have_published];
  627. {$else not jvm}
  628. { constructors are not inherited in Java }
  629. inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has_protected,
  630. oo_has_strictprotected,oo_has_strictprivate,oo_has_destructor,
  631. oo_can_have_published];
  632. {$endif not jvm}
  633. {$ifdef i386}
  634. { we only take this into account on i386, on other platforms we always
  635. push in the same order
  636. }
  637. pushleftright_pocalls : tproccalloptions = [pocall_register,pocall_pascal];
  638. {$endif}
  639. {$ifdef i8086}
  640. { we only take this into account on i386, on other platforms we always
  641. push in the same order
  642. }
  643. pushleftright_pocalls : tproccalloptions = [pocall_register,pocall_pascal];
  644. {$endif}
  645. SymTypeName : array[tsymtyp] of string[12] = (
  646. 'abstractsym','globalvar','localvar','paravar','fieldvar',
  647. 'type','proc','unit','const','enum',
  648. 'errorsym','system sym','label','absolutevar','property',
  649. 'macrosym','namespace','undefinedsym'
  650. );
  651. typName : array[tdeftyp] of string[12] = (
  652. 'abstractdef','arraydef','recorddef','pointerdef','orddef',
  653. 'stringdef','enumdef','procdef','objectdef','errordef',
  654. 'filedef','formaldef','setdef','procvardef','floatdef',
  655. 'classrefdef','forwarddef','variantdef','undefineddef'
  656. );
  657. EqualTypeName : array[tequaltype] of string[16] = (
  658. 'incompatible','convert_operator','convert_l6', 'convert_l5','convert_l4','convert_l3',
  659. 'convert_l2','convert_l1','equal','exact'
  660. );
  661. visibilityName : array[tvisibility] of string[16] = (
  662. 'hidden','strict private','private','strict protected','protected',
  663. 'public','published',''
  664. );
  665. {$ifndef jvm}
  666. default_class_type=odt_class;
  667. {$else not jvm}
  668. default_class_type=odt_javaclass;
  669. {$endif not jvm}
  670. { !! Be sure to keep these in sync with ones in rtl/inc/varianth.inc }
  671. varempty = 0;
  672. varnull = 1;
  673. varsmallint = 2;
  674. varinteger = 3;
  675. varsingle = 4;
  676. vardouble = 5;
  677. varcurrency = 6;
  678. vardate = 7;
  679. varolestr = 8;
  680. vardispatch = 9;
  681. varerror = 10;
  682. varboolean = 11;
  683. varvariant = 12;
  684. varunknown = 13;
  685. vardecimal = 14;
  686. varshortint = 16;
  687. varbyte = 17;
  688. varword = 18;
  689. varlongword = 19;
  690. varint64 = 20;
  691. varqword = 21;
  692. varUndefined = -1;
  693. varstrarg = $48;
  694. varustrarg = $49;
  695. varstring = $100;
  696. varany = $101;
  697. varustring = $102;
  698. vardefmask = $fff;
  699. vararray = $2000;
  700. varbyref = $4000;
  701. { blocks-related constants }
  702. blocks_procvar_invoke_type_name = '__FPC_invoke_pvtype';
  703. implementation
  704. end.