~ubuntu-branches/ubuntu/lucid/mtasc/lucid

« back to all changes in this revision

Viewing changes to ocaml/swflib/as3.mli

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2007-05-23 19:17:16 UTC
  • mto: (2.1.1 gutsy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20070523191716-lpvac307yorewp3g
Tags: upstream-1.13
ImportĀ upstreamĀ versionĀ 1.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
 *  This file is part of SwfLib
 
3
 *  Copyright (c)2004-2006 Nicolas Cannasse
 
4
 *
 
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
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *)
 
19
 
 
20
type 'a index
 
21
type 'a index_nz
 
22
 
 
23
type as3_ident = string
 
24
type as3_int = int32
 
25
type as3_float = float
 
26
 
 
27
type reg = int
 
28
type nargs = int
 
29
 
 
30
type as3_jump =
 
31
        | J3NotLt
 
32
        | J3NotLte
 
33
        | J3NotGt
 
34
        | J3NotGte
 
35
        | J3Always
 
36
        | J3True
 
37
        | J3False
 
38
        | J3Eq
 
39
        | J3Neq
 
40
        | J3Lt
 
41
        | J3Lte
 
42
        | J3Gt
 
43
        | J3Gte
 
44
        | J3PhysEq
 
45
        | J3PhysNeq
 
46
 
 
47
type as3_op =
 
48
        | A3OAs
 
49
        | A3ONeg
 
50
        | A3OIncr
 
51
        | A3ODecr
 
52
        | A3ONot
 
53
        | A3OBitNot
 
54
        | A3OAdd
 
55
        | A3OSub
 
56
        | A3OMul
 
57
        | A3ODiv
 
58
        | A3OMod
 
59
        | A3OShl
 
60
        | A3OShr
 
61
        | A3OUShr
 
62
        | A3OAnd
 
63
        | A3OOr
 
64
        | A3OXor
 
65
        | A3OEq
 
66
        | A3OPhysEq
 
67
        | A3OLt
 
68
        | A3OLte
 
69
        | A3OGt
 
70
        | A3OGte
 
71
        | A3OIs
 
72
        | A3OIn
 
73
        | A3OIIncr
 
74
        | A3OIDecr
 
75
 
 
76
type type_index = as3_type index
 
77
 
 
78
and as3_opcode =
 
79
        | A3Throw
 
80
        | A3GetSuper of type_index
 
81
        | A3SetSuper of type_index
 
82
        | A3RegReset of reg
 
83
        | A3Nop
 
84
        | A3Jump of as3_jump * int
 
85
        | A3Switch of int * int list * int
 
86
        | A3PopScope
 
87
        | A3XmlOp3
 
88
        | A3ForIn
 
89
        | A3Null
 
90
        | A3Undefined
 
91
        | A3ForEach
 
92
        | A3SmallInt of int
 
93
        | A3Int of int
 
94
        | A3True
 
95
        | A3False
 
96
        | A3NaN
 
97
        | A3Pop
 
98
        | A3Dup
 
99
        | A3CatchDone
 
100
        | A3String of as3_ident index
 
101
        | A3IntRef of as3_int index
 
102
        | A3Float of as3_float index
 
103
        | A3Scope
 
104
        | A3Next of reg * reg
 
105
        | A3Function of as3_method_type index_nz
 
106
        | A3StackCall of nargs
 
107
        | A3StackNew of nargs
 
108
        | A3SuperCall of type_index * nargs
 
109
        | A3Call of type_index * nargs
 
110
        | A3RetVoid
 
111
        | A3Ret
 
112
        | A3SuperConstr of nargs
 
113
        | A3New of type_index * nargs
 
114
        | A3SuperCallUnknown of type_index * nargs
 
115
        | A3CallUnknown of type_index * nargs
 
116
        | A3Object of nargs
 
117
        | A3Array of nargs
 
118
        | A3NewBlock
 
119
        | A3ClassDef of int
 
120
        | A3XmlOp1 of type_index
 
121
        | A3Catch of int
 
122
        | A3GetInf of type_index
 
123
        | A3SetInf of type_index
 
124
        | A3GetProp of type_index
 
125
        | A3SetProp of type_index
 
126
        | A3Reg of reg
 
127
        | A3SetReg of reg
 
128
        | A3GetScope0
 
129
        | A3GetScope of int
 
130
        | A3Get of type_index
 
131
        | A3Set of type_index
 
132
        | A3Delete of type_index
 
133
        | A3GetSlot of int
 
134
        | A3SetSlot of int
 
135
        | A3ToXml
 
136
        | A3ToInt
 
137
        | A3ToUInt
 
138
        | A3ToNumber
 
139
        | A3ToBool
 
140
        | A3XmlOp2
 
141
        | A3Cast of type_index
 
142
        | A3ToObject
 
143
        | A3ToString
 
144
        | A3Typeof
 
145
        | A3InstanceOf
 
146
        | A3IncrReg of reg
 
147
        | A3This
 
148
        | A3DebugReg of int * int * int * int
 
149
        | A3DebugLine of int
 
150
        | A3DebugFile of as3_ident index
 
151
        | A3Op of as3_op
 
152
        | A3Unk of char
 
153
 
 
154
and as3_base_right =
 
155
        | A3RPrivate of as3_ident index option
 
156
        | A3RPublic of as3_ident index option
 
157
        | A3RInternal of as3_ident index option
 
158
        | A3RProtected of as3_ident index
 
159
        | A3RUnknown1 of as3_ident index
 
160
        | A3RUnknown2 of as3_ident index option
 
161
 
 
162
and as3_rights = as3_base_right index list
 
163
 
 
164
and as3_type =
 
165
        | A3TClassInterface of as3_ident index option * as3_rights index
 
166
        | A3TMethodVar of as3_ident index * as3_base_right index
 
167
        | A3TArrayAccess of as3_rights index
 
168
        | A3TUnknown1 of int
 
169
        | A3TUnknown2 of int * int
 
170
 
 
171
and as3_value =
 
172
        | A3VNone
 
173
        | A3VNull
 
174
        | A3VBool of bool
 
175
        | A3VString of as3_ident index
 
176
        | A3VInt of as3_int index
 
177
        | A3VFloat of as3_float index
 
178
        | A3VNamespace of as3_base_right index
 
179
 
 
180
and as3_method_type = {
 
181
        mt3_ret : as3_type index option;
 
182
        mt3_args : as3_type index option list;
 
183
        mt3_native : bool;
 
184
        mt3_var_args : bool;
 
185
        mt3_new_block : bool;
 
186
        mt3_debug_name : as3_ident index option;
 
187
        mt3_dparams : as3_value list option;
 
188
        mt3_pnames : as3_ident index list option;
 
189
        mt3_unk_flags : bool * bool * bool;
 
190
}
 
191
 
 
192
type as3_method_kind =
 
193
        | MK3Normal
 
194
        | MK3Getter
 
195
        | MK3Setter
 
196
 
 
197
type as3_method = {
 
198
        m3_type : as3_method_type index_nz;
 
199
        m3_final : bool;
 
200
        m3_override : bool;
 
201
        m3_kind : as3_method_kind;
 
202
}
 
203
 
 
204
type as3_var = {
 
205
        v3_type : as3_type index option;
 
206
        v3_value : as3_value;
 
207
        v3_const : bool;
 
208
}
 
209
 
 
210
type as3_metadata = {
 
211
        meta3_name : as3_ident index;
 
212
        meta3_data : (as3_ident index option * as3_ident index) array;
 
213
}
 
214
 
 
215
type as3_field_kind =
 
216
        | A3FMethod of as3_method
 
217
        | A3FVar of as3_var
 
218
        | A3FClass of as3_class index_nz
 
219
 
 
220
and as3_field = {
 
221
        f3_name : as3_type index;
 
222
        f3_slot : int;
 
223
        f3_kind : as3_field_kind;
 
224
        f3_metas : as3_metadata index_nz array option;
 
225
}
 
226
 
 
227
and as3_class = {
 
228
        cl3_name : as3_type index;
 
229
        cl3_super : as3_type index option;
 
230
        cl3_sealed : bool;
 
231
        cl3_final : bool;
 
232
        cl3_interface : bool;
 
233
        cl3_rights : as3_base_right index option;
 
234
        cl3_implements : as3_type index array;
 
235
        cl3_construct : as3_method_type index_nz;
 
236
        cl3_fields : as3_field array;
 
237
}
 
238
 
 
239
type as3_static = {
 
240
        st3_method : as3_method_type index_nz;
 
241
        st3_fields : as3_field array;
 
242
}
 
243
 
 
244
type as3_try_catch = {
 
245
        tc3_start : int;
 
246
        tc3_end : int;
 
247
        tc3_handle : int;
 
248
        tc3_type : as3_type index option;
 
249
        tc3_name : as3_type index option;
 
250
}
 
251
 
 
252
type as3_function = {
 
253
        fun3_id : as3_method_type index_nz;
 
254
        fun3_stack_size : int;
 
255
        fun3_nregs : int;
 
256
        fun3_unk3 : int;
 
257
        fun3_max_scope : int;
 
258
        fun3_code : as3_opcode list;
 
259
        fun3_trys : as3_try_catch array;
 
260
        fun3_locals : as3_field array;
 
261
}
 
262
 
 
263
type as3_tag = {
 
264
        as3_ints : as3_int array;
 
265
        (* ??? *)
 
266
        as3_floats : as3_float array;
 
267
        as3_idents : as3_ident array;
 
268
        as3_base_rights : as3_base_right array;
 
269
        as3_rights : as3_rights array;
 
270
        mutable as3_types : as3_type array;
 
271
        mutable as3_method_types : as3_method_type array;
 
272
        mutable as3_metadatas : as3_metadata array;
 
273
        mutable as3_classes : as3_class array;
 
274
        mutable as3_statics : as3_static array;
 
275
        mutable as3_inits : as3_static array;
 
276
        mutable as3_functions : as3_function array;
 
277
        mutable as3_unknown : string;   
 
278
}