C/LengthVisitor.pm

filter: Statementstmt 5.5% 8 / 144 Branchbran 0.0% 0 / 34 Conditioncond 0.0% 0 / 111 MC/DCmcdc 0.0% 0 / 48 Subroutinesub 5.4% 2 / 37 Podpod 0.0% 0 / 33 totaltotal 2.4% 10 / 407 CC 67 SCAR 41.4
CC
67
Cov
3%
visitUnionType
156.0
visitStructType
132.0
visitException
110.0
CRAP 62.7
« C/LiteralVisitor.pm ↑ Summary C/SkeletonVisitor.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::C::LengthVisitor;
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 = '2.60';
14
15 # builds $node->{length}
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->{srcname} = $parser->YYData->{srcname};
24 0 $self->{symbtab} = $parser->YYData->{symbtab};
25 0 $self->{done_hash} = {};
26 0 $self->{key} = 'c_name';
27 0 return $self;
28 }
29
30 0 ▶sub _get_defn {
Subroutine _get_defn: not called CC=2 SCAR=17.9
31 0 my $self = shift;
32 0 my ($defn) = @_;
33 0 ▶ if (ref $defn) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $defn) { } 0 0 0
34 0 return $defn;
35 }
36 else {
37 0 return $self->{symbtab}->Lookup($defn);
38 }
39 }
40
41 # See 1.8 Mapping Considerations for Constructed Types
42 #
43
44 0 ▶sub _get_length {
Subroutine _get_length: not called CC=9 SCAR=45.0
45 0 my $self = shift;
46 0 my ($type) = @_;
47 0 ▶ if ( $type->isa('AnyType')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType")) 0 0 0
Condition0%0/12
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType")
l!l&&r!l&&!r
000
$type->isa("AnyType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
MC/DC0%0/5
$type->isa("AnyType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("ObjectType")
$type->isa("AnyType") $type->isa("SequenceType") $type->isa("StringType") $type->isa("WideStringType") $type->isa("ObjectType")
Truth table0%0/6
A or B or C or D or E
A= $type->isa("AnyType")B= $type->isa("SequenceType")C= $type->isa("StringType")D= $type->isa("WideStringType")E= $type->isa("ObjectType")
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
48 or $type->isa('SequenceType')
49 or $type->isa('StringType')
50 or $type->isa('WideStringType')
51 or $type->isa('ObjectType') ) {
52 0 return 'variable';
53 }
54 0 ▶ if ( $type->isa('StructType')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")) 0 0 0
Condition0%0/6
$type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")
l!l&&r!l&&!r
000
$type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
MC/DC0%0/3
$type->isa("StructType") or $type->isa("UnionType") or $type->isa("TypeDeclarator")
$type->isa("StructType") $type->isa("UnionType") $type->isa("TypeDeclarator")
Truth table0%0/4
A or B or C
A= $type->isa("StructType")B= $type->isa("UnionType")C= $type->isa("TypeDeclarator")
ABCresult
1XX1
01X1
0011
0000
55 or $type->isa('UnionType')
56 or $type->isa('TypeDeclarator') ) {
57 0 return $type->{length};
58 }
59 0 return undef;
60 }
61
62 #
63 # 3.5 OMG IDL Specification
64 #
65
66 0 ▶sub visitSpecification {
Subroutine visitSpecification: not called CC=4 SCAR=30.0
Pod undocumented
67 0 my $self = shift;
68 0 my ($node) = @_;
69 0 ▶ if (exists $node->{list_import}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $node->{"list_import"}) 0 0 0
70 0 foreach (@{$node->{list_import}}) {
71 0 $_->visit($self);
72 }
73 }
74 0 foreach (@{$node->{list_export}}) {
75 0 $self->{symbtab}->Lookup($_)->visit($self);
76 }
77 }
78
79 #
80 # 3.6 Import Declaration
81 #
82
83 0 ▶sub visitImport {
Subroutine visitImport: not called CC=2 SCAR=17.9
Pod undocumented
84 0 my $self = shift;
85 0 my ($node) = @_;
86 0 foreach (@{$node->{list_decl}}) {
87 0 $self->{symbtab}->Lookup($_)->visit($self);
88 }
89 }
90
91 #
92 # 3.7 Module Declaration
93 #
94
95 0 ▶sub visitModules {
Subroutine visitModules: not called CC=2 SCAR=17.9
Pod undocumented
96 0 my $self = shift;
97 0 my ($node) = @_;
98 0 foreach (@{$node->{list_export}}) {
99 0 $self->{symbtab}->Lookup($_)->visit($self);
100 }
101 }
102
103 #
104 # 3.8 Interface Declaration
105 #
106
107 0 ▶sub visitBaseInterface {
Subroutine visitBaseInterface: not called CC=3 SCAR=24.8
Pod undocumented
108 0 my $self = shift;
109 0 my ($node) = @_;
110 0 ▶ return if (exists $node->{length});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"length"} 0 0 0
111 # $node->{length} = 'variable';
112 # TODO : $self->{done}->{} ???
113 0 $node->{length} = q{}; # void* = CORBA_unsigned_long
114 0 foreach (@{$node->{list_export}}) {
115 0 $self->{symbtab}->Lookup($_)->visit($self);
116 }
117 }
118
119 0 ▶sub visitForwardBaseInterface {
Subroutine visitForwardBaseInterface: not called CC=2 SCAR=17.9
Pod undocumented
120 0 my $self = shift;
121 0 my ($node) = @_;
122 0 ▶ return if (exists $node->{length});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"length"} 0 0 0
123 # $node->{length} = 'variable';
124 0 $node->{length} = q{}; # void* = CORBA_unsigned_long
125 }
126
127 #
128 # 3.9 Value Declaration
129 #
130
131 0 ▶sub visitStateMember {
Subroutine visitStateMember: not called CC=1 SCAR=6.9
Pod undocumented
132 # C mapping is aligned with CORBA 2.1
133 0 my $self = shift;
134 0 my ($node) = @_;
135 0 $self->_get_defn($node->{type})->visit($self);
136 }
137
138 0 ▶sub visitInitializer {
Subroutine visitInitializer: not called CC=2 SCAR=17.9
Pod undocumented
139 # C mapping is aligned with CORBA 2.1
140 0 my $self = shift;
141 0 my ($node) = @_;
142 0 foreach (@{$node->{list_param}}) {
143 0 $self->_get_defn($_->{type})->visit($self);
144 }
145 }
146
147 #
148 # 3.10 Constant Declaration
149 #
150
151 0 ▶sub visitConstant {
Subroutine visitConstant: not called CC=1 SCAR=0.0
Pod undocumented
152 }
153
154 #
155 # 3.11 Type Declaration
156 #
157
158 0 ▶sub visitTypeDeclarator {
Subroutine visitTypeDeclarator: not called CC=7 SCAR=40.3
Pod undocumented
159 0 my $self = shift;
160 0 my ($node) = @_;
161 0 my $type = $self->_get_defn($node->{type});
162 0 ▶ if ( $type->isa('TypeDeclarator')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("EnumType") or $type->isa("SequenceType") or $type->isa("FixedPtType")) 0 0 0
Condition0%0/15
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("EnumType") or $type->isa("SequenceType") or $type->isa("FixedPtType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("EnumType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("EnumType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType")
l!l&&r!l&&!r
000
MC/DC0%0/6
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("EnumType") or $type->isa("SequenceType") or $type->isa("FixedPtType")
$type->isa("TypeDeclarator") $type->isa("StructType") $type->isa("UnionType") $type->isa("EnumType") $type->isa("SequenceType") $type->isa("FixedPtType")
Truth table0%0/7
A or B or C or D or E or F
A= $type->isa("TypeDeclarator")B= $type->isa("StructType")C= $type->isa("UnionType")D= $type->isa("EnumType")E= $type->isa("SequenceType")F= $type->isa("FixedPtType")
ABCDEFresult
1XXXXX1
01XXXX1
001XXX1
0001XX1
00001X1
0000011
0000000
163 or $type->isa('StructType')
164 or $type->isa('UnionType')
165 or $type->isa('EnumType')
166 or $type->isa('SequenceType')
167 or $type->isa('FixedPtType') ) {
168 0 $type->visit($self);
169 }
170 0 $node->{length} = $self->_get_length($type);
171 }
172
173 0 ▶sub visitNativeType {
Subroutine visitNativeType: not called CC=1 SCAR=0.0
Pod undocumented
174 # C mapping is aligned with CORBA 2.1
175 }
176
177 #
178 # 3.11.1 Basic Types
179 #
180
181 0 ▶sub visitBasicType {
Subroutine visitBasicType: not called CC=1 SCAR=0.0
Pod undocumented
182 # fixed length
183 }
184
185 #
186 # 3.11.2 Constructed Types
187 #
188 # 3.11.2.1 Structures
189 #
190
191 0 ▶sub visitStructType {
Subroutine visitStructType: not called CC=11 SCAR=48.8
Pod undocumented
192 0 my $self = shift;
193 0 my ($node) = @_;
194 0 ▶ return if (exists $self->{done_hash}->{$node->{$self->{key}}});
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"done_hash"}{$$node{$self->{"key"}}} 0 0 0
195 0 $self->{done_hash}->{$node->{$self->{key}}} = 1;
196 0 $node->{length} = undef;
197 0 foreach (@{$node->{list_expr}}) {
198 0 my $type = $self->_get_defn($_->{type});
199 0 ▶ if ( $type->isa('TypeDeclarator')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")) 0 0 0
Condition0%0/18
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType")
l!l&&r!l&&!r
000
MC/DC0%0/7
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
$type->isa("TypeDeclarator") $type->isa("StructType") $type->isa("UnionType") $type->isa("SequenceType") $type->isa("StringType") $type->isa("WideStringType") $type->isa("FixedPtType")
Truth table0%0/8
A or B or C or D or E or F or G
A= $type->isa("TypeDeclarator")B= $type->isa("StructType")C= $type->isa("UnionType")D= $type->isa("SequenceType")E= $type->isa("StringType")F= $type->isa("WideStringType")G= $type->isa("FixedPtType")
ABCDEFGresult
1XXXXXX1
01XXXXX1
001XXXX1
0001XXX1
00001XX1
000001X1
00000011
00000000
200 or $type->isa('StructType')
201 or $type->isa('UnionType')
202 or $type->isa('SequenceType')
203 or $type->isa('StringType')
204 or $type->isa('WideStringType')
205 or $type->isa('FixedPtType') ) {
206 0 $type->visit($self);
207 }
208 0 ▶ $node->{length} ||= $self->_get_length($type);
Condition0%0/3
$node->{"length"} ||= $self->_get_length($type)
l!l&&r!l&&!r
000
MC/DC0%0/2
$node->{"length"} ||= $self->_get_length($type)
$node->{"length"} $self->_get_length($type)
Truth table0%0/3
A ||= B
A= $node->{"length"}B= $self->_get_length($type)
ABresult
1X1
011
000
209 }
210 }
211
212 # 3.11.2.2 Discriminated Unions
213 #
214
215 0 ▶sub visitUnionType {
Subroutine visitUnionType: not called CC=12 SCAR=50.5
Pod undocumented
216 0 my $self = shift;
217 0 my ($node) = @_;
218 0 ▶ return if (exists $self->{done_hash}->{$node->{$self->{key}}});
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"done_hash"}{$$node{$self->{"key"}}} 0 0 0
219 0 $self->{done_hash}->{$node->{$self->{key}}} = 1;
220 0 $node->{length} = undef;
221 0 foreach (@{$node->{list_expr}}) {
222 0 my $type = $self->_get_defn($_->{element}->{type});
223 0 ▶ if ( $type->isa('TypeDeclarator')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")) 0 0 0
Condition0%0/18
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType")
l!l&&r!l&&!r
000
MC/DC0%0/7
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
$type->isa("TypeDeclarator") $type->isa("StructType") $type->isa("UnionType") $type->isa("SequenceType") $type->isa("StringType") $type->isa("WideStringType") $type->isa("FixedPtType")
Truth table0%0/8
A or B or C or D or E or F or G
A= $type->isa("TypeDeclarator")B= $type->isa("StructType")C= $type->isa("UnionType")D= $type->isa("SequenceType")E= $type->isa("StringType")F= $type->isa("WideStringType")G= $type->isa("FixedPtType")
ABCDEFGresult
1XXXXXX1
01XXXXX1
001XXXX1
0001XXX1
00001XX1
000001X1
00000011
00000000
224 or $type->isa('StructType')
225 or $type->isa('UnionType')
226 or $type->isa('SequenceType')
227 or $type->isa('StringType')
228 or $type->isa('WideStringType')
229 or $type->isa('FixedPtType') ) {
230 0 $type->visit($self);
231 }
232 0 ▶ $node->{length} ||= $self->_get_length($type);
Condition0%0/3
$node->{"length"} ||= $self->_get_length($type)
l!l&&r!l&&!r
000
MC/DC0%0/2
$node->{"length"} ||= $self->_get_length($type)
$node->{"length"} $self->_get_length($type)
Truth table0%0/3
A ||= B
A= $node->{"length"}B= $self->_get_length($type)
ABresult
1X1
011
000
233 }
234 0 my $type = $self->_get_defn($node->{type});
235 0 ▶ if ($type->isa('EnumType')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("EnumType")) 0 0 0
236 0 $type->visit($self);
237 }
238 }
239
240 # 3.11.2.4 Enumerations
241 #
242
243 0 ▶sub visitEnumType {
Subroutine visitEnumType: not called CC=1 SCAR=0.0
Pod undocumented
244 # fixed length
245 }
246
247 #
248 # 3.11.3 Template Types
249 #
250
251 0 ▶sub visitSequenceType {
Subroutine visitSequenceType: not called CC=8 SCAR=42.8
Pod undocumented
252 0 my $self = shift;
253 0 my ($node) = @_;
254 0 $node->{length} = 'variable';
255 0 my $type = $self->_get_defn($node->{type});
256 0 ▶ if ( $type->isa('TypeDeclarator')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")) 0 0 0
Condition0%0/18
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType")
l!l&&r!l&&!r
000
MC/DC0%0/7
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("StringType") or $type->isa("WideStringType") or $type->isa("FixedPtType")
$type->isa("TypeDeclarator") $type->isa("StructType") $type->isa("UnionType") $type->isa("SequenceType") $type->isa("StringType") $type->isa("WideStringType") $type->isa("FixedPtType")
Truth table0%0/8
A or B or C or D or E or F or G
A= $type->isa("TypeDeclarator")B= $type->isa("StructType")C= $type->isa("UnionType")D= $type->isa("SequenceType")E= $type->isa("StringType")F= $type->isa("WideStringType")G= $type->isa("FixedPtType")
ABCDEFGresult
1XXXXXX1
01XXXXX1
001XXXX1
0001XXX1
00001XX1
000001X1
00000011
00000000
257 or $type->isa('StructType')
258 or $type->isa('UnionType')
259 or $type->isa('SequenceType')
260 or $type->isa('StringType')
261 or $type->isa('WideStringType')
262 or $type->isa('FixedPtType') ) {
263 0 $type->visit($self);
264 }
265 }
266
267 0 ▶sub visitStringType {
Subroutine visitStringType: not called CC=1 SCAR=6.9
Pod undocumented
268 0 my $self = shift;
269 0 my ($node) = @_;
270 0 $node->{length} = 'variable';
271 }
272
273 0 ▶sub visitWideStringType {
Subroutine visitWideStringType: not called CC=1 SCAR=6.9
Pod undocumented
274 0 my $self = shift;
275 0 my ($node) = @_;
276 0 $node->{length} = 'variable';
277 }
278
279 0 ▶sub visitFixedPtType {
Subroutine visitFixedPtType: not called CC=1 SCAR=0.0
Pod undocumented
280 # fixed length
281 }
282
283 0 ▶sub visitFixedPtConstType {
Subroutine visitFixedPtConstType: not called CC=1 SCAR=0.0
Pod undocumented
284 # fixed length
285 }
286
287 #
288 # 3.12 Exception Declaration
289 #
290
291 0 ▶sub visitException {
Subroutine visitException: not called CC=10 SCAR=47.0
Pod undocumented
292 0 my $self = shift;
293 0 my ($node) = @_;
294 0 $node->{length} = undef;
295 0 ▶ if (exists $node->{list_expr}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $node->{"list_expr"}) 0 0 0
296 warn __PACKAGE__,"::visitException $node->{idf} : empty list_expr.\n"
297 0 ▶ unless (@{$node->{list_expr}});
Branch: 1 branch
BranchTrueFalseTotal
unless @{$node->{"list_expr"};} 0 0 0
298 0 foreach (@{$node->{list_expr}}) {
299 0 my $type = $self->_get_defn($_->{type});
300 0 ▶ if ( $type->isa('TypeDeclarator')
Branch: 1 branch
BranchTrueFalseTotal
if ($type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("FixedPtType")) 0 0 0
Condition0%0/12
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("FixedPtType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType")
l!l&&r!l&&!r
000
$type->isa("TypeDeclarator") or $type->isa("StructType")
l!l&&r!l&&!r
000
MC/DC0%0/5
$type->isa("TypeDeclarator") or $type->isa("StructType") or $type->isa("UnionType") or $type->isa("SequenceType") or $type->isa("FixedPtType")
$type->isa("TypeDeclarator") $type->isa("StructType") $type->isa("UnionType") $type->isa("SequenceType") $type->isa("FixedPtType")
Truth table0%0/6
A or B or C or D or E
A= $type->isa("TypeDeclarator")B= $type->isa("StructType")C= $type->isa("UnionType")D= $type->isa("SequenceType")E= $type->isa("FixedPtType")
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
301 or $type->isa('StructType')
302 or $type->isa('UnionType')
303 or $type->isa('SequenceType')
304 or $type->isa('FixedPtType') ) {
305 0 $type->visit($self);
306 }
307 0 ▶ $node->{length} ||= $self->_get_length($type);
Condition0%0/3
$node->{"length"} ||= $self->_get_length($type)
l!l&&r!l&&!r
000
MC/DC0%0/2
$node->{"length"} ||= $self->_get_length($type)
$node->{"length"} $self->_get_length($type)
Truth table0%0/3
A ||= B
A= $node->{"length"}B= $self->_get_length($type)
ABresult
1X1
011
000
308 }
309 }
310 }
311
312 #
313 # 3.13 Operation Declaration
314 #
315
316 0 ▶sub visitOperation {
Subroutine visitOperation: not called CC=2 SCAR=17.9
Pod undocumented
317 0 my $self = shift;
318 0 my ($node) = @_;
319 0 my $type = $self->_get_defn($node->{type});
320 0 $type->visit($self);
321 0 foreach (@{$node->{list_param}}) {
322 0 $self->_get_defn($_->{type})->visit($self);
323 }
324 }
325
326 0 ▶sub visitVoidType {
Subroutine visitVoidType: not called CC=1 SCAR=0.0
Pod undocumented
327 # empty
328 }
329
330 #
331 # 3.14 Attribute Declaration
332 #
333
334 0 ▶sub visitAttribute {
Subroutine visitAttribute: not called CC=2 SCAR=17.9
Pod undocumented
335 0 my $self = shift;
336 0 my ($node) = @_;
337 0 $node->{_get}->visit($self);
338 0 ▶ $node->{_set}->visit($self) if (exists $node->{_set});
Branch: 1 branch
BranchTrueFalseTotal
if exists $node->{"_set"} 0 0 0
339 }
340
341 #
342 # 3.15 Repository Identity Related Declarations
343 #
344
345 0 ▶sub visitTypeId {
Subroutine visitTypeId: not called CC=1 SCAR=0.0
Pod undocumented
346 # empty
347 }
348
349 0 ▶sub visitTypePrefix {
Subroutine visitTypePrefix: not called CC=1 SCAR=0.0
Pod undocumented
350 # empty
351 }
352
353 #
354 # 3.16 Event Declaration
355 #
356
357 #
358 # 3.17 Component Declaration
359 #
360
361 0 ▶sub visitProvides {
Subroutine visitProvides: not called CC=1 SCAR=0.0
Pod undocumented
362 # empty
363 }
364
365 0 ▶sub visitUses {
Subroutine visitUses: not called CC=1 SCAR=0.0
Pod undocumented
366 # empty
367 }
368
369 0 ▶sub visitPublishes {
Subroutine visitPublishes: not called CC=1 SCAR=0.0
Pod undocumented
370 # empty
371 }
372
373 0 ▶sub visitEmits {
Subroutine visitEmits: not called CC=1 SCAR=0.0
Pod undocumented
374 # empty
375 }
376
377 0 ▶sub visitConsumes {
Subroutine visitConsumes: not called CC=1 SCAR=0.0
Pod undocumented
378 # empty
379 }
380
381 #
382 # 3.18 Home Declaration
383 #
384
385 0 ▶sub visitFactory {
Subroutine visitFactory: not called CC=2 SCAR=17.9
Pod undocumented
386 # C mapping is aligned with CORBA 2.1
387 0 my $self = shift;
388 0 my ($node) = @_;
389 0 foreach (@{$node->{list_param}}) {
390 0 $self->_get_defn($_->{type})->visit($self);
391 }
392 }
393
394 0 ▶sub visitFinder {
Subroutine visitFinder: not called CC=2 SCAR=17.9
Pod undocumented
395 # C mapping is aligned with CORBA 2.1
396 0 my $self = shift;
397 0 my ($node) = @_;
398 0 foreach (@{$node->{list_param}}) {
399 0 $self->_get_defn($_->{type})->visit($self);
400 }
401 }
402
403 1 1;
404
« C/LiteralVisitor.pm ↑ Summary C/SkeletonVisitor.pm »