line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Operation::Expression::SubroutineCall::MethodCall; |
3
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
93
|
|
4
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
78
|
|
5
|
4
|
|
|
4
|
|
19
|
use RPerl::AfterSubclass; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
481
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.002_100; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
4
|
|
|
4
|
|
24
|
use parent qw(RPerl::Operation::Expression::SubroutineCall); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
22
|
|
10
|
4
|
|
|
4
|
|
277
|
use RPerl::Operation::Expression::SubroutineCall; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1603
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# [[[ CRITICS ]]] |
13
|
|
|
|
|
|
|
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator |
14
|
|
|
|
|
|
|
## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# [[[ OO PROPERTIES ]]] |
17
|
|
|
|
|
|
|
our hashref $properties = {}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# [[[ SUBROUTINES & OO METHODS ]]] |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub ast_to_rperl__generate { |
22
|
37
|
|
|
37
|
|
77
|
{ my string_hashref::method $RETURN_TYPE }; |
|
37
|
|
|
|
|
62
|
|
23
|
37
|
|
|
|
|
95
|
( my object $self, my string_hashref $modes) = @ARG; |
24
|
37
|
|
|
|
|
107
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
25
|
37
|
|
|
|
|
73
|
my string_hashref $rperl_source_subgroup; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# RPerl::diag( 'in MethodCall->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
28
|
|
|
|
|
|
|
|
29
|
37
|
50
|
|
|
|
127
|
if ( ( ref $self ) ne 'Expression_147' ) { |
30
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( |
31
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
32
|
|
|
|
|
|
|
. ( ref $self ) |
33
|
|
|
|
|
|
|
. ' found where Expression_147 expected, dying' ) |
34
|
|
|
|
|
|
|
. "\n"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Expression -> Variable OP02_METHOD_THINARROW LPAREN OPTIONAL-34 ')' |
38
|
37
|
|
|
|
|
111
|
my object $variable = $self->{children}->[0]; |
39
|
37
|
|
|
|
|
82
|
my string $thin_arrow_name = $self->{children}->[1]; |
40
|
37
|
|
|
|
|
74
|
my string $left_paren = $self->{children}->[2]; |
41
|
37
|
|
|
|
|
84
|
my object $arguments_optional = $self->{children}->[3]; |
42
|
37
|
|
|
|
|
71
|
my string $right_paren = $self->{children}->[4]; |
43
|
|
|
|
|
|
|
|
44
|
37
|
|
|
|
|
706
|
$rperl_source_subgroup = $variable->ast_to_rperl__generate($modes); |
45
|
37
|
|
|
|
|
674
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
46
|
|
|
|
|
|
|
|
47
|
37
|
|
|
|
|
95
|
$rperl_source_group->{PMC} .= $thin_arrow_name . $left_paren; |
48
|
|
|
|
|
|
|
|
49
|
37
|
100
|
|
|
|
118
|
if ( exists $arguments_optional->{children}->[0] ) { |
50
|
22
|
|
|
|
|
488
|
$rperl_source_subgroup = $arguments_optional->{children}->[0]->ast_to_rperl__generate($modes); |
51
|
22
|
|
|
|
|
428
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
37
|
|
|
|
|
74
|
$rperl_source_group->{PMC} .= $right_paren; |
55
|
37
|
|
|
|
|
186
|
return $rperl_source_group; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_PERLTYPES { |
59
|
0
|
|
|
0
|
|
|
{ my string_hashref::method $RETURN_TYPE }; |
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @ARG; |
61
|
0
|
|
|
|
|
|
my string_hashref $cpp_source_group |
62
|
|
|
|
|
|
|
= { CPP => |
63
|
|
|
|
|
|
|
q{// <<< RP::O::E::SC::MC __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} |
64
|
|
|
|
|
|
|
. "\n" }; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#... |
67
|
0
|
|
|
|
|
|
return $cpp_source_group; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_CPPTYPES { |
71
|
0
|
|
|
0
|
|
|
{ my string_hashref::method $RETURN_TYPE }; |
|
0
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @ARG; |
73
|
0
|
|
|
|
|
|
my string_hashref $cpp_source_group = { CPP => q{} }; |
74
|
0
|
|
|
|
|
|
my string_hashref $cpp_source_subgroup; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# RPerl::diag( 'in MethodCall->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
77
|
|
|
|
|
|
|
|
78
|
0
|
0
|
|
|
|
|
if ( ( ref $self ) ne 'Expression_147' ) { |
79
|
0
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
80
|
|
|
|
|
|
|
'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO CPP: Grammar rule ' |
81
|
|
|
|
|
|
|
. ( ref $self ) |
82
|
|
|
|
|
|
|
. ' found where Expression_147 expected, dying' ) |
83
|
|
|
|
|
|
|
. "\n"; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# Expression -> Variable OP02_METHOD_THINARROW LPAREN OPTIONAL-34 ')' |
87
|
0
|
|
|
|
|
|
my object $variable = $self->{children}->[0]; |
88
|
0
|
|
|
|
|
|
my string $thin_arrow_name = $self->{children}->[1]; |
89
|
0
|
|
|
|
|
|
my string $left_paren = $self->{children}->[2]; |
90
|
0
|
|
|
|
|
|
my object $arguments_optional = $self->{children}->[3]; |
91
|
0
|
|
|
|
|
|
my string $right_paren = $self->{children}->[4]; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
$cpp_source_subgroup = $variable->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
94
|
0
|
|
|
|
|
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
95
|
|
|
|
|
|
|
|
96
|
0
|
0
|
|
|
|
|
if ($thin_arrow_name eq '->get_raw') { |
|
|
0
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
$cpp_source_group->{CPP} .= '.get_raw' . $left_paren; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
elsif ($thin_arrow_name eq '->set_raw') { |
100
|
0
|
|
|
|
|
|
$cpp_source_group->{CPP} .= '.set_raw' . $left_paren; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
else { |
103
|
0
|
|
|
|
|
|
$cpp_source_group->{CPP} .= $thin_arrow_name . $left_paren; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
0
|
0
|
|
|
|
|
if ( exists $arguments_optional->{children}->[0] ) { |
107
|
0
|
|
|
|
|
|
$cpp_source_subgroup = $arguments_optional->{children}->[0] |
108
|
|
|
|
|
|
|
->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
109
|
0
|
|
|
|
|
|
RPerl::Generator::source_group_append( $cpp_source_group, |
110
|
|
|
|
|
|
|
$cpp_source_subgroup ); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
|
$cpp_source_group->{CPP} .= $right_paren; |
114
|
0
|
|
|
|
|
|
return $cpp_source_group; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; # end of class |