line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Operation::Expression::SubExpression; |
3
|
4
|
|
|
4
|
|
1604
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
115
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
81
|
|
5
|
4
|
|
|
4
|
|
19
|
use RPerl::AfterSubclass; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
495
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.001_100; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
4
|
|
|
4
|
|
33
|
use parent qw(RPerl::Operation::Expression); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
28
|
|
10
|
4
|
|
|
4
|
|
246
|
use RPerl::Operation::Expression; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
1588
|
|
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
|
|
|
|
|
|
|
our string_hashref::method $ast_to_rperl__generate = sub { |
22
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
23
|
|
|
|
|
|
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# RPerl::diag( 'in SubExpression->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
if ( ( ref $self eq 'SubExpressionOrInput_144' ) # SubExpressionOrInput -> SubExpression |
28
|
|
|
|
|
|
|
or ( ref $self eq 'SubExpressionOrVarMod_147' ) # SubExpressionOrVarMod -> SubExpression |
29
|
|
|
|
|
|
|
or ( ref $self eq 'ListElement_191' ) ) # ListElement -> SubExpression |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
my string_hashref $rperl_source_subgroup = $self->{children}->[0]->ast_to_rperl__generate($modes); |
32
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
elsif ( ref $self eq 'ListElement_192' ) { # ListElement -> TypeInner SubExpression |
35
|
|
|
|
|
|
|
my object $type_inner = $self->{children}->[0]; |
36
|
|
|
|
|
|
|
my string_hashref $rperl_source_subgroup = $self->{children}->[0]->ast_to_rperl__generate($modes); |
37
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
38
|
|
|
|
|
|
|
$rperl_source_subgroup = $self->{children}->[1]->ast_to_rperl__generate($modes); |
39
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
else { |
42
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
43
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
44
|
|
|
|
|
|
|
. ( ref $self ) |
45
|
|
|
|
|
|
|
. ' found where SubExpressionOrInput_144, SubExpressionOrVarMod_147, ListElement_191, or ListElement_192 expected, dying' |
46
|
|
|
|
|
|
|
) . "\n"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
return $rperl_source_group; |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub { |
53
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
54
|
|
|
|
|
|
|
my string_hashref $cpp_source_group = { CPP => q{// <<< RP::O::E::SE __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} . "\n" }; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#... |
57
|
|
|
|
|
|
|
return $cpp_source_group; |
58
|
|
|
|
|
|
|
}; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_CPPTYPES = sub { |
61
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
62
|
|
|
|
|
|
|
my string_hashref $cpp_source_group = { CPP => q{} }; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# RPerl::diag( 'in SubExpression->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
if ( ( ref $self eq 'SubExpressionOrInput_144' ) |
67
|
|
|
|
|
|
|
or ( ref $self eq 'SubExpressionOrVarMod_147' ) |
68
|
|
|
|
|
|
|
or ( ref $self eq 'ListElement_191' ) ) |
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
my string_hashref $cpp_source_subgroup |
71
|
|
|
|
|
|
|
= $self->{children}->[0]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
72
|
|
|
|
|
|
|
# RPerl::diag( 'in SubExpression->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $cpp_source_subgroup = ' . "\n" . RPerl::Parser::rperl_ast__dump($cpp_source_subgroup) . "\n" ); |
73
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $cpp_source_group, |
74
|
|
|
|
|
|
|
$cpp_source_subgroup ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
elsif ( ref $self eq 'ListElement_192' ) { |
77
|
|
|
|
|
|
|
$cpp_source_group = { CPP => q{// <<< RP::O::E::SE __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>} . "\n" }; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# my object $type_inner = $self->{children}->[0]; |
80
|
|
|
|
|
|
|
# my string_hashref $cpp_source_subgroup = $self->{children}->[0]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
81
|
|
|
|
|
|
|
# RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
82
|
|
|
|
|
|
|
# $cpp_source_subgroup = $self->{children}->[1]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
83
|
|
|
|
|
|
|
# RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
else { |
87
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
88
|
|
|
|
|
|
|
'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule ' |
89
|
|
|
|
|
|
|
. ( ref $self ) |
90
|
|
|
|
|
|
|
. ' found where SubExpressionOrInput_144, SubExpressionOrVarMod_147, ListElement_191, or ListElement_192 expected, dying' |
91
|
|
|
|
|
|
|
) . "\n"; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
return $cpp_source_group; |
95
|
|
|
|
|
|
|
}; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; # end of class |