line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more |
2
|
|
|
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with |
3
|
|
|
|
|
|
|
# this work for additional information regarding copyright ownership. |
4
|
|
|
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0 |
5
|
|
|
|
|
|
|
# (the "License"); you may not use this file except in compliance with |
6
|
|
|
|
|
|
|
# the License. You may obtain a copy of the License at |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
11
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
12
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
14
|
|
|
|
|
|
|
# limitations under the License. |
15
|
|
|
|
|
|
|
|
16
|
43
|
|
|
43
|
|
58878
|
use strict; |
|
43
|
|
|
|
|
77
|
|
|
43
|
|
|
|
|
1459
|
|
17
|
43
|
|
|
43
|
|
220
|
use warnings; |
|
43
|
|
|
|
|
63
|
|
|
43
|
|
|
|
|
5762
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package Clownfish::CFC; |
20
|
|
|
|
|
|
|
our $VERSION = '0.006000005'; |
21
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
22
|
|
|
|
|
|
|
our $MAJOR_VERSION = 0.006000; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
END { |
25
|
43
|
|
|
43
|
|
150571
|
Clownfish::CFC::Model::Class->_clear_registry(); |
26
|
43
|
|
|
|
|
373
|
Clownfish::CFC::Model::Parcel->reap_singletons(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
43
|
|
|
43
|
|
256
|
use XSLoader; |
|
43
|
|
|
|
|
83
|
|
|
43
|
|
|
|
|
1482
|
|
30
|
43
|
|
|
43
|
|
101927
|
BEGIN { XSLoader::load( 'Clownfish::CFC', '0.6.0.5' ) } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
package Clownfish::CFC::Util; |
34
|
43
|
|
|
43
|
|
317
|
use base qw( Exporter ); |
|
43
|
|
|
|
|
67
|
|
|
43
|
|
|
|
|
5545
|
|
35
|
43
|
|
|
43
|
|
267
|
use Scalar::Util qw( blessed ); |
|
43
|
|
|
|
|
63
|
|
|
43
|
|
|
|
|
4876
|
|
36
|
43
|
|
|
43
|
|
257
|
use Carp; |
|
43
|
|
|
|
|
124
|
|
|
43
|
|
|
|
|
3005
|
|
37
|
43
|
|
|
43
|
|
267
|
use Fcntl; |
|
43
|
|
|
|
|
77
|
|
|
43
|
|
|
|
|
13607
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
BEGIN { |
40
|
43
|
|
|
43
|
|
11763
|
our @EXPORT_OK = qw( |
41
|
|
|
|
|
|
|
slurp_text |
42
|
|
|
|
|
|
|
current |
43
|
|
|
|
|
|
|
strip_c_comments |
44
|
|
|
|
|
|
|
verify_args |
45
|
|
|
|
|
|
|
a_isa_b |
46
|
|
|
|
|
|
|
write_if_changed |
47
|
|
|
|
|
|
|
trim_whitespace |
48
|
|
|
|
|
|
|
is_dir |
49
|
|
|
|
|
|
|
make_dir |
50
|
|
|
|
|
|
|
make_path |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Verify that named parameters exist in a defaults hash. Returns false |
55
|
|
|
|
|
|
|
# and sets $@ if a problem is detected. |
56
|
|
|
|
|
|
|
sub verify_args { |
57
|
156
|
|
|
156
|
0
|
2779
|
my $defaults = shift; # leave the rest of @_ intact |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Verify that args came in pairs. |
60
|
156
|
100
|
|
|
|
506
|
if ( @_ % 2 ) { |
61
|
1
|
|
|
|
|
6
|
my ( $package, $filename, $line ) = caller(1); |
62
|
1
|
|
|
|
|
5
|
$@ |
63
|
|
|
|
|
|
|
= "Parameter error: odd number of args at $filename line $line\n"; |
64
|
1
|
|
|
|
|
5
|
return 0; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# Verify keys, ignore values. |
68
|
155
|
|
|
|
|
449
|
while (@_) { |
69
|
315
|
|
|
|
|
374
|
my ( $var, undef ) = ( shift, shift ); |
70
|
315
|
100
|
|
|
|
915
|
next if exists $defaults->{$var}; |
71
|
5
|
|
|
|
|
43
|
my ( $package, $filename, $line ) = caller(1); |
72
|
5
|
|
|
|
|
27
|
$@ = "Invalid parameter: '$var' at $filename line $line\n"; |
73
|
5
|
|
|
|
|
1040
|
return 0; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
150
|
|
|
|
|
436
|
return 1; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub a_isa_b { |
80
|
8
|
|
|
8
|
0
|
6652
|
my ( $thing, $class ) = @_; |
81
|
8
|
100
|
|
|
|
43
|
return 0 unless blessed($thing); |
82
|
6
|
|
|
|
|
40
|
return $thing->isa($class); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
package Clownfish::CFC::Base; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
{ |
91
|
|
|
|
|
|
|
package Clownfish::CFC::Model::CBlock; |
92
|
43
|
|
|
43
|
|
1461
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
93
|
43
|
|
|
43
|
|
22756
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
74
|
|
|
43
|
|
|
|
|
3275
|
|
94
|
43
|
|
|
43
|
|
246
|
use Carp; |
|
43
|
|
|
|
|
65
|
|
|
43
|
|
|
|
|
8747
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
our %new_PARAMS = ( contents => undef, ); |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub new { |
99
|
2
|
|
|
2
|
0
|
823
|
my ( $either, %args ) = @_; |
100
|
2
|
50
|
|
|
|
8
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
101
|
2
|
50
|
|
|
|
9
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
102
|
|
|
|
|
|
|
confess("Missing required param 'contents'") |
103
|
2
|
100
|
|
|
|
208
|
unless defined $args{contents}; |
104
|
1
|
|
|
|
|
13
|
return _new( $args{contents} ); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
{ |
109
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Class; |
110
|
43
|
|
|
43
|
|
1442
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
111
|
43
|
|
|
43
|
|
264
|
use Carp; |
|
43
|
|
|
|
|
57
|
|
|
43
|
|
|
|
|
2781
|
|
112
|
43
|
|
|
43
|
|
231
|
use Config; |
|
43
|
|
|
|
|
274
|
|
|
43
|
|
|
|
|
2329
|
|
113
|
43
|
|
|
|
|
10635
|
use Clownfish::CFC::Util qw( |
114
|
|
|
|
|
|
|
verify_args |
115
|
|
|
|
|
|
|
a_isa_b |
116
|
43
|
|
|
43
|
|
200
|
); |
|
43
|
|
|
|
|
60
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
our %create_PARAMS = ( |
119
|
|
|
|
|
|
|
file_spec => undef, |
120
|
|
|
|
|
|
|
class_name => undef, |
121
|
|
|
|
|
|
|
nickname => undef, |
122
|
|
|
|
|
|
|
parent_class_name => undef, |
123
|
|
|
|
|
|
|
docucomment => undef, |
124
|
|
|
|
|
|
|
inert => undef, |
125
|
|
|
|
|
|
|
final => undef, |
126
|
|
|
|
|
|
|
parcel => undef, |
127
|
|
|
|
|
|
|
abstract => undef, |
128
|
|
|
|
|
|
|
exposure => 'parcel', |
129
|
|
|
|
|
|
|
); |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub new { |
132
|
0
|
|
|
0
|
0
|
0
|
confess( |
133
|
|
|
|
|
|
|
"The constructor for Clownfish::CFC::Model::Class is create()"); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub create { |
137
|
14
|
|
|
14
|
0
|
24955
|
my ( $either, %args ) = @_; |
138
|
14
|
50
|
|
|
|
47
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
139
|
14
|
50
|
|
|
|
47
|
verify_args( \%create_PARAMS, %args ) or confess $@; |
140
|
|
|
|
|
|
|
$args{parcel} |
141
|
14
|
|
|
|
|
49
|
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} ); |
142
|
|
|
|
|
|
|
return _create( |
143
|
|
|
|
|
|
|
@args{ |
144
|
14
|
|
|
|
|
392
|
qw( parcel exposure class_name nickname docucomment |
145
|
|
|
|
|
|
|
file_spec parent_class_name final inert abstract) |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
); |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
{ |
152
|
|
|
|
|
|
|
package Clownfish::CFC::Model::DocuComment; |
153
|
43
|
|
|
43
|
|
2379
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
{ |
157
|
|
|
|
|
|
|
package Clownfish::CFC::Model::File; |
158
|
43
|
|
|
43
|
|
1218
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
159
|
43
|
|
|
43
|
|
260
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
67
|
|
|
43
|
|
|
|
|
2091
|
|
160
|
43
|
|
|
43
|
|
277
|
use Carp; |
|
43
|
|
|
|
|
79
|
|
|
43
|
|
|
|
|
8835
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
our %new_PARAMS = ( |
163
|
|
|
|
|
|
|
parcel => undef, |
164
|
|
|
|
|
|
|
spec => undef, |
165
|
|
|
|
|
|
|
); |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub new { |
168
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
169
|
0
|
0
|
|
|
|
0
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
170
|
0
|
0
|
|
|
|
0
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
171
|
0
|
|
|
|
|
0
|
return _new( @args{ qw( parcel spec ) } ); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
{ |
176
|
|
|
|
|
|
|
package Clownfish::CFC::Model::FileSpec; |
177
|
43
|
|
|
43
|
|
1387
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
178
|
43
|
|
|
43
|
|
242
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
83
|
|
|
43
|
|
|
|
|
2097
|
|
179
|
43
|
|
|
43
|
|
197
|
use Carp; |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
7981
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
our %new_PARAMS = ( |
182
|
|
|
|
|
|
|
source_dir => undef, |
183
|
|
|
|
|
|
|
path_part => undef, |
184
|
|
|
|
|
|
|
ext => undef, |
185
|
|
|
|
|
|
|
is_included => undef, |
186
|
|
|
|
|
|
|
); |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub new { |
189
|
8
|
|
|
8
|
0
|
3693
|
my ( $either, %args ) = @_; |
190
|
8
|
50
|
|
|
|
31
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
191
|
8
|
50
|
|
|
|
42
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
192
|
8
|
|
|
|
|
164
|
return _new( @args{ qw( source_dir path_part ext is_included ) } ); |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
{ |
197
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Function; |
198
|
43
|
|
|
43
|
|
1378
|
BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' } |
199
|
43
|
|
|
43
|
|
243
|
use Carp; |
|
43
|
|
|
|
|
66
|
|
|
43
|
|
|
|
|
2724
|
|
200
|
43
|
|
|
43
|
|
200
|
use Clownfish::CFC::Util qw( verify_args a_isa_b ); |
|
43
|
|
|
|
|
64
|
|
|
43
|
|
|
|
|
8108
|
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
my %new_PARAMS = ( |
203
|
|
|
|
|
|
|
return_type => undef, |
204
|
|
|
|
|
|
|
param_list => undef, |
205
|
|
|
|
|
|
|
name => undef, |
206
|
|
|
|
|
|
|
docucomment => undef, |
207
|
|
|
|
|
|
|
inline => undef, |
208
|
|
|
|
|
|
|
exposure => undef, |
209
|
|
|
|
|
|
|
); |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
sub new { |
212
|
4
|
|
|
4
|
0
|
1503
|
my ( $either, %args ) = @_; |
213
|
4
|
50
|
|
|
|
14
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
214
|
4
|
100
|
|
|
|
15
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
215
|
3
|
|
50
|
|
|
20
|
$args{inline} ||= 0; |
216
|
|
|
|
|
|
|
return _new( |
217
|
|
|
|
|
|
|
@args{ |
218
|
3
|
|
|
|
|
45
|
qw( exposure name return_type param_list docucomment inline ) |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
); |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
{ |
225
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Hierarchy; |
226
|
43
|
|
|
43
|
|
1116
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
227
|
43
|
|
|
43
|
|
233
|
use Carp; |
|
43
|
|
|
|
|
70
|
|
|
43
|
|
|
|
|
2515
|
|
228
|
43
|
|
|
43
|
|
213
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
64
|
|
|
43
|
|
|
|
|
7083
|
|
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
our %new_PARAMS = ( |
231
|
|
|
|
|
|
|
dest => undef, |
232
|
|
|
|
|
|
|
); |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
sub new { |
235
|
2
|
|
|
2
|
0
|
1053
|
my ( $either, %args ) = @_; |
236
|
2
|
50
|
|
|
|
8
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
237
|
2
|
100
|
|
|
|
8
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
238
|
1
|
|
|
|
|
38
|
return _new( @args{qw( dest )} ); |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
{ |
243
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Method; |
244
|
43
|
|
|
43
|
|
1459
|
BEGIN { push our @ISA, 'Clownfish::CFC::Model::Function' } |
245
|
43
|
|
|
43
|
|
231
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
1917
|
|
246
|
43
|
|
|
43
|
|
192
|
use Carp; |
|
43
|
|
|
|
|
74
|
|
|
43
|
|
|
|
|
8941
|
|
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
my %new_PARAMS = ( |
249
|
|
|
|
|
|
|
return_type => undef, |
250
|
|
|
|
|
|
|
param_list => undef, |
251
|
|
|
|
|
|
|
name => undef, |
252
|
|
|
|
|
|
|
docucomment => undef, |
253
|
|
|
|
|
|
|
class_name => undef, |
254
|
|
|
|
|
|
|
abstract => undef, |
255
|
|
|
|
|
|
|
final => undef, |
256
|
|
|
|
|
|
|
exposure => 'parcel', |
257
|
|
|
|
|
|
|
); |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
sub new { |
260
|
23
|
|
|
23
|
0
|
11236
|
my ( $either, %args ) = @_; |
261
|
23
|
100
|
|
|
|
67
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
262
|
22
|
50
|
|
|
|
55
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
263
|
22
|
|
50
|
|
|
84
|
$args{abstract} ||= 0; |
264
|
22
|
|
50
|
|
|
67
|
$args{final} ||= 0; |
265
|
|
|
|
|
|
|
return _new( |
266
|
|
|
|
|
|
|
@args{ |
267
|
22
|
|
|
|
|
280
|
qw( exposure name return_type param_list docucomment class_name |
268
|
|
|
|
|
|
|
final abstract ) |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
); |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
} |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
{ |
275
|
|
|
|
|
|
|
package Clownfish::CFC::Model::ParamList; |
276
|
43
|
|
|
43
|
|
1366
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
277
|
43
|
|
|
43
|
|
234
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
53
|
|
|
43
|
|
|
|
|
2024
|
|
278
|
43
|
|
|
43
|
|
206
|
use Carp; |
|
43
|
|
|
|
|
57
|
|
|
43
|
|
|
|
|
8956
|
|
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
our %new_PARAMS = ( variadic => undef, ); |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
sub new { |
283
|
1
|
|
|
1
|
0
|
31
|
my ( $either, %args ) = @_; |
284
|
1
|
50
|
|
|
|
13
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
285
|
1
|
50
|
|
|
|
7
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
286
|
1
|
|
50
|
|
|
12
|
my $variadic = delete $args{variadic} || 0; |
287
|
1
|
|
|
|
|
43
|
return _new($variadic); |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
{ |
292
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Parcel; |
293
|
43
|
|
|
43
|
|
2054
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
294
|
43
|
|
|
43
|
|
278
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
60
|
|
|
43
|
|
|
|
|
2077
|
|
295
|
43
|
|
|
43
|
|
900
|
use Scalar::Util qw( blessed ); |
|
43
|
|
|
|
|
75
|
|
|
43
|
|
|
|
|
3978
|
|
296
|
43
|
|
|
43
|
|
246
|
use Carp; |
|
43
|
|
|
|
|
73
|
|
|
43
|
|
|
|
|
29763
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
our %new_PARAMS = ( |
299
|
|
|
|
|
|
|
name => undef, |
300
|
|
|
|
|
|
|
nickname => undef, |
301
|
|
|
|
|
|
|
version => undef, |
302
|
|
|
|
|
|
|
major_version => undef, |
303
|
|
|
|
|
|
|
file_spec => undef, |
304
|
|
|
|
|
|
|
); |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
sub new { |
307
|
12
|
|
|
12
|
0
|
4553
|
my ( $either, %args ) = @_; |
308
|
12
|
50
|
|
|
|
50
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
309
|
12
|
50
|
|
|
|
40
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
310
|
12
|
|
|
|
|
212
|
return _new( @args{qw( |
311
|
|
|
|
|
|
|
name nickname version major_version file_spec |
312
|
|
|
|
|
|
|
)} ); |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
our %new_from_json_PARAMS = ( |
316
|
|
|
|
|
|
|
json => undef, |
317
|
|
|
|
|
|
|
file_spec => undef, |
318
|
|
|
|
|
|
|
); |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
sub new_from_json { |
321
|
3
|
|
|
3
|
0
|
1956
|
my ( $either, %args ) = @_; |
322
|
3
|
50
|
|
|
|
20
|
verify_args( \%new_from_json_PARAMS, %args ) or confess $@; |
323
|
3
|
50
|
|
|
|
8
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
324
|
3
|
|
|
|
|
57
|
return _new_from_json( @args{qw( json file_spec )} ); |
325
|
|
|
|
|
|
|
} |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
our %new_from_file_PARAMS = ( |
328
|
|
|
|
|
|
|
file_spec => undef, |
329
|
|
|
|
|
|
|
); |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
sub new_from_file { |
332
|
1
|
|
|
1
|
0
|
3
|
my ( $either, %args ) = @_; |
333
|
1
|
50
|
|
|
|
5
|
verify_args( \%new_from_file_PARAMS, %args ) or confess $@; |
334
|
1
|
50
|
|
|
|
6
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
335
|
1
|
|
|
|
|
120
|
return _new_from_file( @args{qw( file_spec )} ); |
336
|
|
|
|
|
|
|
} |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
# $parcel = Clownfish::CFC::Model::Parcel->acquire($parcel_name_or_parcel_object); |
339
|
|
|
|
|
|
|
# |
340
|
|
|
|
|
|
|
# Aquire a parcel one way or another. If the supplied argument is a |
341
|
|
|
|
|
|
|
# Parcel, return it. If it's a name, fetch an existing Parcel or register |
342
|
|
|
|
|
|
|
# a new one. |
343
|
|
|
|
|
|
|
sub acquire { |
344
|
36
|
|
|
36
|
0
|
57
|
my ( undef, $thing ) = @_; |
345
|
36
|
50
|
|
|
|
177
|
if ( !defined $thing ) { |
|
|
100
|
|
|
|
|
|
346
|
0
|
|
|
|
|
0
|
confess("Missing required param 'parcel'"); |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
elsif ( blessed($thing) ) { |
349
|
3
|
50
|
|
|
|
23
|
confess("Not a Clownfish::CFC::Model::Parcel") |
350
|
|
|
|
|
|
|
unless $thing->isa('Clownfish::CFC::Model::Parcel'); |
351
|
3
|
|
|
|
|
15
|
return $thing; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
else { |
354
|
33
|
|
|
|
|
130
|
my $parcel = Clownfish::CFC::Model::Parcel->fetch($thing); |
355
|
33
|
100
|
|
|
|
82
|
if ( !$parcel ) { |
356
|
2
|
|
|
|
|
9
|
$parcel |
357
|
|
|
|
|
|
|
= Clownfish::CFC::Model::Parcel->new( name => $thing, ); |
358
|
2
|
|
|
|
|
11
|
$parcel->register; |
359
|
|
|
|
|
|
|
} |
360
|
33
|
|
|
|
|
64
|
return $parcel; |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
{ |
366
|
|
|
|
|
|
|
package Clownfish::CFC::Parser; |
367
|
43
|
|
|
43
|
|
3245
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
{ |
371
|
|
|
|
|
|
|
package Clownfish::CFC::Parser; |
372
|
43
|
|
|
43
|
|
3105
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
{ |
376
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Prereq; |
377
|
43
|
|
|
43
|
|
2920
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
378
|
43
|
|
|
43
|
|
1158
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
749
|
|
|
43
|
|
|
|
|
5636
|
|
379
|
43
|
|
|
43
|
|
1361
|
use Scalar::Util qw( blessed ); |
|
43
|
|
|
|
|
57
|
|
|
43
|
|
|
|
|
2011
|
|
380
|
43
|
|
|
43
|
|
212
|
use Carp; |
|
43
|
|
|
|
|
57
|
|
|
43
|
|
|
|
|
7616
|
|
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
our %new_PARAMS = ( |
383
|
|
|
|
|
|
|
name => undef, |
384
|
|
|
|
|
|
|
version => undef, |
385
|
|
|
|
|
|
|
); |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
sub new { |
388
|
1
|
|
|
1
|
0
|
11
|
my ( $either, %args ) = @_; |
389
|
1
|
50
|
|
|
|
15
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
390
|
1
|
50
|
|
|
|
5
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
391
|
1
|
|
|
|
|
16
|
return _new( @args{qw( name version )} ); |
392
|
|
|
|
|
|
|
} |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
{ |
396
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Symbol; |
397
|
43
|
|
|
43
|
|
1999
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
398
|
43
|
|
|
43
|
|
289
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
53
|
|
|
43
|
|
|
|
|
2093
|
|
399
|
43
|
|
|
43
|
|
208
|
use Carp; |
|
43
|
|
|
|
|
55
|
|
|
43
|
|
|
|
|
7725
|
|
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
my %new_PARAMS = ( |
402
|
|
|
|
|
|
|
exposure => undef, |
403
|
|
|
|
|
|
|
name => undef, |
404
|
|
|
|
|
|
|
); |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
sub new { |
407
|
13
|
|
|
13
|
0
|
4910
|
my ( $either, %args ) = @_; |
408
|
13
|
50
|
|
|
|
35
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
409
|
13
|
50
|
|
|
|
24
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
410
|
|
|
|
|
|
|
return _new( |
411
|
13
|
|
|
|
|
99
|
@args{qw( exposure name )} ); |
412
|
|
|
|
|
|
|
} |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
{ |
416
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Type; |
417
|
43
|
|
|
43
|
|
1275
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
418
|
43
|
|
|
43
|
|
238
|
use Clownfish::CFC::Util qw( verify_args a_isa_b ); |
|
43
|
|
|
|
|
70
|
|
|
43
|
|
|
|
|
2435
|
|
419
|
43
|
|
|
43
|
|
225
|
use Scalar::Util qw( blessed ); |
|
43
|
|
|
|
|
65
|
|
|
43
|
|
|
|
|
1920
|
|
420
|
43
|
|
|
43
|
|
222
|
use Carp; |
|
43
|
|
|
|
|
62
|
|
|
43
|
|
|
|
|
54466
|
|
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
our %new_PARAMS = ( |
423
|
|
|
|
|
|
|
const => undef, |
424
|
|
|
|
|
|
|
specifier => undef, |
425
|
|
|
|
|
|
|
indirection => undef, |
426
|
|
|
|
|
|
|
parcel => undef, |
427
|
|
|
|
|
|
|
void => undef, |
428
|
|
|
|
|
|
|
object => undef, |
429
|
|
|
|
|
|
|
primitive => undef, |
430
|
|
|
|
|
|
|
integer => undef, |
431
|
|
|
|
|
|
|
floating => undef, |
432
|
|
|
|
|
|
|
cfish_string => undef, |
433
|
|
|
|
|
|
|
va_list => undef, |
434
|
|
|
|
|
|
|
arbitrary => undef, |
435
|
|
|
|
|
|
|
composite => undef, |
436
|
|
|
|
|
|
|
); |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
sub new { |
439
|
5
|
|
|
5
|
0
|
1521
|
my ( $either, %args ) = @_; |
440
|
5
|
|
33
|
|
|
36
|
my $package = ref($either) || $either; |
441
|
5
|
50
|
|
|
|
13
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
442
|
5
|
50
|
|
|
|
21
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
443
|
|
|
|
|
|
|
|
444
|
5
|
|
|
|
|
11
|
my $flags = 0; |
445
|
5
|
100
|
|
|
|
20
|
$flags |= CONST if $args{const}; |
446
|
5
|
50
|
|
|
|
11
|
$flags |= NULLABLE if $args{nullable}; |
447
|
5
|
50
|
|
|
|
9
|
$flags |= VOID if $args{void}; |
448
|
5
|
50
|
|
|
|
11
|
$flags |= OBJECT if $args{object}; |
449
|
5
|
100
|
|
|
|
25
|
$flags |= PRIMITIVE if $args{primitive}; |
450
|
5
|
50
|
|
|
|
13
|
$flags |= INTEGER if $args{integer}; |
451
|
5
|
50
|
|
|
|
9
|
$flags |= FLOATING if $args{floating}; |
452
|
5
|
50
|
|
|
|
9
|
$flags |= CFISH_STRING if $args{cfish_string}; |
453
|
5
|
50
|
|
|
|
11
|
$flags |= VA_LIST if $args{va_list}; |
454
|
5
|
50
|
|
|
|
8
|
$flags |= ARBITRARY if $args{arbitrary}; |
455
|
5
|
50
|
|
|
|
11
|
$flags |= COMPOSITE if $args{composite}; |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
my $parcel |
458
|
|
|
|
|
|
|
= $args{parcel} |
459
|
|
|
|
|
|
|
? Clownfish::CFC::Model::Parcel->acquire( $args{parcel} ) |
460
|
5
|
100
|
|
|
|
17
|
: $args{parcel}; |
461
|
|
|
|
|
|
|
|
462
|
5
|
|
50
|
|
|
20
|
my $indirection = $args{indirection} || 0; |
463
|
5
|
|
50
|
|
|
12
|
my $specifier = $args{specifier} || ''; |
464
|
|
|
|
|
|
|
|
465
|
5
|
|
|
|
|
62
|
return _new( $flags, $parcel, $specifier, $indirection ); |
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
our %new_integer_PARAMS = ( |
469
|
|
|
|
|
|
|
const => undef, |
470
|
|
|
|
|
|
|
specifier => undef, |
471
|
|
|
|
|
|
|
); |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
sub new_integer { |
474
|
1
|
|
|
1
|
0
|
33
|
my ( $either, %args ) = @_; |
475
|
1
|
50
|
|
|
|
7
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
476
|
1
|
50
|
|
|
|
14
|
verify_args( \%new_integer_PARAMS, %args ) or confess $@; |
477
|
1
|
|
|
|
|
5
|
my $flags = 0; |
478
|
1
|
50
|
|
|
|
25
|
$flags |= CONST if $args{const}; |
479
|
1
|
|
|
|
|
36
|
return _new_integer( $flags, $args{specifier} ); |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
our %new_float_PARAMS = ( |
483
|
|
|
|
|
|
|
const => undef, |
484
|
|
|
|
|
|
|
specifier => undef, |
485
|
|
|
|
|
|
|
); |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
sub new_float { |
488
|
1
|
|
|
1
|
0
|
21
|
my ( $either, %args ) = @_; |
489
|
1
|
50
|
|
|
|
6
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
490
|
1
|
50
|
|
|
|
8
|
verify_args( \%new_float_PARAMS, %args ) or confess $@; |
491
|
1
|
|
|
|
|
2
|
my $flags = 0; |
492
|
1
|
50
|
|
|
|
16
|
$flags |= CONST if $args{const}; |
493
|
1
|
|
|
|
|
25
|
return _new_float( $flags, $args{specifier} ); |
494
|
|
|
|
|
|
|
} |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
our %new_object_PARAMS = ( |
497
|
|
|
|
|
|
|
const => undef, |
498
|
|
|
|
|
|
|
specifier => undef, |
499
|
|
|
|
|
|
|
indirection => 1, |
500
|
|
|
|
|
|
|
parcel => undef, |
501
|
|
|
|
|
|
|
incremented => 0, |
502
|
|
|
|
|
|
|
decremented => 0, |
503
|
|
|
|
|
|
|
nullable => 0, |
504
|
|
|
|
|
|
|
); |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
sub new_object { |
507
|
18
|
|
|
18
|
0
|
14228
|
my ( $either, %args ) = @_; |
508
|
18
|
50
|
|
|
|
55
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
509
|
18
|
50
|
|
|
|
63
|
verify_args( \%new_object_PARAMS, %args ) or confess $@; |
510
|
18
|
|
|
|
|
30
|
my $flags = 0; |
511
|
18
|
100
|
|
|
|
43
|
$flags |= INCREMENTED if $args{incremented}; |
512
|
18
|
100
|
|
|
|
34
|
$flags |= DECREMENTED if $args{decremented}; |
513
|
18
|
50
|
|
|
|
33
|
$flags |= NULLABLE if $args{nullable}; |
514
|
18
|
100
|
|
|
|
29
|
$flags |= CONST if $args{const}; |
515
|
18
|
100
|
|
|
|
41
|
$args{indirection} = 1 unless defined $args{indirection}; |
516
|
18
|
|
|
|
|
36
|
my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} ); |
517
|
18
|
|
33
|
|
|
67
|
my $package = ref($either) || $either; |
518
|
|
|
|
|
|
|
confess("Missing required param 'specifier'") |
519
|
18
|
100
|
|
|
|
247
|
unless defined $args{specifier}; |
520
|
|
|
|
|
|
|
return _new_object( $flags, $parcel, $args{specifier}, |
521
|
17
|
|
|
|
|
202
|
$args{indirection} ); |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
our %new_composite_PARAMS = ( |
525
|
|
|
|
|
|
|
child => undef, |
526
|
|
|
|
|
|
|
indirection => undef, |
527
|
|
|
|
|
|
|
array => undef, |
528
|
|
|
|
|
|
|
nullable => undef, |
529
|
|
|
|
|
|
|
); |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
sub new_composite { |
532
|
4
|
|
|
4
|
0
|
5833
|
my ( $either, %args ) = @_; |
533
|
4
|
50
|
|
|
|
13
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
534
|
4
|
50
|
|
|
|
26
|
verify_args( \%new_composite_PARAMS, %args ) or confess $@; |
535
|
4
|
|
|
|
|
6
|
my $flags = 0; |
536
|
4
|
50
|
|
|
|
9
|
$flags |= NULLABLE if $args{nullable}; |
537
|
4
|
|
100
|
|
|
11
|
my $indirection = $args{indirection} || 0; |
538
|
4
|
50
|
|
|
|
10
|
my $array = defined $args{array} ? $args{array} : ""; |
539
|
4
|
|
|
|
|
46
|
return _new_composite( $flags, $args{child}, $indirection, $array ); |
540
|
|
|
|
|
|
|
} |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
our %new_void_PARAMS = ( const => undef, ); |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
sub new_void { |
545
|
2
|
|
|
2
|
0
|
1822
|
my ( $either, %args ) = @_; |
546
|
2
|
50
|
|
|
|
10
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
547
|
2
|
50
|
|
|
|
14
|
verify_args( \%new_void_PARAMS, %args ) or confess $@; |
548
|
2
|
|
|
|
|
37
|
return _new_void( !!$args{const} ); |
549
|
|
|
|
|
|
|
} |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
sub new_va_list { |
552
|
1
|
|
|
1
|
0
|
26
|
my $either = shift; |
553
|
1
|
50
|
|
|
|
6
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
554
|
1
|
50
|
|
|
|
8
|
verify_args( {}, @_ ) or confess $@; |
555
|
1
|
|
|
|
|
29
|
return _new_va_list(); |
556
|
|
|
|
|
|
|
} |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
our %new_arbitrary_PARAMS = ( |
559
|
|
|
|
|
|
|
parcel => undef, |
560
|
|
|
|
|
|
|
specifier => undef, |
561
|
|
|
|
|
|
|
); |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
sub new_arbitrary { |
564
|
3
|
|
|
3
|
0
|
3546
|
my ( $either, %args ) = @_; |
565
|
3
|
50
|
|
|
|
9
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
566
|
3
|
50
|
|
|
|
13
|
verify_args( \%new_arbitrary_PARAMS, %args ) or confess $@; |
567
|
3
|
|
|
|
|
12
|
my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} ); |
568
|
3
|
|
|
|
|
33
|
return _new_arbitrary( $parcel, $args{specifier} ); |
569
|
|
|
|
|
|
|
} |
570
|
|
|
|
|
|
|
} |
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
{ |
573
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Variable; |
574
|
43
|
|
|
43
|
|
1463
|
BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' } |
575
|
43
|
|
|
43
|
|
300
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
76
|
|
|
43
|
|
|
|
|
2368
|
|
576
|
43
|
|
|
43
|
|
210
|
use Carp; |
|
43
|
|
|
|
|
58
|
|
|
43
|
|
|
|
|
9629
|
|
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
our %new_PARAMS = ( |
579
|
|
|
|
|
|
|
type => undef, |
580
|
|
|
|
|
|
|
name => undef, |
581
|
|
|
|
|
|
|
exposure => 'local', |
582
|
|
|
|
|
|
|
inert => undef, |
583
|
|
|
|
|
|
|
); |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
sub new { |
586
|
8
|
|
|
8
|
0
|
4148
|
my ( $either, %args ) = @_; |
587
|
8
|
50
|
|
|
|
28
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
588
|
8
|
100
|
|
|
|
32
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
589
|
7
|
|
50
|
|
|
40
|
$args{exposure} ||= 'local'; |
590
|
|
|
|
|
|
|
return _new( |
591
|
|
|
|
|
|
|
@args{ |
592
|
7
|
|
|
|
|
87
|
qw( exposure name type inert ) |
593
|
|
|
|
|
|
|
} |
594
|
|
|
|
|
|
|
); |
595
|
|
|
|
|
|
|
} |
596
|
|
|
|
|
|
|
} |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
{ |
599
|
|
|
|
|
|
|
package Clownfish::CFC::Model::Version; |
600
|
43
|
|
|
43
|
|
1366
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
601
|
43
|
|
|
43
|
|
242
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
66
|
|
|
43
|
|
|
|
|
2088
|
|
602
|
43
|
|
|
43
|
|
197
|
use Carp; |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
7685
|
|
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
our %new_PARAMS = ( |
605
|
|
|
|
|
|
|
vstring => undef, |
606
|
|
|
|
|
|
|
); |
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
sub new { |
609
|
10
|
|
|
10
|
0
|
2881
|
my ( $either, %args ) = @_; |
610
|
10
|
50
|
|
|
|
28
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
611
|
10
|
50
|
|
|
|
34
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
612
|
10
|
|
|
|
|
97
|
return _new( $args{vstring} ); |
613
|
|
|
|
|
|
|
} |
614
|
|
|
|
|
|
|
} |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
{ |
617
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Core; |
618
|
43
|
|
|
43
|
|
1278
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
619
|
43
|
|
|
43
|
|
249
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
59
|
|
|
43
|
|
|
|
|
2041
|
|
620
|
43
|
|
|
43
|
|
215
|
use Carp; |
|
43
|
|
|
|
|
73
|
|
|
43
|
|
|
|
|
7440
|
|
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
our %new_PARAMS = ( |
623
|
|
|
|
|
|
|
hierarchy => undef, |
624
|
|
|
|
|
|
|
header => undef, |
625
|
|
|
|
|
|
|
footer => undef, |
626
|
|
|
|
|
|
|
); |
627
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
sub new { |
629
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
630
|
0
|
0
|
|
|
|
0
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
631
|
0
|
|
|
|
|
0
|
return _new( @args{qw( hierarchy header footer )} ); |
632
|
|
|
|
|
|
|
} |
633
|
|
|
|
|
|
|
} |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
{ |
636
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Core::Class; |
637
|
43
|
|
|
43
|
|
1411
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
638
|
43
|
|
|
43
|
|
391
|
use Clownfish::CFC::Util qw( a_isa_b verify_args ); |
|
43
|
|
|
|
|
82
|
|
|
43
|
|
|
|
|
2344
|
|
639
|
43
|
|
|
43
|
|
216
|
use Carp; |
|
43
|
|
|
|
|
56
|
|
|
43
|
|
|
|
|
6771
|
|
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
our %new_PARAMS = ( client => undef, ); |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
sub new { |
644
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
645
|
0
|
0
|
|
|
|
0
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
646
|
0
|
|
|
|
|
0
|
return _new( $args{client} ); |
647
|
|
|
|
|
|
|
} |
648
|
|
|
|
|
|
|
} |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
{ |
651
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Core::File; |
652
|
43
|
|
|
43
|
|
252
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
81
|
|
|
43
|
|
|
|
|
2053
|
|
653
|
43
|
|
|
43
|
|
214
|
use Carp; |
|
43
|
|
|
|
|
78
|
|
|
43
|
|
|
|
|
11402
|
|
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
my %write_h_PARAMS = ( |
656
|
|
|
|
|
|
|
file => undef, |
657
|
|
|
|
|
|
|
dest => undef, |
658
|
|
|
|
|
|
|
header => undef, |
659
|
|
|
|
|
|
|
footer => undef, |
660
|
|
|
|
|
|
|
); |
661
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
sub write_h { |
663
|
0
|
|
|
0
|
0
|
0
|
my ( undef, %args ) = @_; |
664
|
0
|
0
|
|
|
|
0
|
verify_args( \%write_h_PARAMS, %args ) or confess $@; |
665
|
0
|
|
|
|
|
0
|
_write_h( @args{qw( file dest header footer )} ); |
666
|
|
|
|
|
|
|
} |
667
|
|
|
|
|
|
|
} |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
{ |
670
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Core::Method; |
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
sub method_def { |
673
|
0
|
|
|
0
|
0
|
0
|
my ( undef, %args ) = @_; |
674
|
0
|
|
|
|
|
0
|
return _method_def( @args{qw( method class )} ); |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
sub callback_obj_def { |
678
|
0
|
|
|
0
|
0
|
0
|
my ( undef, %args ) = @_; |
679
|
0
|
|
|
|
|
0
|
return _callback_obj_def( @args{qw( method offset )} ); |
680
|
|
|
|
|
|
|
} |
681
|
|
|
|
|
|
|
} |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
{ |
684
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl; |
685
|
43
|
|
|
43
|
|
1349
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
686
|
43
|
|
|
43
|
|
242
|
use Carp; |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
2706
|
|
687
|
43
|
|
|
43
|
|
211
|
use Clownfish::CFC::Util qw( verify_args a_isa_b ); |
|
43
|
|
|
|
|
63
|
|
|
43
|
|
|
|
|
10605
|
|
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
our %new_PARAMS = ( |
690
|
|
|
|
|
|
|
hierarchy => undef, |
691
|
|
|
|
|
|
|
lib_dir => undef, |
692
|
|
|
|
|
|
|
header => undef, |
693
|
|
|
|
|
|
|
footer => undef, |
694
|
|
|
|
|
|
|
); |
695
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
sub new { |
697
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
698
|
0
|
0
|
|
|
|
0
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
699
|
|
|
|
|
|
|
return _new( |
700
|
0
|
|
|
|
|
0
|
@args{qw( hierarchy lib_dir header footer )} ); |
701
|
|
|
|
|
|
|
} |
702
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
sub write_bindings { |
704
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = @_; |
705
|
|
|
|
|
|
|
$args{parcels} = [ map { |
706
|
0
|
|
|
|
|
0
|
Clownfish::CFC::Model::Parcel->acquire($_); |
707
|
0
|
|
|
|
|
0
|
} @{ $args{parcels} } ]; |
|
0
|
|
|
|
|
0
|
|
708
|
0
|
|
|
|
|
0
|
return $self->_write_bindings( @args{qw( boot_class parcels )} ); |
709
|
|
|
|
|
|
|
} |
710
|
|
|
|
|
|
|
} |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
{ |
713
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::Class; |
714
|
43
|
|
|
43
|
|
1317
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
715
|
43
|
|
|
43
|
|
240
|
use Carp; |
|
43
|
|
|
|
|
62
|
|
|
43
|
|
|
|
|
2680
|
|
716
|
43
|
|
|
43
|
|
226
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
62
|
|
|
43
|
|
|
|
|
16096
|
|
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
our %new_PARAMS = ( |
719
|
|
|
|
|
|
|
parcel => undef, |
720
|
|
|
|
|
|
|
class_name => undef, |
721
|
|
|
|
|
|
|
); |
722
|
|
|
|
|
|
|
|
723
|
|
|
|
|
|
|
sub new { |
724
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
725
|
0
|
0
|
|
|
|
0
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
726
|
0
|
0
|
|
|
|
0
|
if ( exists( $args{parcel} ) ) { |
727
|
|
|
|
|
|
|
$args{parcel} |
728
|
0
|
|
|
|
|
0
|
= Clownfish::CFC::Model::Parcel->acquire( $args{parcel} ); |
729
|
|
|
|
|
|
|
} |
730
|
0
|
|
|
|
|
0
|
return _new( @args{qw( parcel class_name )} ); |
731
|
|
|
|
|
|
|
} |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
our %bind_method_PARAMS = ( |
734
|
|
|
|
|
|
|
alias => undef, |
735
|
|
|
|
|
|
|
method => undef, |
736
|
|
|
|
|
|
|
); |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
sub bind_method { |
739
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = @_; |
740
|
0
|
0
|
|
|
|
0
|
verify_args( \%bind_method_PARAMS, %args ) or confess $@; |
741
|
0
|
|
|
|
|
0
|
_bind_method( $self, @args{qw( alias method )} ); |
742
|
|
|
|
|
|
|
} |
743
|
|
|
|
|
|
|
|
744
|
|
|
|
|
|
|
our %bind_constructor_PARAMS = ( |
745
|
|
|
|
|
|
|
alias => undef, |
746
|
|
|
|
|
|
|
initializer => undef, |
747
|
|
|
|
|
|
|
); |
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
sub bind_constructor { |
750
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = @_; |
751
|
0
|
0
|
|
|
|
0
|
verify_args( \%bind_constructor_PARAMS, %args ) or confess $@; |
752
|
0
|
|
|
|
|
0
|
_bind_constructor( $self, @args{qw( alias initializer )} ); |
753
|
|
|
|
|
|
|
} |
754
|
|
|
|
|
|
|
} |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
{ |
757
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::Constructor; |
758
|
43
|
|
|
43
|
|
1304
|
BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' } |
759
|
43
|
|
|
43
|
|
253
|
use Carp; |
|
43
|
|
|
|
|
70
|
|
|
43
|
|
|
|
|
2830
|
|
760
|
43
|
|
|
43
|
|
228
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
83
|
|
|
43
|
|
|
|
|
7053
|
|
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
our %new_PARAMS = ( |
763
|
|
|
|
|
|
|
class => undef, |
764
|
|
|
|
|
|
|
alias => undef, |
765
|
|
|
|
|
|
|
initializer => undef, |
766
|
|
|
|
|
|
|
); |
767
|
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
sub new { |
769
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
770
|
0
|
0
|
|
|
|
0
|
confess $@ unless verify_args( \%new_PARAMS, %args ); |
771
|
0
|
|
|
|
|
0
|
return _new( @args{qw( class alias initializer )} ); |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
} |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
{ |
776
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::Method; |
777
|
43
|
|
|
43
|
|
1392
|
BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' } |
778
|
43
|
|
|
43
|
|
242
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
68
|
|
|
43
|
|
|
|
|
1990
|
|
779
|
43
|
|
|
43
|
|
214
|
use Carp; |
|
43
|
|
|
|
|
60
|
|
|
43
|
|
|
|
|
6851
|
|
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
our %new_PARAMS = ( |
782
|
|
|
|
|
|
|
method => undef, |
783
|
|
|
|
|
|
|
alias => undef, |
784
|
|
|
|
|
|
|
); |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
sub new { |
787
|
0
|
|
|
0
|
0
|
0
|
my ( $either, %args ) = @_; |
788
|
0
|
0
|
|
|
|
0
|
confess $@ unless verify_args( \%new_PARAMS, %args ); |
789
|
0
|
|
|
|
|
0
|
return _new( @args{qw( method alias )} ); |
790
|
|
|
|
|
|
|
} |
791
|
|
|
|
|
|
|
} |
792
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
{ |
794
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::Pod; |
795
|
43
|
|
|
43
|
|
1361
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
796
|
43
|
|
|
43
|
|
220
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
60
|
|
|
43
|
|
|
|
|
2371
|
|
797
|
43
|
|
|
43
|
|
216
|
use Carp; |
|
43
|
|
|
|
|
59
|
|
|
43
|
|
|
|
|
11158
|
|
798
|
|
|
|
|
|
|
|
799
|
|
|
|
|
|
|
my %add_method_PARAMS = ( |
800
|
|
|
|
|
|
|
alias => undef, |
801
|
|
|
|
|
|
|
method => undef, |
802
|
|
|
|
|
|
|
sample => undef, |
803
|
|
|
|
|
|
|
pod => undef, |
804
|
|
|
|
|
|
|
); |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
sub add_method { |
807
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = @_; |
808
|
0
|
0
|
|
|
|
0
|
verify_args( \%add_method_PARAMS, %args ) or confess $@; |
809
|
0
|
|
|
|
|
0
|
_add_method( $self, @args{qw( alias method sample pod )} ); |
810
|
|
|
|
|
|
|
} |
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
my %add_constructor_PARAMS = ( |
813
|
|
|
|
|
|
|
alias => undef, |
814
|
|
|
|
|
|
|
pod_func => undef, |
815
|
|
|
|
|
|
|
sample => undef, |
816
|
|
|
|
|
|
|
pod => undef, |
817
|
|
|
|
|
|
|
); |
818
|
|
|
|
|
|
|
|
819
|
|
|
|
|
|
|
sub add_constructor { |
820
|
0
|
|
|
0
|
0
|
0
|
my ( $self, %args ) = @_; |
821
|
0
|
0
|
|
|
|
0
|
verify_args( \%add_constructor_PARAMS, %args ) or confess $@; |
822
|
0
|
|
|
|
|
0
|
_add_constructor( $self, @args{qw( alias pod_func sample pod )} ); |
823
|
|
|
|
|
|
|
} |
824
|
|
|
|
|
|
|
} |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
{ |
827
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::Subroutine; |
828
|
43
|
|
|
43
|
|
2086
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
829
|
43
|
|
|
43
|
|
251
|
use Carp; |
|
43
|
|
|
|
|
66
|
|
|
43
|
|
|
|
|
2744
|
|
830
|
43
|
|
|
43
|
|
218
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
56
|
|
|
43
|
|
|
|
|
3673
|
|
831
|
|
|
|
|
|
|
|
832
|
0
|
|
|
0
|
0
|
0
|
sub xsub_def { confess "Abstract method" } |
833
|
|
|
|
|
|
|
} |
834
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
{ |
836
|
|
|
|
|
|
|
package Clownfish::CFC::Binding::Perl::TypeMap; |
837
|
43
|
|
|
43
|
|
248
|
use base qw( Exporter ); |
|
43
|
|
|
|
|
70
|
|
|
43
|
|
|
|
|
8280
|
|
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
our @EXPORT_OK = qw( from_perl to_perl ); |
840
|
|
|
|
|
|
|
|
841
|
|
|
|
|
|
|
sub write_xs_typemap { |
842
|
0
|
|
|
0
|
0
|
0
|
my ( undef, %args ) = @_; |
843
|
0
|
|
|
|
|
0
|
_write_xs_typemap( $args{hierarchy} ); |
844
|
|
|
|
|
|
|
} |
845
|
|
|
|
|
|
|
} |
846
|
|
|
|
|
|
|
|
847
|
|
|
|
|
|
|
{ |
848
|
|
|
|
|
|
|
package Clownfish::CFC::Test; |
849
|
43
|
|
|
43
|
|
1347
|
BEGIN { push our @ISA, 'Clownfish::CFC::Base' } |
850
|
43
|
|
|
43
|
|
230
|
use Clownfish::CFC::Util qw( verify_args ); |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
2012
|
|
851
|
43
|
|
|
43
|
|
218
|
use Carp; |
|
43
|
|
|
|
|
81
|
|
|
43
|
|
|
|
|
9873
|
|
852
|
|
|
|
|
|
|
|
853
|
|
|
|
|
|
|
my %new_PARAMS = ( |
854
|
|
|
|
|
|
|
formatter_name => 'tap', |
855
|
|
|
|
|
|
|
); |
856
|
|
|
|
|
|
|
|
857
|
|
|
|
|
|
|
sub new { |
858
|
16
|
|
|
16
|
0
|
269
|
my ( $either, %args ) = @_; |
859
|
16
|
50
|
|
|
|
121
|
verify_args( \%new_PARAMS, %args ) or confess $@; |
860
|
16
|
50
|
|
|
|
79
|
confess "no subclassing allowed" unless $either eq __PACKAGE__; |
861
|
16
|
50
|
|
|
|
91
|
$args{formatter_name} = 'tap' unless defined $args{formatter_name}; |
862
|
16
|
|
|
|
|
473
|
return _new( @args{qw( formatter_name )} ); |
863
|
|
|
|
|
|
|
} |
864
|
|
|
|
|
|
|
} |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
1; |
867
|
|
|
|
|
|
|
|