| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
|
2
|
|
|
|
|
|
|
package RPerl::Operation::Statement::VariableModification; |
|
3
|
3
|
|
|
3
|
|
20
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
80
|
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
85
|
|
|
5
|
3
|
|
|
3
|
|
20
|
use RPerl::AfterSubclass; |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
396
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.003_000; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
|
9
|
3
|
|
|
3
|
|
19
|
use parent qw(RPerl::Operation::Statement); |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
16
|
|
|
10
|
3
|
|
|
3
|
|
162
|
use RPerl::Operation::Statement; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
3729
|
|
|
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
|
280
|
|
|
280
|
|
591
|
{ my string_hashref::method $RETURN_TYPE }; |
|
|
280
|
|
|
|
|
686
|
|
|
23
|
280
|
|
|
|
|
740
|
( my object $self, my string_hashref $modes) = @ARG; |
|
24
|
280
|
|
|
|
|
1197
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
|
25
|
280
|
|
|
|
|
623
|
my string_hashref $rperl_source_subgroup; |
|
26
|
280
|
|
|
|
|
696
|
my string $self_class = ref $self; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# yes semicolon for Statement_170, no semicolon for SubExpressionOrVarMod_162, VariableModification_199, and VariableModification_200 |
|
31
|
280
|
|
|
|
|
747
|
my string $semicolon = q{}; |
|
32
|
|
|
|
|
|
|
|
|
33
|
280
|
100
|
|
|
|
1346
|
if ( $self_class eq 'SubExpressionOrVarMod_162' ) { # SubExpressionOrVarMod -> VariableModification |
|
|
|
50
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# unwrap VariableModification_199 and VariableModification_200 from SubExpressionOrVarMod_162 |
|
35
|
4
|
|
|
|
|
39
|
$self = $self->{children}->[0]; |
|
36
|
4
|
|
|
|
|
13
|
$self_class = ref $self; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
elsif ( $self_class eq 'Statement_170' ) { # Statement -> VariableModification ';' |
|
39
|
|
|
|
|
|
|
# unwrap VariableModification_199 and VariableModification_200 from Statement_170; grab semicolon |
|
40
|
276
|
|
|
|
|
886
|
$semicolon = $self->{children}->[1]; |
|
41
|
276
|
|
|
|
|
660
|
$self = $self->{children}->[0]; |
|
42
|
276
|
|
|
|
|
755
|
$self_class = ref $self; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
280
|
100
|
|
|
|
882
|
if ( $self_class eq 'VariableModification_199' ) { # VariableModification -> Variable OP19_VARIABLE_ASSIGN SubExpressionOrInput |
|
|
|
50
|
|
|
|
|
|
|
46
|
257
|
|
|
|
|
712
|
my object $variable = $self->{children}->[0]; |
|
47
|
257
|
|
|
|
|
738
|
my string $assign = $self->{children}->[1]; |
|
48
|
257
|
|
|
|
|
688
|
my object $subexpression_or_stdin = $self->{children}->[2]; |
|
49
|
|
|
|
|
|
|
|
|
50
|
257
|
|
|
|
|
5277
|
$rperl_source_subgroup = $variable->ast_to_rperl__generate($modes); |
|
51
|
257
|
|
|
|
|
5218
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
|
52
|
257
|
|
|
|
|
700
|
$rperl_source_group->{PMC} .= q{ } . $assign . q{ }; |
|
53
|
257
|
|
|
|
|
5511
|
$rperl_source_subgroup = $subexpression_or_stdin->ast_to_rperl__generate($modes); |
|
54
|
257
|
|
|
|
|
5437
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
elsif ( $self_class eq 'VariableModification_200' ) { # VariableModification -> Variable OP19_VARIABLE_ASSIGN_BY SubExpression |
|
57
|
23
|
|
|
|
|
96
|
my object $variable = $self->{children}->[0]; |
|
58
|
23
|
|
|
|
|
60
|
my string $assign_by = $self->{children}->[1]; |
|
59
|
23
|
|
|
|
|
68
|
my object $subexpression = $self->{children}->[2]; |
|
60
|
|
|
|
|
|
|
|
|
61
|
23
|
|
|
|
|
499
|
$rperl_source_subgroup = $variable->ast_to_rperl__generate($modes); |
|
62
|
23
|
|
|
|
|
462
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
|
63
|
23
|
|
|
|
|
75
|
$rperl_source_group->{PMC} .= q{ } . $assign_by . q{ }; |
|
64
|
23
|
|
|
|
|
471
|
$rperl_source_subgroup = $subexpression->ast_to_rperl__generate($modes); |
|
65
|
23
|
|
|
|
|
469
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
else { |
|
68
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( 'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
|
69
|
|
|
|
|
|
|
. $self_class |
|
70
|
|
|
|
|
|
|
. ' found where SubExpressionOrVarMod_162, Statement_170, VariableModification_199, or VariableModification_200 expected, dying' ) |
|
71
|
|
|
|
|
|
|
. "\n"; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
|
|
74
|
280
|
|
|
|
|
824
|
$rperl_source_group->{PMC} .= $semicolon . "\n"; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_rperl__generate(), returning $rperl_source_group = ' . "\n" . RPerl::Parser::rperl_ast__dump($rperl_source_group) . "\n" ); |
|
77
|
280
|
|
|
|
|
2007
|
return $rperl_source_group; |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_PERLTYPES { |
|
81
|
0
|
|
|
0
|
|
0
|
{ my string_hashref::method $RETURN_TYPE }; |
|
|
0
|
|
|
|
|
0
|
|
|
82
|
0
|
|
|
|
|
0
|
( my object $self, my string_hashref $modes) = @ARG; |
|
83
|
0
|
|
|
|
|
0
|
my string_hashref $cpp_source_group = { CPP => q{// <<< RP::O::S::VM __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} . "\n" }; |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#... |
|
86
|
0
|
|
|
|
|
0
|
return $cpp_source_group; |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_CPPTYPES { |
|
90
|
30
|
|
|
30
|
|
50
|
{ my string_hashref::method $RETURN_TYPE }; |
|
|
30
|
|
|
|
|
59
|
|
|
91
|
30
|
|
|
|
|
63
|
( my object $self, my string_hashref $modes) = @ARG; |
|
92
|
30
|
|
|
|
|
78
|
my string_hashref $cpp_source_group = { CPP => q{} }; |
|
93
|
30
|
|
|
|
|
54
|
my string_hashref $cpp_source_subgroup; |
|
94
|
30
|
|
|
|
|
67
|
my string $self_class = ref $self; |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# yes semicolon for Statement_170, no semicolon for SubExpressionOrVarMod_162, VariableModification_199, and VariableModification_200 |
|
99
|
30
|
|
|
|
|
51
|
my string $semicolon = undef; |
|
100
|
|
|
|
|
|
|
|
|
101
|
30
|
50
|
|
|
|
116
|
if ( $self_class eq 'SubExpressionOrVarMod_162' ) { # SubExpressionOrVarMod -> VariableModification |
|
|
|
50
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# unwrap VariableModification_199 and VariableModification_200 from SubExpressionOrVarMod_162 |
|
103
|
0
|
|
|
|
|
0
|
$self = $self->{children}->[0]; |
|
104
|
0
|
|
|
|
|
0
|
$self_class = ref $self; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
elsif ( $self_class eq 'Statement_170' ) { # Statement -> VariableModification ';' |
|
107
|
|
|
|
|
|
|
# unwrap VariableModification_199 and VariableModification_200 from Statement_170; grab semicolon |
|
108
|
30
|
|
|
|
|
97
|
$semicolon = $self->{children}->[1]; |
|
109
|
30
|
|
|
|
|
60
|
$self = $self->{children}->[0]; |
|
110
|
30
|
|
|
|
|
66
|
$self_class = ref $self; |
|
111
|
|
|
|
|
|
|
} |
|
112
|
|
|
|
|
|
|
|
|
113
|
30
|
100
|
|
|
|
89
|
if ( $self_class eq 'VariableModification_199' ) { # VariableModification -> Variable OP19_VARIABLE_ASSIGN SubExpressionOrInput |
|
|
|
50
|
|
|
|
|
|
|
114
|
23
|
|
|
|
|
59
|
my object $variable = $self->{children}->[0]; |
|
115
|
23
|
|
|
|
|
45
|
my string $assign = $self->{children}->[1]; |
|
116
|
23
|
|
|
|
|
44
|
my object $subexpression_or_stdin = $self->{children}->[2]; |
|
117
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $variable = ' . "\n" . RPerl::Parser::rperl_ast__dump($variable) . "\n" ); |
|
118
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $subexpression_or_stdin = ' . "\n" . RPerl::Parser::rperl_ast__dump($subexpression_or_stdin) . "\n" ); |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
# detect array resize semantics: Perl '$a->[$i - 1] = undef;' becomes C++ 'a.resize(i);' |
|
121
|
23
|
|
|
|
|
36
|
my boolean $rhs_is_undef = 0; |
|
122
|
23
|
|
|
|
|
33
|
my boolean $lhs_is_array_retrieval_minus_one = 0; |
|
123
|
|
|
|
|
|
|
# SubExpression_150 ISA RPerl::Operation::Expression::SubExpression::Literal::Undefined AKA undef |
|
124
|
23
|
50
|
33
|
|
|
263
|
if ( |
|
|
|
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
125
|
|
|
|
|
|
|
((ref $subexpression_or_stdin) eq 'SubExpressionOrInput_158') and |
|
126
|
|
|
|
|
|
|
(exists $subexpression_or_stdin->{children}) and |
|
127
|
|
|
|
|
|
|
(defined $subexpression_or_stdin->{children}) and |
|
128
|
|
|
|
|
|
|
(defined $subexpression_or_stdin->{children}->[0]) and |
|
129
|
|
|
|
|
|
|
((ref $subexpression_or_stdin->{children}->[0]) eq 'SubExpression_150') |
|
130
|
|
|
|
|
|
|
) { |
|
131
|
0
|
|
|
|
|
0
|
$rhs_is_undef = 1; |
|
132
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $rhs_is_undef = ' . $rhs_is_undef . "\n" ); |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
23
|
0
|
33
|
|
|
67
|
if ( |
|
|
|
|
33
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
136
|
|
|
|
|
|
|
$rhs_is_undef and |
|
137
|
|
|
|
|
|
|
((ref $variable) eq 'Variable_191') and # Variable -> VariableSymbolOrSelf STAR-44 |
|
138
|
|
|
|
|
|
|
(exists $variable->{children}) and |
|
139
|
|
|
|
|
|
|
(defined $variable->{children}) and |
|
140
|
|
|
|
|
|
|
(defined $variable->{children}->[1]) and |
|
141
|
|
|
|
|
|
|
((ref $variable->{children}->[1]) eq '_STAR_LIST') and |
|
142
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}) and |
|
143
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}) and |
|
144
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]) and |
|
145
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]) eq 'VariableRetrieval_192') and # VariableRetrieval -> OP02_ARRAY_THINARROW SubExpression ']' |
|
146
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}) and |
|
147
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}) and |
|
148
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]) and |
|
149
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]->{children}->[1]) eq 'SubExpression_149') and # SubExpression -> Expression |
|
150
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}) and |
|
151
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}) and |
|
152
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]) and |
|
153
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]) eq 'Expression_143') and # Expression -> Operator |
|
154
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}) and |
|
155
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}) and |
|
156
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]) and |
|
157
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]) eq 'Operator_107') and # Operator -> SubExpression OP08_MATH_ADD_SUB SubExpression |
|
158
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}) and |
|
159
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}) and |
|
160
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[1]) and |
|
161
|
|
|
|
|
|
|
( $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[1] eq '- ') and # subtraction |
|
162
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]) and |
|
163
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]) eq 'SubExpression_151') and # SubExpression -> Literal |
|
164
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}) and |
|
165
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}) and |
|
166
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]) and |
|
167
|
|
|
|
|
|
|
((ref $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]) eq 'Literal_248') and # Literal -> LITERAL_NUMBER |
|
168
|
|
|
|
|
|
|
(exists $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]->{children}) and |
|
169
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]->{children}) and |
|
170
|
|
|
|
|
|
|
(defined $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]->{children}->[0]) and |
|
171
|
|
|
|
|
|
|
( $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[2]->{children}->[0]->{children}->[0] eq '1') # literal number 1 |
|
172
|
|
|
|
|
|
|
) { |
|
173
|
0
|
|
|
|
|
0
|
$lhs_is_array_retrieval_minus_one = 1; |
|
174
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $lhs_is_array_retrieval_minus_one = ' . $lhs_is_array_retrieval_minus_one . "\n" ); |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# array resize semantics detected |
|
178
|
23
|
50
|
33
|
|
|
93
|
if ($rhs_is_undef and $lhs_is_array_retrieval_minus_one) { |
|
179
|
0
|
|
|
|
|
0
|
my unknown $size = $variable->{children}->[1]->{children}->[-1]->{children}->[1]->{children}->[0]->{children}->[0]->{children}->[0]; |
|
180
|
0
|
|
|
|
|
0
|
delete $variable->{children}->[1]->{children}->[-1]; # do not generate the final variable retrieval containing the size: ->[size - 1] |
|
181
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have modified $variable = ' . "\n" . RPerl::Parser::rperl_ast__dump($variable) . "\n" ); |
|
182
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $size = ' . "\n" . RPerl::Parser::rperl_ast__dump($size) . "\n" ); |
|
183
|
|
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
0
|
$cpp_source_subgroup = $variable->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
185
|
0
|
|
|
|
|
0
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
186
|
0
|
|
|
|
|
0
|
$cpp_source_group->{CPP} .= '.resize('; |
|
187
|
0
|
|
|
|
|
0
|
$cpp_source_subgroup = $size->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
188
|
0
|
|
|
|
|
0
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
189
|
0
|
|
|
|
|
0
|
$cpp_source_group->{CPP} .= ')'; |
|
190
|
|
|
|
|
|
|
} |
|
191
|
|
|
|
|
|
|
else { # normal generate |
|
192
|
23
|
|
|
|
|
489
|
$cpp_source_subgroup = $variable->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
193
|
23
|
|
|
|
|
441
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
194
|
23
|
|
|
|
|
61
|
$cpp_source_group->{CPP} .= q{ } . $assign . q{ }; |
|
195
|
23
|
|
|
|
|
458
|
$cpp_source_subgroup = $subexpression_or_stdin->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
196
|
23
|
|
|
|
|
462
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
197
|
|
|
|
|
|
|
} |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
elsif ( $self_class eq 'VariableModification_200' ) { # VariableModification -> Variable OP19_VARIABLE_ASSIGN_BY SubExpression |
|
200
|
7
|
|
|
|
|
32
|
my object $variable = $self->{children}->[0]; |
|
201
|
7
|
|
|
|
|
17
|
my string $assign_by = $self->{children}->[1]; |
|
202
|
7
|
|
|
|
|
14
|
my object $subexpression = $self->{children}->[2]; |
|
203
|
|
|
|
|
|
|
|
|
204
|
7
|
|
|
|
|
152
|
$cpp_source_subgroup = $variable->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
205
|
7
|
|
|
|
|
135
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
206
|
7
|
|
|
|
|
26
|
$cpp_source_group->{CPP} .= q{ } . $assign_by . q{ }; |
|
207
|
7
|
|
|
|
|
134
|
$cpp_source_subgroup = $subexpression->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
|
208
|
7
|
|
|
|
|
141
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
|
209
|
|
|
|
|
|
|
} |
|
210
|
|
|
|
|
|
|
else { |
|
211
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( 'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
|
212
|
|
|
|
|
|
|
. $self_class |
|
213
|
|
|
|
|
|
|
. ' found where SubExpressionOrVarMod_162, Statement_170, VariableModification_199, or VariableModification_200 expected, dying' ) |
|
214
|
|
|
|
|
|
|
. "\n"; |
|
215
|
|
|
|
|
|
|
} |
|
216
|
|
|
|
|
|
|
|
|
217
|
30
|
50
|
|
|
|
95
|
if (defined $semicolon) { |
|
218
|
30
|
|
|
|
|
87
|
$cpp_source_group->{CPP} .= $semicolon . "\n"; |
|
219
|
|
|
|
|
|
|
} |
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
# RPerl::diag( 'in VariableModification->ast_to_cpp__generate__CPPOPS_CPPTYPES(), returning $cpp_source_group = ' . "\n" . RPerl::Parser::rperl_ast__dump($cpp_source_group) . "\n" ); |
|
222
|
30
|
|
|
|
|
204
|
return $cpp_source_group; |
|
223
|
|
|
|
|
|
|
} |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
1; # end of class |