line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Interface Definition Language (OMG IDL CORBA v3.0) |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# IDL to Java Language Mapping Specification, Version 1.2 August 2002 |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CORBA::JAVA::NameVisitor; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
11
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4897
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '2.60'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# builds $node->{java_name} and $node->{java_package} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
0
|
|
|
0
|
0
|
|
my $proto = shift; |
19
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
20
|
0
|
|
|
|
|
|
my $self = {}; |
21
|
0
|
|
|
|
|
|
bless $self, $class; |
22
|
0
|
|
|
|
|
|
my ($parser, $prefix, $translate) = @_; |
23
|
0
|
|
|
|
|
|
$self->{key} = 'java_name'; |
24
|
0
|
|
|
|
|
|
$self->{srcname} = $parser->YYData->{srcname}; |
25
|
0
|
|
|
|
|
|
$self->{symbtab} = $parser->YYData->{symbtab}; |
26
|
0
|
|
|
|
|
|
$self->{num_key} = 'num_java_name'; |
27
|
0
|
|
|
|
|
|
$self->{pkg_prefix} = {}; |
28
|
0
|
0
|
|
|
|
|
if (defined $prefix) { |
29
|
0
|
|
|
|
|
|
foreach (split /;/, $prefix) { |
30
|
0
|
|
|
|
|
|
my @kv = split /=/, $_; |
31
|
0
|
0
|
|
|
|
|
if (scalar(@kv) == 2) { |
32
|
0
|
|
|
|
|
|
$self->{pkg_prefix}->{$kv[0]} = $kv[1]; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
$self->{pkg_translate} = {}; |
37
|
0
|
0
|
|
|
|
|
if (defined $translate) { |
38
|
0
|
|
|
|
|
|
foreach (split /;/, $translate) { |
39
|
0
|
|
|
|
|
|
my @kv = split /=/, $_; |
40
|
0
|
0
|
|
|
|
|
if (scalar(@kv) == 2) { |
41
|
0
|
0
|
0
|
|
|
|
next if ($kv[0] eq 'org' or $kv[0] eq 'org.omg' or $kv[0] =~ /^org\.omg\./); |
|
|
|
0
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->{pkg_translate}->{$kv[0]} = $kv[1]; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
|
$self->{java_keywords} = { |
47
|
|
|
|
|
|
|
# The keywords in the Java Language : |
48
|
|
|
|
|
|
|
# (from the Java Language Specification 1.0 First Edition, Section 3.9) |
49
|
|
|
|
|
|
|
'abstract' => 1, |
50
|
|
|
|
|
|
|
'boolean' => 1, |
51
|
|
|
|
|
|
|
'break' => 1, |
52
|
|
|
|
|
|
|
'byte' => 1, |
53
|
|
|
|
|
|
|
'case' => 1, |
54
|
|
|
|
|
|
|
'catch' => 1, |
55
|
|
|
|
|
|
|
'char' => 1, |
56
|
|
|
|
|
|
|
'class' => 1, |
57
|
|
|
|
|
|
|
'const' => 1, |
58
|
|
|
|
|
|
|
'continue' => 1, |
59
|
|
|
|
|
|
|
'default' => 1, |
60
|
|
|
|
|
|
|
'do' => 1, |
61
|
|
|
|
|
|
|
'double' => 1, |
62
|
|
|
|
|
|
|
'else' => 1, |
63
|
|
|
|
|
|
|
'extends' => 1, |
64
|
|
|
|
|
|
|
'final' => 1, |
65
|
|
|
|
|
|
|
'finally' => 1, |
66
|
|
|
|
|
|
|
'float' => 1, |
67
|
|
|
|
|
|
|
'for' => 1, |
68
|
|
|
|
|
|
|
'goto' => 1, |
69
|
|
|
|
|
|
|
'if' => 1, |
70
|
|
|
|
|
|
|
'implements' => 1, |
71
|
|
|
|
|
|
|
'import' => 1, |
72
|
|
|
|
|
|
|
'instanceof' => 1, |
73
|
|
|
|
|
|
|
'int' => 1, |
74
|
|
|
|
|
|
|
'interface' => 1, |
75
|
|
|
|
|
|
|
'long' => 1, |
76
|
|
|
|
|
|
|
'native' => 1, |
77
|
|
|
|
|
|
|
'new' => 1, |
78
|
|
|
|
|
|
|
'package' => 1, |
79
|
|
|
|
|
|
|
'private' => 1, |
80
|
|
|
|
|
|
|
'protected' => 1, |
81
|
|
|
|
|
|
|
'public' => 1, |
82
|
|
|
|
|
|
|
'return' => 1, |
83
|
|
|
|
|
|
|
'short' => 1, |
84
|
|
|
|
|
|
|
'static' => 1, |
85
|
|
|
|
|
|
|
'super' => 1, |
86
|
|
|
|
|
|
|
'switch' => 1, |
87
|
|
|
|
|
|
|
'synchronized' => 1, |
88
|
|
|
|
|
|
|
'this' => 1, |
89
|
|
|
|
|
|
|
'throw' => 1, |
90
|
|
|
|
|
|
|
'throws' => 1, |
91
|
|
|
|
|
|
|
'transcient' => 1, |
92
|
|
|
|
|
|
|
'try' => 1, |
93
|
|
|
|
|
|
|
'void' => 1, |
94
|
|
|
|
|
|
|
'volatile' => 1, |
95
|
|
|
|
|
|
|
'while' => 1, |
96
|
|
|
|
|
|
|
# additionnal Java constant |
97
|
|
|
|
|
|
|
'true' => 1, |
98
|
|
|
|
|
|
|
'false' => 1, |
99
|
|
|
|
|
|
|
'null' => 1, |
100
|
|
|
|
|
|
|
# methods on java.lang.Object |
101
|
|
|
|
|
|
|
# (from the Java Language Specification 1.0 First Edition, Section 20.1) |
102
|
|
|
|
|
|
|
'clone' => 1, |
103
|
|
|
|
|
|
|
'equals' => 1, |
104
|
|
|
|
|
|
|
'finalize' => 1, |
105
|
|
|
|
|
|
|
'getClass' => 1, |
106
|
|
|
|
|
|
|
'hashCode' => 1, |
107
|
|
|
|
|
|
|
'notify' => 1, |
108
|
|
|
|
|
|
|
'notifyAll' => 1, |
109
|
|
|
|
|
|
|
'toString' => 1, |
110
|
|
|
|
|
|
|
'wait' => 1 |
111
|
|
|
|
|
|
|
}; |
112
|
0
|
|
|
|
|
|
return $self; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub _get_defn { |
116
|
0
|
|
|
0
|
|
|
my $self = shift; |
117
|
0
|
|
|
|
|
|
my ($defn) = @_; |
118
|
0
|
0
|
|
|
|
|
if (ref $defn) { |
119
|
0
|
|
|
|
|
|
return $defn; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
else { |
122
|
0
|
|
|
|
|
|
return $self->{symbtab}->Lookup($defn); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub _get_name { |
127
|
0
|
|
|
0
|
|
|
my $self = shift; |
128
|
0
|
|
|
|
|
|
my ($node) = @_; |
129
|
0
|
|
|
|
|
|
my $name = $node->{idf}; |
130
|
0
|
|
|
|
|
|
$name =~ s/^_get_//; |
131
|
0
|
|
|
|
|
|
$name =~ s/^_set_//; |
132
|
0
|
0
|
|
|
|
|
return '_' . $name if (exists $self->{java_keywords}->{$name}); |
133
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /Helper$/); |
134
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /Holder$/); |
135
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /Operations$/); |
136
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /POA$/); |
137
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /POATie$/); |
138
|
0
|
0
|
|
|
|
|
return '_' . $name if ($name =~ /Package$/); |
139
|
0
|
|
|
|
|
|
return $name; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub _get_pkg { |
143
|
0
|
|
|
0
|
|
|
my $self = shift; |
144
|
0
|
|
|
|
|
|
my ($node) = @_; |
145
|
0
|
|
|
|
|
|
my $pkg = $node->{full}; |
146
|
0
|
|
|
|
|
|
$pkg =~ s/::[0-9A-Z_a-z]+$//; |
147
|
0
|
0
|
|
|
|
|
return q{} unless ($pkg); |
148
|
0
|
|
|
|
|
|
my $defn = $self->{symbtab}->Lookup($pkg); |
149
|
0
|
|
|
|
|
|
my $package = $defn->{java_Name}; |
150
|
0
|
0
|
0
|
|
|
|
if ( ( $node->isa('StructType') |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
151
|
|
|
|
|
|
|
or $node->isa('UnionType') |
152
|
|
|
|
|
|
|
or $node->isa('EnumType') |
153
|
|
|
|
|
|
|
or $node->isa('Exception') |
154
|
|
|
|
|
|
|
or $node->isa('TypeDeclarator') ) |
155
|
|
|
|
|
|
|
and ( $defn->isa('BaseInterface') |
156
|
|
|
|
|
|
|
or $defn->isa('UnionType') |
157
|
|
|
|
|
|
|
or $defn->isa('StructType') ) ) { |
158
|
0
|
|
|
|
|
|
$package .= 'Package'; |
159
|
|
|
|
|
|
|
} |
160
|
0
|
|
|
|
|
|
foreach (keys %{$self->{pkg_prefix}}) { |
|
0
|
|
|
|
|
|
|
161
|
0
|
0
|
|
|
|
|
if ($package =~ /^$_/) { |
162
|
0
|
|
|
|
|
|
$package = $self->{pkg_prefix}->{$_} . '.' . $package; |
163
|
0
|
|
|
|
|
|
last; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
} |
166
|
0
|
|
|
|
|
|
foreach (keys %{$self->{pkg_translate}}) { |
|
0
|
|
|
|
|
|
|
167
|
0
|
0
|
|
|
|
|
if ($package =~ s/^$_/$self->{pkg_translate}->{$_}/) { |
168
|
0
|
|
|
|
|
|
last; |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
} |
171
|
0
|
|
|
|
|
|
return $package; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub _get_Name { |
175
|
0
|
|
|
0
|
|
|
my $self = shift; |
176
|
0
|
|
|
|
|
|
my ($node, $java_package) = @_; |
177
|
0
|
0
|
|
|
|
|
$java_package = $node->{java_package} unless (defined $java_package); |
178
|
0
|
0
|
|
|
|
|
if ($java_package) { |
179
|
0
|
|
|
|
|
|
return $java_package . '.' . $node->{java_name}; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
else { |
182
|
0
|
|
|
|
|
|
return $node->{java_name}; |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
# |
187
|
|
|
|
|
|
|
# 3.5 OMG IDL Specification |
188
|
|
|
|
|
|
|
# |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub visitSpecification { |
191
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
192
|
0
|
|
|
|
|
|
my ($node) = @_; |
193
|
0
|
0
|
|
|
|
|
if (exists $node->{list_import}) { |
194
|
0
|
|
|
|
|
|
foreach (@{$node->{list_import}}) { |
|
0
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
} |
198
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
199
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# |
204
|
|
|
|
|
|
|
# 3.6 Import Declaration |
205
|
|
|
|
|
|
|
# |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub visitImport { |
208
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
209
|
0
|
|
|
|
|
|
my ($node) = @_; |
210
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
211
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
# |
216
|
|
|
|
|
|
|
# 3.7 Module Declaration |
217
|
|
|
|
|
|
|
# |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub visitModules { |
220
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
221
|
0
|
|
|
|
|
|
my ($node) = @_; |
222
|
0
|
0
|
|
|
|
|
unless (exists $node->{$self->{num_key}}) { |
223
|
0
|
|
|
|
|
|
$node->{$self->{num_key}} = 0; |
224
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
225
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
226
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
227
|
|
|
|
|
|
|
} |
228
|
0
|
|
|
|
|
|
my $module = ${$node->{list_decl}}[$node->{$self->{num_key}}]; |
|
0
|
|
|
|
|
|
|
229
|
0
|
|
|
|
|
|
$module->visit($self); |
230
|
0
|
|
|
|
|
|
$node->{$self->{num_key}} ++; |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub visitModule { |
234
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
235
|
0
|
|
|
|
|
|
my ($node) = @_; |
236
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
237
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# |
242
|
|
|
|
|
|
|
# 3.8 Interface Declaration |
243
|
|
|
|
|
|
|
# |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
sub visitBaseInterface { |
246
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
247
|
0
|
|
|
|
|
|
my ($node) = @_; |
248
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
249
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
250
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
251
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
252
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
253
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
sub visitForwardBaseInterface { |
258
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
259
|
0
|
|
|
|
|
|
my ($node) = @_; |
260
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
261
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
262
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
263
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
264
|
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
# |
267
|
|
|
|
|
|
|
# 3.9 Value Declaration |
268
|
|
|
|
|
|
|
# |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
sub visitStateMembers { |
271
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
272
|
0
|
|
|
|
|
|
my ($node) = @_; |
273
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
274
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub visitStateMember { |
279
|
0
|
|
|
0
|
0
|
|
shift->visitMember(@_); |
280
|
|
|
|
|
|
|
} |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
sub visitInitializer { |
283
|
0
|
|
|
0
|
0
|
|
shift->visitOperation(@_); |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub visitBoxedValue { |
287
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
288
|
0
|
|
|
|
|
|
my ($node) = @_; |
289
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
290
|
|
|
|
|
|
|
|
291
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
292
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('FloatingPtType') |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
293
|
|
|
|
|
|
|
or $type->isa('IntegerType') |
294
|
|
|
|
|
|
|
or $type->isa('CharType') |
295
|
|
|
|
|
|
|
or $type->isa('WideCharType') |
296
|
|
|
|
|
|
|
or $type->isa('BooleanType') |
297
|
|
|
|
|
|
|
or $type->isa('OctetType') ) { |
298
|
0
|
|
|
|
|
|
$type->visit($self); |
299
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
300
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
301
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
302
|
0
|
|
|
|
|
|
$node->{java_primitive} = 1; |
303
|
|
|
|
|
|
|
} |
304
|
|
|
|
|
|
|
else { |
305
|
0
|
0
|
|
|
|
|
if ($type->isa('SequenceType')) { |
306
|
0
|
|
|
|
|
|
$type->visit($self); |
307
|
0
|
|
|
|
|
|
$type->{repos_id} = $node->{repos_id}; |
308
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
309
|
0
|
|
|
|
|
|
$node->{java_name} = $type->{java_name} . '[]'; |
310
|
0
|
|
|
|
|
|
while ($type->isa('SequenceType')) { |
311
|
0
|
|
|
|
|
|
$node->{java_name} .= '[]'; |
312
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
313
|
|
|
|
|
|
|
} |
314
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node, $type->{java_package}); |
315
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
316
|
|
|
|
|
|
|
} |
317
|
|
|
|
|
|
|
else { |
318
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
319
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
320
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
321
|
0
|
|
|
|
|
|
$type->visit($self); |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# |
327
|
|
|
|
|
|
|
# 3.10 Constant Declaration |
328
|
|
|
|
|
|
|
# |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
sub visitConstant { |
331
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
332
|
0
|
|
|
|
|
|
my ($node) = @_; |
333
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
334
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
335
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
336
|
0
|
|
|
|
|
|
my $defn; |
337
|
0
|
|
|
|
|
|
my $pkg = $node->{full}; |
338
|
0
|
|
|
|
|
|
$pkg =~ s/::[0-9A-Z_a-z]+$//; |
339
|
0
|
0
|
|
|
|
|
$defn = $self->{symbtab}->Lookup($pkg) if ($pkg); |
340
|
0
|
0
|
0
|
|
|
|
if ( defined $defn and $defn->isa('BaseInterface') ) { |
341
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
342
|
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
else { |
344
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node) . '.value'; |
345
|
|
|
|
|
|
|
} |
346
|
0
|
|
|
|
|
|
$type->visit($self); |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
|
349
|
0
|
|
|
0
|
0
|
|
sub visitExpression { |
350
|
|
|
|
|
|
|
# empty |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
# |
354
|
|
|
|
|
|
|
# 3.11 Type Declaration |
355
|
|
|
|
|
|
|
# |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
sub visitTypeDeclarators { |
358
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
359
|
0
|
|
|
|
|
|
my ($node) = @_; |
360
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
361
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
362
|
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
} |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
sub visitTypeDeclarator { |
366
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
367
|
0
|
|
|
|
|
|
my ($node) = @_; |
368
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
369
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
370
|
0
|
|
|
|
|
|
$type->visit($self); |
371
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType') |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
372
|
|
|
|
|
|
|
or $type->isa('StringType') |
373
|
|
|
|
|
|
|
or $type->isa('WideStringType') |
374
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) { |
375
|
0
|
|
|
|
|
|
$node->{java_primitive} = 1; |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
else { |
378
|
0
|
0
|
|
|
|
|
$node->{java_primitive} = 1 if (exists $type->{java_primitive}); |
379
|
|
|
|
|
|
|
} |
380
|
0
|
0
|
|
|
|
|
if (exists $node->{array_size}) { |
381
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
382
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
383
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
else { |
386
|
0
|
0
|
|
|
|
|
if ($type->isa('SequenceType')) { |
387
|
0
|
|
|
|
|
|
$type->{repos_id} = $node->{repos_id}; |
388
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
389
|
0
|
|
|
|
|
|
$node->{java_name} = $type->{java_name} . '[]'; |
390
|
0
|
|
|
|
|
|
while ($type->isa('SequenceType')) { |
391
|
0
|
|
|
|
|
|
$node->{java_name} .= '[]'; |
392
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
393
|
|
|
|
|
|
|
} |
394
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node, $type->{java_package}); |
395
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
else { |
398
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('BasicType') |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
399
|
|
|
|
|
|
|
or $type->isa('StringType') |
400
|
|
|
|
|
|
|
or $type->isa('WideStringType') |
401
|
|
|
|
|
|
|
or $type->isa('FixedPtType') ) { |
402
|
0
|
|
|
|
|
|
$node->{java_name} = $type->{java_name}; |
403
|
0
|
|
|
|
|
|
$node->{java_Name} = $type->{java_Name}; |
404
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
405
|
|
|
|
|
|
|
} |
406
|
|
|
|
|
|
|
else { |
407
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
408
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
409
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
410
|
|
|
|
|
|
|
} |
411
|
|
|
|
|
|
|
} |
412
|
|
|
|
|
|
|
} |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
sub visitNativeType { |
416
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
417
|
0
|
|
|
|
|
|
my ($node) = @_; |
418
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
419
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
420
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
# |
424
|
|
|
|
|
|
|
# 3.11.1 Basic Types |
425
|
|
|
|
|
|
|
# |
426
|
|
|
|
|
|
|
# See 1.4 Mapping for Basic Data Types |
427
|
|
|
|
|
|
|
# |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub visitIntegerType { |
430
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
431
|
0
|
|
|
|
|
|
my ($node) = @_; |
432
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
433
|
0
|
0
|
|
|
|
|
if ($node->{value} eq 'short') { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
434
|
0
|
|
|
|
|
|
$node->{java_name} = 'short'; |
435
|
0
|
|
|
|
|
|
$node->{java_Name} = 'short'; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
elsif ($node->{value} eq 'unsigned short') { |
438
|
0
|
|
|
|
|
|
$node->{java_name} = 'short'; |
439
|
0
|
|
|
|
|
|
$node->{java_Name} = 'short'; |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
elsif ($node->{value} eq 'long') { |
442
|
0
|
|
|
|
|
|
$node->{java_name} = 'int'; |
443
|
0
|
|
|
|
|
|
$node->{java_Name} = 'int'; |
444
|
|
|
|
|
|
|
} |
445
|
|
|
|
|
|
|
elsif ($node->{value} eq 'unsigned long') { |
446
|
0
|
|
|
|
|
|
$node->{java_name} = 'int'; |
447
|
0
|
|
|
|
|
|
$node->{java_Name} = 'int'; |
448
|
|
|
|
|
|
|
} |
449
|
|
|
|
|
|
|
elsif ($node->{value} eq 'long long') { |
450
|
0
|
|
|
|
|
|
$node->{java_name} = 'long'; |
451
|
0
|
|
|
|
|
|
$node->{java_Name} = 'long'; |
452
|
|
|
|
|
|
|
} |
453
|
|
|
|
|
|
|
elsif ($node->{value} eq 'unsigned long long') { |
454
|
0
|
|
|
|
|
|
$node->{java_name} = 'long'; |
455
|
0
|
|
|
|
|
|
$node->{java_Name} = 'long'; |
456
|
|
|
|
|
|
|
} |
457
|
|
|
|
|
|
|
else { |
458
|
0
|
|
|
|
|
|
warn __PACKAGE__,"::visitIntegerType $node->{value}.\n"; |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
} |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
sub visitFloatingPtType { |
463
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
464
|
0
|
|
|
|
|
|
my ($node) = @_; |
465
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
466
|
0
|
0
|
|
|
|
|
if ($node->{value} eq 'float') { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
467
|
0
|
|
|
|
|
|
$node->{java_name} = 'float'; |
468
|
0
|
|
|
|
|
|
$node->{java_Name} = 'float'; |
469
|
|
|
|
|
|
|
} |
470
|
|
|
|
|
|
|
elsif ($node->{value} eq 'double') { |
471
|
0
|
|
|
|
|
|
$node->{java_name} = 'double'; |
472
|
0
|
|
|
|
|
|
$node->{java_Name} = 'double'; |
473
|
|
|
|
|
|
|
} |
474
|
|
|
|
|
|
|
elsif ($node->{value} eq 'long double') { |
475
|
0
|
|
|
|
|
|
warn __PACKAGE__," 'long double' not available at this time for Java.\n"; |
476
|
0
|
|
|
|
|
|
$node->{java_name} = 'double'; |
477
|
0
|
|
|
|
|
|
$node->{java_Name} = 'double'; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
else { |
480
|
0
|
|
|
|
|
|
warn __PACKAGE__,"::visitFloatingPtType $node->{value}.\n"; |
481
|
|
|
|
|
|
|
} |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
sub visitCharType { |
485
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
486
|
0
|
|
|
|
|
|
my ($node) = @_; |
487
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
488
|
0
|
|
|
|
|
|
$node->{java_name} = 'char'; |
489
|
0
|
|
|
|
|
|
$node->{java_Name} = 'char'; |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
sub visitWideCharType { |
493
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
494
|
0
|
|
|
|
|
|
my ($node) = @_; |
495
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
496
|
0
|
|
|
|
|
|
$node->{java_name} = 'char'; |
497
|
0
|
|
|
|
|
|
$node->{java_Name} = 'char'; |
498
|
|
|
|
|
|
|
} |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
sub visitBooleanType { |
501
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
502
|
0
|
|
|
|
|
|
my ($node) = @_; |
503
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
504
|
0
|
|
|
|
|
|
$node->{java_name} = 'boolean'; |
505
|
0
|
|
|
|
|
|
$node->{java_Name} = 'boolean'; |
506
|
|
|
|
|
|
|
} |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
sub visitOctetType { |
509
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
510
|
0
|
|
|
|
|
|
my ($node) = @_; |
511
|
0
|
|
|
|
|
|
$node->{java_package} = q{}; |
512
|
0
|
|
|
|
|
|
$node->{java_name} = 'byte'; |
513
|
0
|
|
|
|
|
|
$node->{java_Name} = 'byte'; |
514
|
|
|
|
|
|
|
} |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
sub visitAnyType { |
517
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
518
|
0
|
|
|
|
|
|
my ($node) = @_; |
519
|
0
|
|
|
|
|
|
$node->{java_package} = 'org.omg.CORBA'; |
520
|
0
|
|
|
|
|
|
$node->{java_name} = 'Any'; |
521
|
0
|
|
|
|
|
|
$node->{java_Name} = 'org.omg.CORBA.Any'; |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
sub visitObjectType { |
525
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
526
|
0
|
|
|
|
|
|
my ($node) = @_; |
527
|
0
|
|
|
|
|
|
$node->{java_package} = 'org.omg.CORBA'; |
528
|
0
|
|
|
|
|
|
$node->{java_name} = 'Object'; |
529
|
0
|
|
|
|
|
|
$node->{java_Name} = 'org.omg.CORBA.Object'; |
530
|
|
|
|
|
|
|
} |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
sub visitValueBaseType { |
533
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
534
|
0
|
|
|
|
|
|
my ($node) = @_; |
535
|
0
|
|
|
|
|
|
$node->{java_package} = 'java.io'; |
536
|
0
|
|
|
|
|
|
$node->{java_name} = 'Serializable'; |
537
|
0
|
|
|
|
|
|
$node->{java_Name} = 'java.io.Serializable'; |
538
|
|
|
|
|
|
|
} |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
# |
541
|
|
|
|
|
|
|
# 3.11.2 Constructed Types |
542
|
|
|
|
|
|
|
# |
543
|
|
|
|
|
|
|
# 3.11.2.1 Structures |
544
|
|
|
|
|
|
|
# |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
sub visitStructType { |
547
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
548
|
0
|
|
|
|
|
|
my ($node) = @_; |
549
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
550
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
551
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
552
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
553
|
0
|
|
|
|
|
|
foreach (@{$node->{list_member}}) { |
|
0
|
|
|
|
|
|
|
554
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); # 'Member' |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
} |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
sub visitMember { |
559
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
560
|
0
|
|
|
|
|
|
my ($node) = @_; |
561
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
562
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
563
|
0
|
|
0
|
|
|
|
while ($type->isa('TypeDeclarator') and !exists($type->{array_size})) { |
564
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
565
|
|
|
|
|
|
|
} |
566
|
0
|
0
|
0
|
|
|
|
if ($type->isa('SequenceType') or exists ($type->{array_size})) { |
567
|
0
|
|
|
|
|
|
while ($type->isa('SequenceType')) { |
568
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
569
|
0
|
|
|
|
|
|
while ($type->isa('TypeDeclarator')) { |
570
|
0
|
|
|
|
|
|
$type = $self->_get_defn($type->{type}); |
571
|
|
|
|
|
|
|
} |
572
|
|
|
|
|
|
|
} |
573
|
0
|
|
|
|
|
|
$type->visit($self); |
574
|
|
|
|
|
|
|
} |
575
|
|
|
|
|
|
|
else { |
576
|
0
|
|
|
|
|
|
$type->visit($self); |
577
|
|
|
|
|
|
|
} |
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
# 3.11.2.2 Discriminated Unions |
581
|
|
|
|
|
|
|
# |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
sub visitUnionType { |
584
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
585
|
0
|
|
|
|
|
|
my ($node) = @_; |
586
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
587
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
588
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
589
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
590
|
0
|
|
|
|
|
|
$self->_get_defn($node->{type})->visit($self); |
591
|
0
|
|
|
|
|
|
foreach (@{$node->{list_expr}}) { |
|
0
|
|
|
|
|
|
|
592
|
0
|
|
|
|
|
|
$_->visit($self); # case |
593
|
|
|
|
|
|
|
} |
594
|
|
|
|
|
|
|
} |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
sub visitCase { |
597
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
598
|
0
|
|
|
|
|
|
my ($node) = @_; |
599
|
0
|
|
|
|
|
|
foreach (@{$node->{list_label}}) { |
|
0
|
|
|
|
|
|
|
600
|
0
|
|
|
|
|
|
$_->visit($self); # default or expression |
601
|
|
|
|
|
|
|
} |
602
|
0
|
|
|
|
|
|
$node->{element}->visit($self); |
603
|
|
|
|
|
|
|
} |
604
|
|
|
|
|
|
|
|
605
|
0
|
|
|
0
|
0
|
|
sub visitDefault { |
606
|
|
|
|
|
|
|
# empty |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub visitElement { |
610
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
611
|
0
|
|
|
|
|
|
my ($node) = @_; |
612
|
0
|
|
|
|
|
|
$self->_get_defn($node->{value})->visit($self); # 'Member' |
613
|
|
|
|
|
|
|
} |
614
|
|
|
|
|
|
|
|
615
|
0
|
|
|
0
|
0
|
|
sub visitForwardStructType { |
616
|
|
|
|
|
|
|
# empty |
617
|
|
|
|
|
|
|
} |
618
|
|
|
|
|
|
|
|
619
|
0
|
|
|
0
|
0
|
|
sub visitForwardUnionType { |
620
|
|
|
|
|
|
|
# empty |
621
|
|
|
|
|
|
|
} |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
# 3.11.2.4 Enumerations |
624
|
|
|
|
|
|
|
# |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
sub visitEnumType { |
627
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
628
|
0
|
|
|
|
|
|
my ($node) = @_; |
629
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
630
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
631
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
632
|
0
|
|
|
|
|
|
foreach (@{$node->{list_expr}}) { |
|
0
|
|
|
|
|
|
|
633
|
0
|
|
|
|
|
|
$_->visit($self); # enum |
634
|
|
|
|
|
|
|
} |
635
|
|
|
|
|
|
|
} |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
sub visitEnum { |
638
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
639
|
0
|
|
|
|
|
|
my ($node) = @_; |
640
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
641
|
0
|
|
|
|
|
|
$node->{java_package} = $type->{java_Name}; |
642
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
643
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
# |
647
|
|
|
|
|
|
|
# 3.11.3 Template Types |
648
|
|
|
|
|
|
|
# |
649
|
|
|
|
|
|
|
# See 1.11 Mapping for Sequence Types |
650
|
|
|
|
|
|
|
# |
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
sub visitSequenceType { |
653
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
654
|
0
|
|
|
|
|
|
my ($node, $name) = @_; |
655
|
0
|
0
|
|
|
|
|
return if (exists $node->{java_package}); |
656
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
657
|
0
|
|
|
|
|
|
my $type = $self->_get_defn($node->{type}); |
658
|
0
|
|
|
|
|
|
$type->visit($self); |
659
|
0
|
0
|
|
|
|
|
unless (defined $name) { |
660
|
0
|
|
|
|
|
|
$name = '_seq_' . $type->{java_name}; |
661
|
0
|
0
|
|
|
|
|
if (exists $node->{max}) { |
662
|
0
|
|
|
|
|
|
$name .= '_' . $node->{max}->{value}; |
663
|
0
|
|
|
|
|
|
$name =~ s/\+//g; |
664
|
|
|
|
|
|
|
} |
665
|
|
|
|
|
|
|
} |
666
|
0
|
|
|
|
|
|
$node->{java_name} = $name; |
667
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
668
|
|
|
|
|
|
|
} |
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
# |
671
|
|
|
|
|
|
|
# See 1.12 Mapping for Strings |
672
|
|
|
|
|
|
|
# |
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
sub visitStringType { |
675
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
676
|
0
|
|
|
|
|
|
my ($node) = @_; |
677
|
0
|
|
|
|
|
|
$node->{java_package} = 'java.lang'; |
678
|
0
|
|
|
|
|
|
$node->{java_name} = 'String'; |
679
|
0
|
|
|
|
|
|
$node->{java_Name} = 'java.lang.String'; |
680
|
|
|
|
|
|
|
} |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
# |
683
|
|
|
|
|
|
|
# See 1.13 Mapping for Wide Strings |
684
|
|
|
|
|
|
|
# |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
sub visitWideStringType { |
687
|
0
|
|
|
0
|
0
|
|
shift->visitStringType(@_); |
688
|
|
|
|
|
|
|
} |
689
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
# |
691
|
|
|
|
|
|
|
# See 1.14 Mapping for Fixed |
692
|
|
|
|
|
|
|
# |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
sub visitFixedPtType { |
695
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
696
|
0
|
|
|
|
|
|
my ($node) = @_; |
697
|
0
|
|
|
|
|
|
$node->{java_package} = 'java.math'; |
698
|
0
|
|
|
|
|
|
$node->{java_name} = 'BigDecimal'; |
699
|
0
|
|
|
|
|
|
$node->{java_Name} = 'java.math.BigDecimal'; |
700
|
|
|
|
|
|
|
} |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
sub visitFixedPtConstType { |
703
|
0
|
|
|
0
|
0
|
|
shift->visitFixedPtType(@_); |
704
|
|
|
|
|
|
|
} |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
# |
707
|
|
|
|
|
|
|
# 3.12 Exception Declaration |
708
|
|
|
|
|
|
|
# |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
sub visitException { |
711
|
0
|
|
|
0
|
0
|
|
shift->visitStructType(@_); |
712
|
|
|
|
|
|
|
} |
713
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
# |
715
|
|
|
|
|
|
|
# 3.13 Operation Declaration |
716
|
|
|
|
|
|
|
# |
717
|
|
|
|
|
|
|
# See 1.4 Inheritance and Operation Names |
718
|
|
|
|
|
|
|
# |
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
sub visitOperation { |
721
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
722
|
0
|
|
|
|
|
|
my ($node) = @_; |
723
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
724
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
725
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
726
|
0
|
0
|
|
|
|
|
$self->_get_defn($node->{type})->visit($self) |
727
|
|
|
|
|
|
|
if (exists $node->{type}); # initializer or factory or finder |
728
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) { |
|
0
|
|
|
|
|
|
|
729
|
0
|
|
|
|
|
|
$_->visit($self); # parameter |
730
|
|
|
|
|
|
|
} |
731
|
|
|
|
|
|
|
} |
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
sub visitParameter { |
734
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
735
|
0
|
|
|
|
|
|
my($node) = @_; |
736
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
737
|
0
|
|
|
|
|
|
$self->_get_defn($node->{type})->visit($self); |
738
|
|
|
|
|
|
|
} |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
sub visitVoidType { |
741
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
742
|
0
|
|
|
|
|
|
my ($node) = @_; |
743
|
0
|
|
|
|
|
|
$node->{java_Name} = 'void'; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
# |
747
|
|
|
|
|
|
|
# 3.14 Attribute Declaration |
748
|
|
|
|
|
|
|
# |
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
sub visitAttributes { |
751
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
752
|
0
|
|
|
|
|
|
my ($node) = @_; |
753
|
0
|
|
|
|
|
|
foreach (@{$node->{list_decl}}) { |
|
0
|
|
|
|
|
|
|
754
|
0
|
|
|
|
|
|
$self->_get_defn($_)->visit($self); |
755
|
|
|
|
|
|
|
} |
756
|
|
|
|
|
|
|
} |
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
sub visitAttribute { |
759
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
760
|
0
|
|
|
|
|
|
my ($node) = @_; |
761
|
0
|
|
|
|
|
|
$node->{_get}->visit($self); |
762
|
0
|
0
|
|
|
|
|
$node->{_set}->visit($self) if (exists $node->{_set}); |
763
|
|
|
|
|
|
|
} |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
# |
766
|
|
|
|
|
|
|
# 3.15 Repository Identity Related Declarations |
767
|
|
|
|
|
|
|
# |
768
|
|
|
|
|
|
|
|
769
|
0
|
|
|
0
|
0
|
|
sub visitTypeId { |
770
|
|
|
|
|
|
|
# empty |
771
|
|
|
|
|
|
|
} |
772
|
|
|
|
|
|
|
|
773
|
0
|
|
|
0
|
0
|
|
sub visitTypePrefix { |
774
|
|
|
|
|
|
|
# empty |
775
|
|
|
|
|
|
|
} |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
# |
778
|
|
|
|
|
|
|
# 3.16 Event Declaration |
779
|
|
|
|
|
|
|
# |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
# |
782
|
|
|
|
|
|
|
# 3.17 Component Declaration |
783
|
|
|
|
|
|
|
# |
784
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
sub visitProvides { |
786
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
787
|
0
|
|
|
|
|
|
my ($node) = @_; |
788
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
789
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
790
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
791
|
|
|
|
|
|
|
} |
792
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
sub visitUses { |
794
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
795
|
0
|
|
|
|
|
|
my ($node) = @_; |
796
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
797
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
798
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
799
|
|
|
|
|
|
|
} |
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
sub visitPublishes { |
802
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
803
|
0
|
|
|
|
|
|
my ($node) = @_; |
804
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
805
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
806
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
807
|
|
|
|
|
|
|
} |
808
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
sub visitEmits { |
810
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
811
|
0
|
|
|
|
|
|
my ($node) = @_; |
812
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
813
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
814
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
815
|
|
|
|
|
|
|
} |
816
|
|
|
|
|
|
|
|
817
|
|
|
|
|
|
|
sub visitConsumes { |
818
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
819
|
0
|
|
|
|
|
|
my ($node) = @_; |
820
|
0
|
|
|
|
|
|
$node->{java_package} = $self->_get_pkg($node); |
821
|
0
|
|
|
|
|
|
$node->{java_name} = $self->_get_name($node); |
822
|
0
|
|
|
|
|
|
$node->{java_Name} = $self->_get_Name($node); |
823
|
|
|
|
|
|
|
} |
824
|
|
|
|
|
|
|
|
825
|
|
|
|
|
|
|
# |
826
|
|
|
|
|
|
|
# 3.18 Home Declaration |
827
|
|
|
|
|
|
|
# |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
sub visitFactory { |
830
|
0
|
|
|
0
|
0
|
|
shift->visitOperation(@_); |
831
|
|
|
|
|
|
|
} |
832
|
|
|
|
|
|
|
|
833
|
|
|
|
|
|
|
sub visitFinder { |
834
|
0
|
|
|
0
|
0
|
|
shift->visitOperation(@_); |
835
|
|
|
|
|
|
|
} |
836
|
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
1; |
838
|
|
|
|
|
|
|
|