line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MarpaX::Languages::PowerBuilder::SRD; |
2
|
2
|
|
|
2
|
|
2010
|
use base qw(MarpaX::Languages::PowerBuilder::base); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1104
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
#a datawindow parser by Nicolas Georges |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub syntax{ |
7
|
1
|
|
|
1
|
0
|
42
|
my ($ppa, $header, $release, $containers, $binsection) = @_; |
8
|
1
|
|
|
|
|
4
|
my %attr = ( release => $release ); |
9
|
1
|
50
|
|
|
|
4
|
$attr{binary}=$binsection if defined $binsection; |
10
|
1
|
|
|
|
|
90
|
%attr = (%attr, %$_) for @$containers, $header->[1]; |
11
|
1
|
|
|
|
|
3
|
return \%attr; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
0
|
37
|
sub list{ shift, \@_ } |
15
|
|
|
|
|
|
|
|
16
|
21
|
|
|
21
|
0
|
775
|
sub keyval{ +{@_[1,2]} } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub listkeyval{ |
19
|
1
|
|
|
1
|
0
|
14
|
shift; |
20
|
1
|
|
|
|
|
2
|
my %attr; |
21
|
1
|
|
|
|
|
8
|
%attr = (%attr, %$_) for @_; |
22
|
1
|
|
|
|
|
3
|
return \%attr; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
0
|
13208
|
sub header{ { encoding => $_[0]->{encoding} = $_[1], file => $_[2] } } |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
0
|
0
|
sub comment{ { comment => $_[1] } } |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
1
|
0
|
44
|
sub release{ $_[2] } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $control_types = do{ |
32
|
|
|
|
|
|
|
my $types = join '|', qw(column text bitmap button |
33
|
|
|
|
|
|
|
compute ellipse graph groupbox |
34
|
|
|
|
|
|
|
inkpic line ole rectangle |
35
|
|
|
|
|
|
|
report roundrectangle tableblob); |
36
|
|
|
|
|
|
|
qr/^($types)$/io; |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub containers{ |
40
|
1
|
|
|
1
|
0
|
38
|
my (undef, @containers ) =@_; |
41
|
1
|
|
|
|
|
2
|
my @controls = map { (%$_)[1]->{type} = (%$_)[0]; values %$_ } grep { (%$_)[0] =~ $control_types } @containers; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
10
|
|
|
22
|
|
|
|
|
90
|
|
42
|
1
|
|
|
|
|
2
|
@containers = grep { (%$_)[0] !~ $control_types } @containers; |
|
22
|
|
|
|
|
78
|
|
43
|
|
|
|
|
|
|
# die Dumper( \@containers ); |
44
|
1
|
50
|
|
|
|
4
|
if(@controls){ |
45
|
|
|
|
|
|
|
# die Dumper(\@controls); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#add index to columns controls |
48
|
1
|
|
|
|
|
2
|
my $id = 1; |
49
|
1
|
|
|
|
|
3
|
$_->{'#'} = $id++ for grep {$_->{type} eq 'column'} @controls; |
|
4
|
|
|
|
|
11
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#inject a name to pre-7 texts that have no name (PB call them obj_xxx at runtime) |
52
|
1
|
|
|
|
|
2
|
$id = 1; |
53
|
1
|
100
|
|
|
|
2
|
$_->{'name'} = 't_'.$id++ for grep {$_->{type} eq 'text' && !$_->{name}} @controls; |
|
4
|
|
|
|
|
15
|
|
54
|
1
|
|
|
|
|
2
|
my %ctls; |
55
|
1
|
|
|
|
|
6
|
$ctls{$_->{name}}=$_ for @controls; |
56
|
1
|
|
|
|
|
3
|
push @containers, { controls => \%ctls }; |
57
|
|
|
|
|
|
|
} |
58
|
1
|
|
|
|
|
4
|
return \@containers; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub attributes{ |
62
|
23
|
|
|
23
|
0
|
765
|
shift; |
63
|
23
|
|
|
|
|
30
|
my %attr; |
64
|
23
|
|
|
|
|
37
|
my @cols = map{ $_->{columns} } grep { exists $_->{columns} } @_; |
|
2
|
|
|
|
|
5
|
|
|
156
|
|
|
|
|
236
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#inject a column id into the column list |
67
|
23
|
|
|
|
|
32
|
my $id = 1; |
68
|
23
|
|
|
|
|
37
|
for (@cols){ |
69
|
2
|
|
|
|
|
16
|
(values %$_)[0]{'#'} = $id++; #FIXME: ???! is it the perlish way to do ? |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
23
|
100
|
|
|
|
46
|
$attr{columns} = listkeyval( undef, @cols ) if @cols; |
73
|
23
|
|
|
|
|
29
|
%attr = (%attr, %$_) for grep { !exists $_->{columns} } @_; |
|
156
|
|
|
|
|
994
|
|
74
|
23
|
|
|
|
|
50
|
return \%attr; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub colattribute{ |
78
|
2
|
|
|
2
|
0
|
72
|
my ($ppa, $name, undef, $value) = @_; |
79
|
2
|
|
|
|
|
9
|
return { columns => { $value->{name} => $value } }; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub attribute{ |
83
|
154
|
|
|
154
|
0
|
5132
|
my ($ppa, $name, undef, $value) = @_; |
84
|
154
|
|
|
|
|
413
|
return {$name => $value}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub data{ |
88
|
1
|
|
|
1
|
0
|
34
|
my ($ppa, $name, undef, $values, undef) = @_; |
89
|
1
|
|
|
|
|
3
|
return {data => $values}; |
90
|
|
|
|
|
|
|
#~ return $ppa->{data}=$values; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
2
|
|
|
2
|
0
|
71
|
sub datatype{ shift; join '', @_ } |
|
2
|
|
|
|
|
5
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub string{ |
96
|
102
|
|
|
102
|
0
|
3425
|
my ($ppa, $str) = @_; |
97
|
102
|
|
|
|
|
133
|
if(1){#unquote string |
98
|
102
|
|
|
|
|
365
|
$str =~ s/^"|"$//g; |
99
|
102
|
|
|
|
|
177
|
$str =~ s/~(.)/$1/g; |
100
|
|
|
|
|
|
|
} |
101
|
102
|
|
|
|
|
191
|
return $str; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |