123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- (*
- * This file is part of SwfLib
- * Copyright (c)2004-2008 Nicolas Cannasse
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- *)
- open Extlib_leftovers
- open As3
- type hl_ident = string
- type hl_int = int32
- type hl_uint = int32
- type hl_float = float
- type hl_slot = int
- type hl_jump = as3_jump
- type hl_op = as3_op
- type hl_opcode =
- | HBreakPoint
- | HNop
- | HThrow
- | HGetSuper of hl_name
- | HSetSuper of hl_name
- | HDxNs of hl_ident
- | HDxNsLate
- | HRegKill of reg
- | HLabel
- | HJump of hl_jump * int
- | HSwitch of int * int list
- | HPushWith
- | HPopScope
- | HForIn
- | HHasNext
- | HNull
- | HUndefined
- | HForEach
- | HSmallInt of int
- | HInt of int
- | HTrue
- | HFalse
- | HNaN
- | HPop
- | HDup
- | HSwap
- | HString of hl_ident
- | HIntRef of hl_int
- | HUIntRef of hl_uint
- | HFloat of hl_float
- | HScope
- | HNamespace of hl_namespace
- | HNext of reg * reg
- | HFunction of hl_method
- | HCallStack of nargs
- | HConstruct of nargs
- | HCallMethod of hl_slot * nargs
- | HCallStatic of hl_method * nargs
- | HCallSuper of hl_name * nargs
- | HCallProperty of hl_name * nargs
- | HRetVoid
- | HRet
- | HConstructSuper of nargs
- | HConstructProperty of hl_name * nargs
- | HCallPropLex of hl_name * nargs
- | HCallSuperVoid of hl_name * nargs
- | HCallPropVoid of hl_name * nargs
- | HApplyType of nargs
- | HObject of nargs
- | HArray of nargs
- | HNewBlock
- | HClassDef of hl_class
- | HGetDescendants of hl_name
- | HCatch of int
- | HFindPropStrict of hl_name
- | HFindProp of hl_name
- | HFindDefinition of hl_name
- | HGetLex of hl_name
- | HSetProp of hl_name
- | HReg of reg
- | HSetReg of reg
- | HGetGlobalScope
- | HGetScope of int
- | HGetProp of hl_name
- | HInitProp of hl_name
- | HDeleteProp of hl_name
- | HGetSlot of hl_slot
- | HSetSlot of hl_slot
- | HToString
- | HToXml
- | HToXmlAttr
- | HToInt
- | HToUInt
- | HToNumber
- | HToBool
- | HToObject
- | HCheckIsXml
- | HCast of hl_name
- | HAsAny
- | HAsString
- | HAsType of hl_name
- | HAsObject
- | HIncrReg of reg
- | HDecrReg of reg
- | HTypeof
- | HInstanceOf
- | HIsType of hl_name
- | HIncrIReg of reg
- | HDecrIReg of reg
- | HThis
- | HSetThis
- | HDebugReg of hl_ident * reg * int
- | HDebugLine of int
- | HDebugFile of hl_ident
- | HBreakPointLine of int
- | HTimestamp
- | HOp of hl_op
- | HUnk of char
- and hl_namespace =
- | HNPrivate of hl_ident option
- | HNPublic of hl_ident option
- | HNInternal of hl_ident option
- | HNProtected of hl_ident
- | HNNamespace of hl_ident
- | HNExplicit of hl_ident
- | HNStaticProtected of hl_ident option
- and hl_ns_set = hl_namespace list
- and hl_name =
- | HMPath of hl_ident list * hl_ident
- | HMName of hl_ident * hl_namespace
- | HMMultiName of hl_ident option * hl_ns_set
- | HMRuntimeName of hl_ident
- | HMRuntimeNameLate
- | HMMultiNameLate of hl_ns_set
- | HMAttrib of hl_name
- | HMParams of hl_name * hl_name list
- | HMNSAny of hl_ident
- | HMAny
- and hl_value =
- | HVNone
- | HVNull
- | HVBool of bool
- | HVString of hl_ident
- | HVInt of hl_int
- | HVUInt of hl_uint
- | HVFloat of hl_float
- | HVNamespace of int * hl_namespace
- and hl_method = {
- hlmt_index : int; (* used to sort methods (preserve order) *)
- hlmt_ret : hl_name option;
- hlmt_args : hl_name option list;
- hlmt_native : bool;
- hlmt_var_args : bool;
- hlmt_arguments_defined : bool;
- hlmt_uses_dxns : bool;
- hlmt_new_block : bool;
- hlmt_unused_flag : bool;
- hlmt_debug_name : hl_ident option;
- hlmt_dparams : hl_value list option;
- hlmt_pnames : hl_ident option list option;
- mutable hlmt_function : hl_function option; (* None for interfaces constructors only *)
- }
- and hl_try_catch = {
- hltc_start : int;
- hltc_end : int;
- hltc_handle : int;
- hltc_type : hl_name option;
- hltc_name : hl_name option;
- }
- and hl_function = {
- hlf_stack_size : int;
- hlf_nregs : int;
- hlf_init_scope : int;
- hlf_max_scope : int;
- mutable hlf_code : hl_opcode MultiArray.t;
- mutable hlf_trys : hl_try_catch array;
- hlf_locals : (hl_name * hl_name option * hl_slot * bool) array; (* bool = const - mostly false *)
- }
- and hl_method_kind = as3_method_kind
- and hl_method_field = {
- hlm_type : hl_method;
- hlm_final : bool;
- hlm_override : bool;
- hlm_kind : hl_method_kind;
- }
- and hl_var_field = {
- hlv_type : hl_name option;
- hlv_value : hl_value;
- hlv_const : bool;
- }
- and hl_metadata = {
- hlmeta_name : hl_ident;
- hlmeta_data : (hl_ident option * hl_ident) array;
- }
- and hl_field_kind =
- | HFMethod of hl_method_field
- | HFVar of hl_var_field
- | HFFunction of hl_method
- | HFClass of hl_class (* only for hl_static fields *)
- and hl_field = {
- hlf_name : hl_name;
- hlf_slot : hl_slot;
- hlf_kind : hl_field_kind;
- hlf_metas : hl_metadata array option;
- }
- and hl_class = {
- hlc_index : int;
- hlc_name : hl_name;
- hlc_super : hl_name option;
- hlc_sealed : bool;
- hlc_final : bool;
- hlc_interface : bool;
- hlc_namespace : hl_namespace option;
- hlc_implements : hl_name array;
- mutable hlc_construct : hl_method;
- mutable hlc_fields : hl_field array;
- mutable hlc_static_construct : hl_method;
- mutable hlc_static_fields : hl_field array;
- }
- and hl_static = {
- hls_method : hl_method;
- hls_fields : hl_field array;
- }
- and hl_tag = hl_static list
|