3 Routines for handling Flash2 AVM2 ABC Actionscript (header file)
5 Extension module for the rfxswf library.
6 Part of the swftools package.
8 Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
32 DECLARE(abc_method_body);
33 DECLARE(abc_interface);
36 DECLARE_LIST(exception);
44 #define METHOD_NEED_ARGUMENTS 1
45 #define METHOD_NEED_ACTIVATION 2
46 #define METHOD_NEED_REST 4
47 #define METHOD_HAS_OPTIONAL 8
48 #define METHOD_SET_DXNS 0x40
49 #define METHOD_HAS_PARAM_NAMES 0x80
52 multiname_t*return_type;
53 multiname_list_t*parameters;
54 constant_list_t*optional_parameters;
57 abc_method_body_t*body;
59 int index; //filled in during writing
62 #define ABCFILE_LAZY 1
72 array_t*method_bodies;
75 abc_file_t*abc_file_new();
78 #define TRAIT_METHOD 1
79 #define TRAIT_GETTER 2
80 #define TRAIT_SETTER 3
82 #define TRAIT_FUNCTION 5
88 unsigned char attributes;
99 multiname_t*type_name;
108 multiname_t*classname;
109 multiname_t*superclass;
110 namespace_t*protectedNS;
112 multiname_list_t*interfaces;
114 abc_method_t*constructor;
117 abc_method_t*static_constructor;
119 trait_list_t*static_constructor_traits;
122 int init_scope_depth; // volatile, might be increased during code verification
124 int index; //filled in during writing
127 abc_class_t* abc_class_new(abc_file_t*file, multiname_t*classname, multiname_t*superclass);
128 abc_class_t* abc_class_new2(abc_file_t*file, char*classname, char*superclass);
129 void abc_class_sealed(abc_class_t*c);
130 void abc_class_final(abc_class_t*c);
131 void abc_class_interface(abc_class_t*c);
132 void abc_class_protectedNS(abc_class_t*c, char*namespace);
133 void abc_class_add_interface(abc_class_t*c, multiname_t*interface);
135 abc_method_body_t* abc_class_staticconstructor(abc_class_t*cls, multiname_t*returntype, int num_params, ...);
136 abc_method_body_t* abc_class_constructor(abc_class_t*cls, multiname_t*returntype, int num_params, ...);
137 abc_method_body_t* abc_class_method(abc_class_t*cls, multiname_t*returntype, char*name, int num_params, ...);
143 multiname_t*exc_type;
144 multiname_t*var_name;
147 struct _abc_method_body {
154 //for dumping: filled in during parsing
158 int init_scope_depth;
161 int init_scope_depth; // volatile, might be increased during code verification
163 exception_list_t* exceptions;
167 int index; // filled in during writing
168 codestats_t*stats; //filled in during writing
171 typedef struct _abc_script {
177 abc_method_t* abc_nullmethod(abc_file_t*file);
178 abc_script_t* abc_initscript(abc_file_t*file, multiname_t*returntype, int num_params, ...);