line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ DOCUMENTATION ]]] |
2
|
|
|
|
|
|
|
# http://perldoc.perl.org/functions/join.html |
3
|
|
|
|
|
|
|
# SUPPORTED: join EXPR,LIST |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
6
|
|
|
|
|
|
|
package RPerl::Operation::Expression::Operator::Named::Join; |
7
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
96
|
|
8
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
92
|
|
9
|
4
|
|
|
4
|
|
21
|
use RPerl::AfterSubclass; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
524
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.003_000; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
13
|
4
|
|
|
4
|
|
27
|
use parent qw(RPerl::Operation::Expression::Operator::Named); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
23
|
|
14
|
4
|
|
|
4
|
|
218
|
use RPerl::Operation::Expression::Operator::Named; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
106
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# [[[ CRITICS ]]] |
17
|
|
|
|
|
|
|
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator |
18
|
|
|
|
|
|
|
## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils |
19
|
|
|
|
|
|
|
## no critic qw(ProhibitConstantPragma ProhibitMagicNumbers) # USER DEFAULT 3: allow constants |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# [[[ CONSTANTS ]]] |
22
|
4
|
|
|
4
|
|
18
|
use constant NAME => my string $TYPED_NAME = 'join'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
240
|
|
23
|
4
|
|
|
4
|
|
22
|
use constant ARGUMENTS_MIN => my integer $TYPED_ARGUMENTS_MIN = 2; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
191
|
|
24
|
4
|
|
|
4
|
|
26
|
use constant ARGUMENTS_MAX => my integer $TYPED_ARGUMENTS_MAX = 999; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
2567
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# [[[ OO PROPERTIES ]]] |
27
|
|
|
|
|
|
|
our hashref $properties = {}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# [[[ SUBROUTINES & OO METHODS ]]] |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub ast_to_rperl__generate { |
32
|
8
|
|
|
8
|
|
22
|
{ my string_hashref::method $RETURN_TYPE }; |
|
8
|
|
|
|
|
15
|
|
33
|
8
|
|
|
|
|
25
|
( my object $self, my object $operator_named, my string_hashref $modes) |
34
|
|
|
|
|
|
|
= @ARG; |
35
|
8
|
|
|
|
|
28
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Named::Join->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
38
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Named::Join->ast_to_rperl__generate(), received $operator_named = ' . "\n" . RPerl::Parser::rperl_ast__dump($operator_named) . "\n" ); |
39
|
|
|
|
|
|
|
|
40
|
8
|
|
|
|
|
21
|
my string $operator_named_class = ref $operator_named; |
41
|
8
|
50
|
|
|
|
44
|
if ( $operator_named_class eq 'Operation_90' ) { # Operation -> OP01_NAMED_SCOLON |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
42
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
43
|
|
|
|
|
|
|
'ERROR ECOGEASRP18, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Named operator ' |
44
|
0
|
|
|
|
|
0
|
. $operator_named->{children}->[0] |
45
|
|
|
|
|
|
|
. ' requires multiple arguments, dying' ) |
46
|
|
|
|
|
|
|
. "\n"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
elsif ( $operator_named_class eq 'Operator_94' ) { # Operator -> OP01_NAMED SubExpression |
49
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
50
|
|
|
|
|
|
|
'ERROR ECOGEASRP18, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Named operator ' |
51
|
0
|
|
|
|
|
0
|
. $operator_named->{children}->[0] |
52
|
|
|
|
|
|
|
. ' requires multiple arguments, dying' ) |
53
|
|
|
|
|
|
|
. "\n"; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
elsif ( $operator_named_class eq 'Operator_95' ) { # Operator -> LPAREN OP01_NAMED ListElement OP21_LIST_COMMA ListElements ')' |
56
|
8
|
|
|
|
|
28
|
my string $left_paren = $operator_named->{children}->[0]; |
57
|
8
|
|
|
|
|
17
|
my string $operator_name = $operator_named->{children}->[1]; |
58
|
8
|
|
|
|
|
17
|
my object $argument0 = $operator_named->{children}->[2]; |
59
|
8
|
|
|
|
|
16
|
my string $list_comma = $operator_named->{children}->[3]; |
60
|
8
|
|
|
|
|
18
|
my object $arguments = $operator_named->{children}->[4]; |
61
|
8
|
|
|
|
|
20
|
my string $right_paren = $operator_named->{children}->[5]; |
62
|
|
|
|
|
|
|
|
63
|
8
|
|
|
|
|
159
|
my integer $argument_count = $arguments->length() + 1; |
64
|
8
|
50
|
|
|
|
29
|
if ( $argument_count < ARGUMENTS_MIN() ) { |
65
|
0
|
|
|
|
|
0
|
die |
66
|
|
|
|
|
|
|
'ERROR ECOGEASRP02, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL:' |
67
|
|
|
|
|
|
|
. "\n" |
68
|
|
|
|
|
|
|
. 'Argument count ' |
69
|
|
|
|
|
|
|
. $argument_count |
70
|
|
|
|
|
|
|
. ' falls below minimum argument limit ' |
71
|
|
|
|
|
|
|
. ARGUMENTS_MIN() |
72
|
|
|
|
|
|
|
. ' for operation ' . q{'} |
73
|
|
|
|
|
|
|
. NAME() . q{'} |
74
|
|
|
|
|
|
|
. ', dying' . "\n"; |
75
|
|
|
|
|
|
|
} |
76
|
8
|
50
|
|
|
|
29
|
if ( $argument_count > ARGUMENTS_MAX() ) { |
77
|
0
|
|
|
|
|
0
|
die |
78
|
|
|
|
|
|
|
'ERROR ECOGEASRP03, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL:' |
79
|
|
|
|
|
|
|
. "\n" |
80
|
|
|
|
|
|
|
. 'Argument count ' |
81
|
|
|
|
|
|
|
. $argument_count |
82
|
|
|
|
|
|
|
. ' exceeds maximum argument limit ' |
83
|
|
|
|
|
|
|
. ARGUMENTS_MAX() |
84
|
|
|
|
|
|
|
. ' for operation ' . q{'} |
85
|
|
|
|
|
|
|
. NAME() . q{'} |
86
|
|
|
|
|
|
|
. ', dying' . "\n"; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
8
|
|
|
|
|
33
|
$rperl_source_group->{PMC} .= $left_paren . q{ } . $operator_name . q{ }; |
90
|
8
|
|
|
|
|
180
|
my string_hashref $rperl_source_subgroup = $argument0->ast_to_rperl__generate( $modes, $self ); |
91
|
8
|
|
|
|
|
188
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
92
|
8
|
|
|
|
|
33
|
$rperl_source_group->{PMC} .= $list_comma . q{ }; |
93
|
8
|
|
|
|
|
230
|
$rperl_source_subgroup = $arguments->ast_to_rperl__generate( $modes, $self ); |
94
|
8
|
|
|
|
|
198
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
95
|
8
|
|
|
|
|
30
|
$rperl_source_group->{PMC} .= q{ } . $right_paren; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
elsif ( $operator_named_class eq 'OperatorVoid_134' ) { # OperatorVoid -> OP01_NAMED ListElement OP21_LIST_COMMA ListElements ';' |
98
|
0
|
|
|
|
|
0
|
my string $operator_name = $operator_named->{children}->[0]; |
99
|
0
|
|
|
|
|
0
|
my object $argument0 = $operator_named->{children}->[1]; |
100
|
0
|
|
|
|
|
0
|
my string $list_comma = $operator_named->{children}->[2]; |
101
|
0
|
|
|
|
|
0
|
my object $arguments = $operator_named->{children}->[3]; |
102
|
0
|
|
|
|
|
0
|
my string $semicolon = $operator_named->{children}->[4]; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
my integer $argument_count = $arguments->length() + 1; |
105
|
0
|
0
|
|
|
|
0
|
if ( $argument_count < ARGUMENTS_MIN() ) { |
106
|
0
|
|
|
|
|
0
|
die |
107
|
|
|
|
|
|
|
'ERROR ECOGEASRP02, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL:' |
108
|
|
|
|
|
|
|
. "\n" |
109
|
|
|
|
|
|
|
. 'Argument count ' |
110
|
|
|
|
|
|
|
. $argument_count |
111
|
|
|
|
|
|
|
. ' falls below minimum argument limit ' |
112
|
|
|
|
|
|
|
. ARGUMENTS_MIN() |
113
|
|
|
|
|
|
|
. ' for operation ' . q{'} |
114
|
|
|
|
|
|
|
. NAME() . q{'} |
115
|
|
|
|
|
|
|
. ', dying' . "\n"; |
116
|
|
|
|
|
|
|
} |
117
|
0
|
0
|
|
|
|
0
|
if ( $argument_count > ARGUMENTS_MAX() ) { |
118
|
0
|
|
|
|
|
0
|
die |
119
|
|
|
|
|
|
|
'ERROR ECOGEASRP03, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL:' |
120
|
|
|
|
|
|
|
. "\n" |
121
|
|
|
|
|
|
|
. 'Argument count ' |
122
|
|
|
|
|
|
|
. $argument_count |
123
|
|
|
|
|
|
|
. ' exceeds maximum argument limit ' |
124
|
|
|
|
|
|
|
. ARGUMENTS_MAX() |
125
|
|
|
|
|
|
|
. ' for operation ' . q{'} |
126
|
|
|
|
|
|
|
. NAME() . q{'} |
127
|
|
|
|
|
|
|
. ', dying' . "\n"; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
0
|
$rperl_source_group->{PMC} .= $operator_name . q{ }; |
131
|
0
|
|
|
|
|
0
|
my string_hashref $rperl_source_subgroup = $argument0->ast_to_rperl__generate( $modes, $self ); |
132
|
0
|
|
|
|
|
0
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
133
|
0
|
|
|
|
|
0
|
$rperl_source_group->{PMC} .= $list_comma . q{ }; |
134
|
0
|
|
|
|
|
0
|
$rperl_source_subgroup = $arguments->ast_to_rperl__generate( $modes, $self ); |
135
|
0
|
|
|
|
|
0
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
136
|
0
|
|
|
|
|
0
|
$rperl_source_group->{PMC} .= $semicolon . "\n"; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
else { |
139
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( |
140
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
141
|
|
|
|
|
|
|
. ($operator_named_class) |
142
|
|
|
|
|
|
|
. ' found where Operation_90, Operator_94, Operator_95, or OperatorVoid_134 expected, dying' |
143
|
|
|
|
|
|
|
) . "\n"; |
144
|
|
|
|
|
|
|
} |
145
|
8
|
|
|
|
|
26
|
return $rperl_source_group; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_PERLTYPES { |
149
|
0
|
|
|
0
|
|
|
{ my string_hashref::method $RETURN_TYPE }; |
|
0
|
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @ARG; |
151
|
0
|
|
|
|
|
|
my string_hashref $cpp_source_group |
152
|
|
|
|
|
|
|
= { CPP => |
153
|
|
|
|
|
|
|
q{// <<< RP::O::E::O::N::J __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} |
154
|
|
|
|
|
|
|
. "\n" }; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
#... |
157
|
0
|
|
|
|
|
|
return $cpp_source_group; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_CPPTYPES { |
161
|
0
|
|
|
0
|
|
|
{ my string_hashref::method $RETURN_TYPE }; |
|
0
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @ARG; |
163
|
0
|
|
|
|
|
|
my string_hashref $cpp_source_group |
164
|
|
|
|
|
|
|
= { CPP => |
165
|
|
|
|
|
|
|
q{// <<< RP::O::E::O::N::J __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>} |
166
|
|
|
|
|
|
|
. "\n" }; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
#... |
169
|
0
|
|
|
|
|
|
return $cpp_source_group; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
1; # end of class |