line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::TransformerParameter::Behavior::Boolean; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
14
|
use 5.006001; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
82
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
6
|
use Perl::ToPerl6::Utils; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
16
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
796
|
use base qw{ Perl::ToPerl6::TransformerParameter::Behavior }; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
188
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _parse { |
13
|
1
|
|
|
1
|
|
2
|
my ($transformer, $parameter, $config_string) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
2
|
my $value; |
16
|
1
|
|
|
|
|
6
|
my $value_string = $parameter->get_default_string(); |
17
|
|
|
|
|
|
|
|
18
|
1
|
50
|
|
|
|
3
|
if (defined $config_string) { |
19
|
0
|
|
|
|
|
0
|
$value_string = $config_string; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
50
|
|
|
|
3
|
if ( $value_string ) { |
23
|
0
|
|
|
|
|
0
|
$value = $TRUE; |
24
|
|
|
|
|
|
|
} else { |
25
|
1
|
|
|
|
|
8
|
$value = $FALSE; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
9
|
$transformer->__set_parameter_value($parameter, $value); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
2
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub initialize_parameter { |
36
|
1
|
|
|
1
|
1
|
2
|
my ($self, $parameter, $specification) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
7
|
$parameter->_set_parser(\&_parse); |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
2
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=for stopwords |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Perl::ToPerl6::TransformerParameter::Behavior::Boolean - Actions appropriate for a boolean parameter. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Provides a standard set of functionality for a boolean |
63
|
|
|
|
|
|
|
L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter> so that |
64
|
|
|
|
|
|
|
the developer of a transformer does not have to provide it her/himself. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
NOTE: Do not instantiate this class. Use the singleton instance held |
67
|
|
|
|
|
|
|
onto by |
68
|
|
|
|
|
|
|
L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This is considered to be a non-public class. Its interface is subject |
74
|
|
|
|
|
|
|
to change without notice. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 METHODS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=over |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item C<initialize_parameter( $parameter, $specification )> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Plug in the functionality this behavior provides into the parameter. |
84
|
|
|
|
|
|
|
At present, this behavior isn't customizable by the specification. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 AUTHOR |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 COPYRIGHT |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Copyright (c) 2006-2011 Elliot Shank. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
100
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
101
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# Local Variables: |
106
|
|
|
|
|
|
|
# mode: cperl |
107
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
108
|
|
|
|
|
|
|
# fill-column: 78 |
109
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
110
|
|
|
|
|
|
|
# c-indentation-style: bsd |
111
|
|
|
|
|
|
|
# End: |
112
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |