Cplusplus/NameVisitor.pm

filter: Statementstmt 2.6% 8 / 301 Branchbran 0.0% 0 / 54 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 3.7% 2 / 53 Podpod 0.0% 0 / 48 totaltotal 2.1% 10 / 475 CC 47 SCAR 28.1
CC
47
Cov
2%
_get_ns
72.0
visitIntegerType
56.0
visitSpecification
20.0
CRAP 16.6
« Cplusplus/LiteralVisitor.pm ↑ Summary Cplusplus.pm »
1
2 #
3 # Interface Definition Language (OMG IDL CORBA v3.0)
4 #
5 # C++ Language Mapping Specification, New Edition June 1999
6 #
7
8 package CORBA::Cplusplus::NameVisitor;
9
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12
13 1 our $VERSION = '0.40';
14
15 # builds $node->{cpp_name} and $node->{cpp_ns}
16
17 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
18 0 my $proto = shift;
19 0 ▶ my $class = ref($proto) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
20 0 my $self = {};
21 0 bless $self, $class;
22 0 my ($parser) = @_;
23 0 $self->{key} = 'cpp_name';
24 0 $self->{symbtab} = $parser->YYData->{symbtab};
25 $self->{cpp_keywords} = { # See 1.43 C++ Keywords
26 0 'and' => 1,
27 'and_ep' => 1,
28 'asm' => 1,
29 'auto' => 1,
30 'bitand' => 1,
31 'bitor' => 1,
32 'bool' => 1,
33 'break' => 1,
34 #IDL 'case' => 1,
35 'catch' => 1,
36 #IDL 'char' => 1,
37 'class' => 1,
38 'compl' => 1,
39 #IDL 'const' => 1,
40 'const_cast' => 1,
41 'continue' => 1,
42 #IDL 'default' => 1,
43 'delete' => 1,
44 'do' => 1,
45 #IDL 'double' => 1,
46 'dynamic_cast' => 1,
47 'else' => 1,
48 #IDL 'enum' => 1,
49 'explicit' => 1,
50 'export' => 1,
51 'extern' => 1,
52 #IDL 'false' => 1,
53 #IDL 'float' => 1,
54 'for' => 1,
55 'friend' => 1,
56 'goto' => 1,
57 'if' => 1,
58 'inline' => 1,
59 'int' => 1,
60 #IDL 'long' => 1,
61 'mutable' => 1,
62 'namespace' => 1,
63 'new' => 1,
64 'not' => 1,
65 'not_eq' => 1,
66 'operator' => 1,
67 'or' => 1,
68 'or_eq' => 1,
69 'private' => 1,
70 'protected' => 1,
71 'public' => 1,
72 'register' => 1,
73 'reinterpret_cast' => 1,
74 'return' => 1,
75 #IDL 'short' => 1,
76 'signed' => 1,
77 'sizeof' => 1,
78 'static' => 1,
79 'static_cast' => 1,
80 #IDL 'struct' => 1,
81 #IDL 'switch' => 1,
82 'template' => 1,
83 'this' => 1,
84 'throw' => 1,
85 #IDL 'true' => 1,
86 'try' => 1,
87 #IDL 'typedef' => 1,
88 'typeid' => 1,
89 'typename' => 1,
90 #IDL 'union' => 1,
91 #IDL 'unsigned' => 1,
92 'using' => 1,
93 'virtual' => 1,
94 #IDL 'void' => 1,
95 'volatile' => 1,
96 'wchar_t' => 1,
97 'while' => 1,
98 'xor' => 1,
99 'xor_eq' => 1
100 };
101 0 return $self;
102 }
103
104 0 ▶sub _get_name { # See 1.1.2 Scoped Names
Subroutine _get_name: not called CC=2 SCAR=17.9
105 0 my $self = shift;
106 0 my ($node) = @_;
107 0 my $name = $node->{idf};
108 0 $name =~ s/^_get_//;
109 0 $name =~ s/^_set_//;
110 0 ▶ if (exists $self->{cpp_keywords}->{name}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'cpp_keywords'}{'name'}) { } 0 0 0
111 0 return '_cxx_' . $name;
112 }
113 else {
114 0 return $name;
115 }
116 }
117
118 0 ▶sub _get_ns {
Subroutine _get_ns: not called CC=8 SCAR=42.8
119 0 my $self = shift;
120 0 my ($node) = @_;
121 0 my $pkg = $node->{full};
122 0 $pkg =~ s/::[0-9A-Z_a-z]+$//;
123 0 ▶ return q{} unless ($pkg);
Branch: 1 branch
BranchTrueFalseTotal
unless $pkg 0 0 0
124 0 my $defn = $self->{symbtab}->Lookup($pkg);
125 0 ▶ if ( $defn->isa('StructType')
Branch: 1 branch
BranchTrueFalseTotal
if ($defn->isa("StructType") or $defn->isa("UnionType") or $defn->isa("ExceptionType")) 0 0 0
Condition0%0/6
$defn->isa("StructType") or $defn->isa("UnionType") or $defn->isa("ExceptionType")
l!l&&r!l&&!r
000
$defn->isa("StructType") or $defn->isa("UnionType")
l!l&&r!l&&!r
000
MC/DC0%0/3
$defn->isa("StructType") or $defn->isa("UnionType") or $defn->isa("ExceptionType")
$defn->isa("StructType") $defn->isa("UnionType") $defn->isa("ExceptionType")
Truth table0%0/4
A or B or C
A= $defn->isa("StructType")B= $defn->isa("UnionType")C= $defn->isa("ExceptionType")
ABCresult
1XX1
01X1
0011
0000
126 or $defn->isa('UnionType')
127 or $defn->isa('ExceptionType') ) {
128 0 $pkg =~ s/::[0-9A-Z_a-z]+$//;
129 }
130 0 ▶ return q{} unless ($pkg);
Branch: 1 branch
BranchTrueFalseTotal
unless $pkg 0 0 0
131 0 my $ns = q{};
132 0 $pkg =~ s/^:://;
133 0 foreach (split /::/, $pkg) {
134 0 ▶ if (exists $self->{cpp_keywords}->{$_}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'cpp_keywords'}{$_}) { } 0 0 0
135 0 $ns .= '::_cxx_' . $_;
136 }
137 else {
138 0 $ns .= '::' . $_;
139 }
140 }
141 0 $ns =~ s/^:://;
142 0 return $ns;
143 }
144
145 0 ▶sub _get_defn {
Subroutine _get_defn: not called CC=2 SCAR=17.9
146 0 my $self = shift;
147 0 my ($defn) = @_;
148 0 ▶ if (ref $defn) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $defn) { } 0 0 0
149 0 return $defn;
150 }
151 else {
152 0 return $self->{symbtab}->Lookup($defn);
153 }
154 }
155
156 #
157 # 3.5 OMG IDL Specification
158 #
159
160 0 ▶sub visitSpecification {
Subroutine visitSpecification: not called CC=4 SCAR=30.0
Pod undocumented
161 0 my $self = shift;
162 0 my ($node) = @_;
163 0 ▶ if (exists $node->{list_import}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $node->{"list_import"}) 0 0 0
164 0 foreach (@{$node->{list_import}}) {
165 0 $_->visit($self);
166 }
167 }
168 0 foreach (@{$node->{list_export}}) {
169 0 $self->{symbtab}->Lookup($_)->visit($self);
170 }
171 }
172
173 #
174 # 3.6 Import Declaration
175 #
176
177 0 ▶sub visitImport {
Subroutine visitImport: not called CC=2 SCAR=17.9
Pod undocumented
178 0 my $self = shift;
179 0 my ($node) = @_;
180 0 foreach (@{$node->{list_decl}}) {
181 0 $self->{symbtab}->Lookup($_)->visit($self);
182 }
183 }
184
185 #
186 # 3.7 Module Declaration
187 #
188
189 0 ▶sub visitModules {
Subroutine visitModules: not called CC=2 SCAR=17.9
Pod undocumented
190 0 my $self = shift;
191 0 my ($node) = @_;
192 0 my $ns_save = $self->{ns_curr};
193 0 $node->{cpp_ns} = $self->_get_ns($node);
194 0 $node->{cpp_name} = $self->_get_name($node);
195 0 foreach (@{$node->{list_export}}) {
196 0 $self->{symbtab}->Lookup($_)->visit($self);
197 }
198 }
199
200 #
201 # 3.8 Interface Declaration
202 #
203
204 0 ▶sub visitBaseInterface {
Subroutine visitBaseInterface: not called CC=3 SCAR=24.8
Pod undocumented
205 0 my $self = shift;
206 0 my ($node) = @_;
207 0 ▶ return if (exists $node->{cpp_name});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_name"} 0 0 0
208 0 $node->{cpp_ns} = $self->_get_ns($node);
209 0 $node->{cpp_name} = $self->_get_name($node);
210 0 $node->{cpp_has_ptr} = 1;
211 0 $node->{cpp_has_var} = 1;
212 0 foreach (@{$node->{list_export}}) {
213 0 $self->{symbtab}->Lookup($_)->visit($self);
214 }
215 }
216
217 0 ▶sub visitForwardBaseInterface {
Subroutine visitForwardBaseInterface: not called CC=2 SCAR=17.9
Pod undocumented
218 0 my $self = shift;
219 0 my ($node) = @_;
220 0 ▶ return if (exists $node->{cpp_name});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_name"} 0 0 0
221 0 $node->{cpp_ns} = $self->_get_ns($node);
222 0 $node->{cpp_name} = $self->_get_name($node);
223 0 $node->{cpp_has_ptr} = 1;
224 0 $node->{cpp_has_var} = 1;
225 }
226
227 #
228 # 3.9 Value Declaration
229 #
230
231 0 ▶sub visitStateMember {
Subroutine visitStateMember: not called CC=1 SCAR=6.9
Pod undocumented
232 0 my $self = shift;
233 0 my ($node) = @_;
234 0 $node->{cpp_ns} = $self->_get_ns($node);
235 0 $node->{cpp_name} = $self->_get_name($node);
236 0 $self->_get_defn($node->{type})->visit($self);
237 }
238
239 0 ▶sub visitInitializer {
Subroutine visitInitializer: not called CC=2 SCAR=17.9
Pod undocumented
240 0 my $self = shift;
241 0 my ($node) = @_;
242 0 $node->{cpp_ns} = $self->_get_ns($node);
243 0 $node->{cpp_name} = $self->_get_name($node);
244 0 foreach (@{$node->{list_param}}) {
245 0 $_->visit($self); # parameter
246 }
247 }
248
249 #
250 # 3.10 Constant Declaration
251 #
252
253 0 ▶sub visitConstant {
Subroutine visitConstant: not called CC=1 SCAR=6.9
Pod undocumented
254 0 my $self = shift;
255 0 my ($node) = @_;
256 0 $node->{cpp_ns} = $self->_get_ns($node);
257 0 $node->{cpp_name} = $self->_get_name($node);
258 0 $self->_get_defn($node->{type})->visit($self);
259 }
260
261 0 ▶sub visitExpression {
Subroutine visitExpression: not called CC=1 SCAR=0.0
Pod undocumented
262 # empty
263 }
264
265 #
266 # 3.11 Type Declaration
267 #
268
269 0 ▶sub visitTypeDeclarator {
Subroutine visitTypeDeclarator: not called CC=4 SCAR=30.0
Pod undocumented
270 0 my $self = shift;
271 0 my ($node) = @_;
272 0 ▶ return if (exists $node->{cpp_ns});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_ns"} 0 0 0
273 0 $node->{cpp_ns} = $self->_get_ns($node);
274 0 $node->{cpp_name} = $self->_get_name($node);
275 0 my $type = $self->_get_defn($node->{type});
276 0 ▶ if ($type->isa('SequenceType') and !exists $node->{array_size}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa('SequenceType') and not exists $node->{'array_size'}) { } 0 0 0
Condition0%0/3
$type->isa("SequenceType") and not exists $node->{"array_size"}
!ll&&!rl&&r
000
MC/DC0%0/2
$type->isa("SequenceType") and not exists $node->{"array_size"}
$type->isa("SequenceType") not exists $node->{"array_size"}
Truth table0%0/3
A and not(B)
A= $type->isa("SequenceType")B= not exists $node->{"array_size"}
ABresult
0X0
100
111
277 0 $type->{repos_id} = $node->{repos_id};
278 0 $node->{cpp_has_var} = 1;
279 0 $type->visit($self, $node->{cpp_name});
280 }
281 else {
282 0 $type->visit($self);
283 }
284 }
285
286 0 ▶sub visitNativeType {
Subroutine visitNativeType: not called CC=1 SCAR=6.9
Pod undocumented
287 0 my $self = shift;
288 0 my ($node) = @_;
289 0 $node->{cpp_ns} = $self->_get_ns($node);
290 0 $node->{cpp_name} = $self->_get_name($node);
291 }
292
293 #
294 # 3.11.1 Basic Types
295 #
296 # See 1.5 Mapping for Basic Data Types
297 #
298
299 0 ▶sub visitIntegerType {
Subroutine visitIntegerType: not called CC=7 SCAR=40.3
Pod undocumented
300 0 my $self = shift;
301 0 my ($node) = @_;
302 0 $node->{cpp_ns} = 'CORBA';
303 0 ▶ if ($node->{value} eq 'short') {
Branch: 6 branches
BranchTrueFalseTotal
if ($node->{'value'} eq 'short') { } 0 0 0
elsif ($node->{'value'} eq 'unsigned short') { } 0 0 0
elsif ($node->{'value'} eq 'long') { } 0 0 0
elsif ($node->{'value'} eq 'unsigned long') { } 0 0 0
elsif ($node->{'value'} eq 'long long') { } 0 0 0
elsif ($node->{'value'} eq 'unsigned long long') { } 0 0 0
304 0 $node->{cpp_name} = 'Short';
305 }
306 elsif ($node->{value} eq 'unsigned short') {
307 0 $node->{cpp_name} = 'UShort';
308 }
309 elsif ($node->{value} eq 'long') {
310 0 $node->{cpp_name} = 'Long';
311 }
312 elsif ($node->{value} eq 'unsigned long') {
313 0 $node->{cpp_name} = 'ULong';
314 }
315 elsif ($node->{value} eq 'long long') {
316 0 $node->{cpp_name} = 'LongLong';
317 }
318 elsif ($node->{value} eq 'unsigned long long') {
319 0 $node->{cpp_name} = 'ULongLong';
320 }
321 else {
322 0 warn __PACKAGE__,"::visitIntegerType $node->{value}.\n"
323 }
324 }
325
326 0 ▶sub visitFloatingPtType {
Subroutine visitFloatingPtType: not called CC=4 SCAR=30.0
Pod undocumented
327 0 my $self = shift;
328 0 my ($node) = @_;
329 0 $node->{cpp_ns} = 'CORBA';
330 0 ▶ if ($node->{value} eq 'float') {
Branch: 3 branches
BranchTrueFalseTotal
if ($node->{'value'} eq 'float') { } 0 0 0
elsif ($node->{'value'} eq 'double') { } 0 0 0
elsif ($node->{'value'} eq 'long double') { } 0 0 0
331 0 $node->{cpp_name} = 'Float';
332 }
333 elsif ($node->{value} eq 'double') {
334 0 $node->{cpp_name} = 'Double';
335 }
336 elsif ($node->{value} eq 'long double') {
337 0 $node->{cpp_name} = 'LongDouble';
338 }
339 else {
340 0 warn __PACKAGE__,"::visitFloatingPtType $node->{value}.\n"
341 }
342 }
343
344 0 ▶sub visitCharType {
Subroutine visitCharType: not called CC=1 SCAR=6.9
Pod undocumented
345 0 my $self = shift;
346 0 my ($node) = @_;
347 0 $node->{cpp_ns} = 'CORBA';
348 0 $node->{cpp_name} = 'Char';
349 }
350
351 0 ▶sub visitWideCharType {
Subroutine visitWideCharType: not called CC=1 SCAR=6.9
Pod undocumented
352 0 my $self = shift;
353 0 my ($node) = @_;
354 0 $node->{cpp_ns} = 'CORBA';
355 0 $node->{cpp_name} = 'WChar';
356 }
357
358 0 ▶sub visitBooleanType {
Subroutine visitBooleanType: not called CC=1 SCAR=6.9
Pod undocumented
359 0 my $self = shift;
360 0 my ($node) = @_;
361 0 $node->{cpp_ns} = 'CORBA';
362 0 $node->{cpp_name} = 'Boolean';
363 }
364
365 0 ▶sub visitOctetType {
Subroutine visitOctetType: not called CC=1 SCAR=6.9
Pod undocumented
366 0 my $self = shift;
367 0 my ($node) = @_;
368 0 $node->{cpp_ns} = 'CORBA';
369 0 $node->{cpp_name} = 'Octet';
370 }
371
372 0 ▶sub visitAnyType {
Subroutine visitAnyType: not called CC=1 SCAR=6.9
Pod undocumented
373 0 my $self = shift;
374 0 my ($node) = @_;
375 0 $node->{cpp_ns} = 'CORBA';
376 0 $node->{cpp_name} = 'Any';
377 0 $node->{cpp_has_var} = 1;
378 }
379
380 0 ▶sub visitObjectType {
Subroutine visitObjectType: not called CC=1 SCAR=6.9
Pod undocumented
381 0 my $self = shift;
382 0 my ($node) = @_;
383 0 $node->{cpp_ns} = 'CORBA';
384 0 $node->{cpp_name} = 'Object';
385 0 $node->{cpp_has_var} = 1;
386 }
387
388 0 ▶sub visitValueBaseType {
Subroutine visitValueBaseType: not called CC=1 SCAR=6.9
Pod undocumented
389 0 my $self = shift;
390 0 my ($node) = @_;
391 0 $node->{cpp_ns} = 'CORBA';
392 0 $node->{cpp_name} = 'ValueBase';
393 0 $node->{cpp_has_var} = 1;
394 }
395
396 #
397 # 3.11.2 Constructed Types
398 #
399 # 3.11.2.1 Structures
400 #
401
402 0 ▶sub visitStructType {
Subroutine visitStructType: not called CC=3 SCAR=24.8
Pod undocumented
403 0 my $self = shift;
404 0 my ($node) = @_;
405 0 ▶ return if (exists $node->{cpp_ns});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_ns"} 0 0 0
406 0 $node->{cpp_ns} = $self->_get_ns($node);
407 0 $node->{cpp_name} = $self->_get_name($node);
408 0 $node->{cpp_has_var} = 1;
409 0 foreach (@{$node->{list_member}}) {
410 0 $self->_get_defn($_)->visit($self); # member
411 }
412 }
413
414 0 ▶sub visitMember {
Subroutine visitMember: not called CC=1 SCAR=6.9
Pod undocumented
415 0 my $self = shift;
416 0 my ($node) = @_;
417 0 $node->{cpp_name} = $self->_get_name($node);
418 0 $self->_get_defn($node->{type})->visit($self);
419 }
420
421 # 3.11.2.2 Discriminated Unions
422 #
423
424 0 ▶sub visitUnionType {
Subroutine visitUnionType: not called CC=3 SCAR=24.8
Pod undocumented
425 0 my $self = shift;
426 0 my ($node) = @_;
427 0 ▶ return if (exists $node->{cpp_ns});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_ns"} 0 0 0
428 0 $node->{cpp_ns} = $self->_get_ns($node);
429 0 $node->{cpp_name} = $self->_get_name($node);
430 0 $node->{cpp_has_var} = 1;
431 0 $self->_get_defn($node->{type})->visit($self);
432 0 foreach (@{$node->{list_expr}}) {
433 0 $_->visit($self); # case
434 }
435 }
436
437 0 ▶sub visitCase {
Subroutine visitCase: not called CC=2 SCAR=17.9
Pod undocumented
438 0 my $self = shift;
439 0 my ($node) = @_;
440 0 foreach (@{$node->{list_label}}) {
441 0 $_->visit($self); # default or expression
442 }
443 0 $node->{element}->visit($self);
444 }
445
446 0 ▶sub visitDefault {
Subroutine visitDefault: not called CC=1 SCAR=0.0
Pod undocumented
447 # empty
448 }
449
450 0 ▶sub visitElement {
Subroutine visitElement: not called CC=1 SCAR=6.9
Pod undocumented
451 0 my $self = shift;
452 0 my ($node) = @_;
453 0 $self->_get_defn($node->{value})->visit($self); # member
454 }
455
456 # 3.11.2.4 Enumerations
457 #
458
459 0 ▶sub visitEnumType {
Subroutine visitEnumType: not called CC=2 SCAR=17.9
Pod undocumented
460 0 my $self = shift;
461 0 my ($node) = @_;
462 0 $node->{cpp_ns} = $self->_get_ns($node);
463 0 $node->{cpp_name} = $self->_get_name($node);
464 0 foreach (@{$node->{list_expr}}) {
465 0 $_->visit($self); # enum
466 }
467 }
468
469 0 ▶sub visitEnum {
Subroutine visitEnum: not called CC=1 SCAR=6.9
Pod undocumented
470 0 my $self = shift;
471 0 my ($node) = @_;
472 0 $node->{cpp_name} = $self->_get_name($node);
473 }
474
475 #
476 # 3.11.3 Template Types
477 #
478 # See 1.13 Mapping for Sequence Types
479 #
480
481 0 ▶sub visitSequenceType {
Subroutine visitSequenceType: not called CC=4 SCAR=30.0
Pod undocumented
482 0 my $self = shift;
483 0 my ($node, $name) = @_;
484 0 ▶ return if (exists $node->{cpp_ns});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_ns"} 0 0 0
485 0 $node->{cpp_ns} = $self->_get_ns($node);
486 0 my $type = $self->_get_defn($node->{type});
487 0 $type->visit($self);
488 0 ▶ unless (defined $name) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $name) 0 0 0
489 0 $name = '_seq_' . $type->{cpp_name};
490 0 ▶ if (exists $node->{max}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $node->{"max"}) 0 0 0
491 0 $name .= '_' . $node->{max}->{value};
492 0 $name =~ s/\+//g;
493 }
494 }
495 0 $node->{cpp_name} = $name;
496 }
497
498 #
499 # See 1.7 Mapping for String Types
500 #
501
502 0 ▶sub visitStringType {
Subroutine visitStringType: not called CC=1 SCAR=6.9
Pod undocumented
503 0 my $self = shift;
504 0 my ($node) = @_;
505 0 $node->{cpp_ns} = 'CORBA';
506 0 $node->{cpp_name} = 'String';
507 }
508
509 #
510 # See 1.8 Mapping for Wide String Types
511 #
512
513 0 ▶sub visitWideStringType {
Subroutine visitWideStringType: not called CC=1 SCAR=6.9
Pod undocumented
514 0 my $self = shift;
515 0 my ($node) = @_;
516 0 $node->{cpp_ns} = 'CORBA';
517 0 $node->{cpp_name} = 'WString';
518 }
519
520 #
521 #
522 #
523
524 0 ▶sub visitFixedPtType {
Subroutine visitFixedPtType: not called CC=1 SCAR=6.9
Pod undocumented
525 0 my $self = shift;
526 0 my ($node) = @_;
527 0 my $name = 'Fixed';
528 0 $node->{cpp_ns} = 'CORBA';
529 0 $node->{cpp_name} = $name;
530 }
531
532 0 ▶sub visitFixedPtConstType {
Subroutine visitFixedPtConstType: not called CC=1 SCAR=6.9
Pod undocumented
533 0 my $self = shift;
534 0 my ($node) = @_;
535 0 my $name = 'Fixed';
536 0 $node->{cpp_ns} = 'CORBA';
537 0 $node->{cpp_name} = $name;
538 }
539
540 #
541 # 3.12 Exception Declaration
542 #
543
544 0 ▶sub visitException {
Subroutine visitException: not called CC=3 SCAR=24.8
Pod undocumented
545 0 my $self = shift;
546 0 my ($node) = @_;
547 0 ▶ return if (exists $node->{cpp_ns});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"cpp_ns"} 0 0 0
548 0 $node->{cpp_ns} = $self->_get_ns($node);
549 0 $node->{cpp_name} = $self->_get_name($node);
550 0 foreach (@{$node->{list_member}}) {
551 0 $self->_get_defn($_)->visit($self); # member
552 }
553 }
554
555 #
556 # 3.13 Operation Declaration
557 #
558
559
560 0 ▶sub visitOperation {
Subroutine visitOperation: not called CC=2 SCAR=17.9
Pod undocumented
561 0 my $self = shift;
562 0 my ($node) = @_;
563 0 $node->{cpp_ns} = $self->_get_ns($node);
564 0 $node->{cpp_name} = $self->_get_name($node);
565 0 $self->_get_defn($node->{type})->visit($self);
566 0 foreach (@{$node->{list_param}}) {
567 0 $_->visit($self); # parameter
568 }
569 }
570
571 0 ▶sub visitParameter {
Subroutine visitParameter: not called CC=1 SCAR=6.9
Pod undocumented
572 0 my $self = shift;
573 0 my ($node) = @_;
574 0 $node->{cpp_name} = $self->_get_name($node);
575 0 $self->_get_defn($node->{type})->visit($self);
576 }
577
578 0 ▶sub visitVoidType {
Subroutine visitVoidType: not called CC=1 SCAR=6.9
Pod undocumented
579 0 my $self = shift;
580 0 my ($node) = @_;
581 0 $node->{cpp_name} = 'void';
582 }
583
584 #
585 # 3.14 Attribute Declaration
586 #
587
588 0 ▶sub visitAttribute {
Subroutine visitAttribute: not called CC=2 SCAR=17.9
Pod undocumented
589 0 my $self = shift;
590 0 my ($node) = @_;
591 0 $node->{_get}->visit($self);
592 0 ▶ $node->{_set}->visit($self) if (exists $node->{_set});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"_set"} 0 0 0
593 }
594
595 #
596 # 3.15 Repository Identity Related Declarations
597 #
598
599 0 ▶sub visitTypeId {
Subroutine visitTypeId: not called CC=1 SCAR=0.0
Pod undocumented
600 # empty
601 }
602
603 0 ▶sub visitTypePrefix {
Subroutine visitTypePrefix: not called CC=1 SCAR=0.0
Pod undocumented
604 # empty
605 }
606
607 #
608 # 3.16 Event Declaration
609 #
610
611 #
612 # 3.17 Component Declaration
613 #
614
615 0 ▶sub visitProvides {
Subroutine visitProvides: not called CC=1 SCAR=6.9
Pod undocumented
616 # C++ mapping is aligned with CORBA 2.3
617 0 my $self = shift;
618 0 my ($node) = @_;
619 0 $node->{cpp_ns} = $self->_get_ns($node);
620 0 $node->{cpp_name} = $self->_get_name($node);
621 }
622
623 0 ▶sub visitUses {
Subroutine visitUses: not called CC=1 SCAR=6.9
Pod undocumented
624 # C++ mapping is aligned with CORBA 2.3
625 0 my $self = shift;
626 0 my ($node) = @_;
627 0 $node->{cpp_ns} = $self->_get_ns($node);
628 0 $node->{cpp_name} = $self->_get_name($node);
629 }
630
631 0 ▶sub visitPublishes {
Subroutine visitPublishes: not called CC=1 SCAR=6.9
Pod undocumented
632 # C++ mapping is aligned with CORBA 2.3
633 0 my $self = shift;
634 0 my ($node) = @_;
635 0 $node->{cpp_ns} = $self->_get_ns($node);
636 0 $node->{cpp_name} = $self->_get_name($node);
637 }
638
639 0 ▶sub visitEmits {
Subroutine visitEmits: not called CC=1 SCAR=6.9
Pod undocumented
640 # C++ mapping is aligned with CORBA 2.3
641 0 my $self = shift;
642 0 my ($node) = @_;
643 0 $node->{cpp_ns} = $self->_get_ns($node);
644 0 $node->{cpp_name} = $self->_get_name($node);
645 }
646
647 0 ▶sub visitConsumes {
Subroutine visitConsumes: not called CC=1 SCAR=6.9
Pod undocumented
648 # C++ mapping is aligned with CORBA 2.3
649 0 my $self = shift;
650 0 my ($node) = @_;
651 0 $node->{cpp_ns} = $self->_get_ns($node);
652 0 $node->{cpp_name} = $self->_get_name($node);
653 }
654
655 #
656 # 3.18 Home Declaration
657 #
658
659 0 ▶sub visitFactory {
Subroutine visitFactory: not called CC=2 SCAR=17.9
Pod undocumented
660 # C++ mapping is aligned with CORBA 2.3
661 0 my $self = shift;
662 0 my ($node) = @_;
663 0 $node->{cpp_ns} = $self->_get_ns($node);
664 0 $node->{cpp_name} = $self->_get_name($node);
665 0 foreach (@{$node->{list_param}}) {
666 0 $_->visit($self); # parameter
667 }
668 }
669
670 0 ▶sub visitFinder {
Subroutine visitFinder: not called CC=2 SCAR=17.9
Pod undocumented
671 # C++ mapping is aligned with CORBA 2.3
672 0 my $self = shift;
673 0 my ($node) = @_;
674 0 $node->{cpp_ns} = $self->_get_ns($node);
675 0 $node->{cpp_name} = $self->_get_name($node);
676 0 foreach (@{$node->{list_param}}) {
677 0 $_->visit($self); # parameter
678 }
679 }
680
681 1 1;
682
« Cplusplus/LiteralVisitor.pm ↑ Summary Cplusplus.pm »