symconst.pas 24 KB

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