line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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::LengthVisitor;
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
11
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
44
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.40';
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
730
|
use CORBA::C::LengthVisitor;
|
|
1
|
|
|
|
|
2262
|
|
|
1
|
|
|
|
|
27
|
|
16
|
1
|
|
|
1
|
|
5
|
use base qw(CORBA::C::LengthVisitor);
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
487
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# builds $node->{length}
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new {
|
21
|
0
|
|
|
0
|
0
|
|
my $proto = shift;
|
22
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto;
|
23
|
0
|
|
|
|
|
|
my $self = {};
|
24
|
0
|
|
|
|
|
|
bless $self, $class;
|
25
|
0
|
|
|
|
|
|
my ($parser) = @_;
|
26
|
0
|
|
|
|
|
|
$self->{srcname} = $parser->YYData->{srcname};
|
27
|
0
|
|
|
|
|
|
$self->{symbtab} = $parser->YYData->{symbtab};
|
28
|
0
|
|
|
|
|
|
$self->{done_hash} = {};
|
29
|
0
|
|
|
|
|
|
$self->{key} = 'cpp_name';
|
30
|
0
|
|
|
|
|
|
return $self;
|
31
|
|
|
|
|
|
|
}
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# See 1.9 Mapping for Structured Types
|
34
|
|
|
|
|
|
|
#
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _get_length {
|
37
|
0
|
|
|
0
|
|
|
my $self = shift;
|
38
|
0
|
|
|
|
|
|
my ($type) = @_;
|
39
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('AnyType')
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
40
|
|
|
|
|
|
|
or $type->isa('SequenceType')
|
41
|
|
|
|
|
|
|
or $type->isa('StringType')
|
42
|
|
|
|
|
|
|
or $type->isa('WideStringType')
|
43
|
|
|
|
|
|
|
or $type->isa('ObjectType')
|
44
|
|
|
|
|
|
|
or $type->isa('RegularValue')
|
45
|
|
|
|
|
|
|
or $type->isa('BoxedValue')
|
46
|
|
|
|
|
|
|
or $type->isa('AbstractValue') ) {
|
47
|
0
|
|
|
|
|
|
return 'variable';
|
48
|
|
|
|
|
|
|
}
|
49
|
0
|
0
|
0
|
|
|
|
if ( $type->isa('StructType')
|
|
|
|
0
|
|
|
|
|
50
|
|
|
|
|
|
|
or $type->isa('UnionType')
|
51
|
|
|
|
|
|
|
or $type->isa('TypeDeclarator') ) {
|
52
|
0
|
|
|
|
|
|
return $type->{length};
|
53
|
|
|
|
|
|
|
}
|
54
|
0
|
|
|
|
|
|
return undef;
|
55
|
|
|
|
|
|
|
}
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#
|
58
|
|
|
|
|
|
|
# 3.8 Interface Declaration
|
59
|
|
|
|
|
|
|
#
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub visitBaseInterface {
|
62
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
63
|
0
|
|
|
|
|
|
my ($node) = @_;
|
64
|
0
|
0
|
|
|
|
|
return if (exists $node->{length});
|
65
|
0
|
|
|
|
|
|
$node->{length} = 'variable';
|
66
|
0
|
|
|
|
|
|
foreach (@{$node->{list_export}}) {
|
|
0
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$self->{symbtab}->Lookup($_)->visit($self);
|
68
|
|
|
|
|
|
|
}
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub visitForwardBaseInterface {
|
72
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
73
|
0
|
|
|
|
|
|
my ($node) = @_;
|
74
|
0
|
0
|
|
|
|
|
return if (exists $node->{length});
|
75
|
0
|
|
|
|
|
|
$node->{length} = 'variable';
|
76
|
|
|
|
|
|
|
}
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
#
|
79
|
|
|
|
|
|
|
# 3.9 Value Declaration
|
80
|
|
|
|
|
|
|
#
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub visitStateMember {
|
83
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
84
|
0
|
|
|
|
|
|
my ($node) = @_;
|
85
|
0
|
|
|
|
|
|
$self->_get_defn($node->{type})->visit($self);
|
86
|
|
|
|
|
|
|
}
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub visitInitializer {
|
89
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
90
|
0
|
|
|
|
|
|
my ($node) = @_;
|
91
|
0
|
|
|
|
|
|
foreach (@{$node->{list_param}}) {
|
|
0
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
$self->_get_defn($_->{type})->visit($self);
|
93
|
|
|
|
|
|
|
}
|
94
|
|
|
|
|
|
|
}
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1;
|
97
|
|
|
|
|
|
|
|