line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Operation::Expression::SubExpression::Literal; |
3
|
4
|
|
|
4
|
|
31
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
124
|
|
4
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
104
|
|
5
|
4
|
|
|
4
|
|
26
|
use RPerl::AfterSubclass; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
584
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.002_100; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
4
|
|
|
4
|
|
33
|
use parent qw(RPerl::Operation::Expression::SubExpression); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
28
|
|
10
|
4
|
|
|
4
|
|
253
|
use RPerl::Operation::Expression::SubExpression; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
1315
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# [[[ OO PROPERTIES ]]] |
13
|
|
|
|
|
|
|
our hashref $properties = {}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# [[[ SUBROUTINES & OO METHODS ]]] |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our string_hashref::method $ast_to_rperl__generate = sub { |
18
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
19
|
|
|
|
|
|
|
my string_hashref $rperl_source_group; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# RPerl::diag( 'in Literal->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my string $self_class = ref $self; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if (( $self_class eq 'SubExpression_137' ) # SubExpression -> Literal |
26
|
|
|
|
|
|
|
or ( $self_class eq 'VariableOrLiteral_228' ) # VariableOrLiteral -> Literal |
27
|
|
|
|
|
|
|
or ( $self_class eq 'VarOrLitOrOpStrOrWord_230' ) # VarOrLitOrOpStrOrWord -> Literal |
28
|
|
|
|
|
|
|
) |
29
|
|
|
|
|
|
|
{ |
30
|
|
|
|
|
|
|
my object $number_or_string = $self->{children}->[0]; |
31
|
|
|
|
|
|
|
$rperl_source_group = $number_or_string->ast_to_rperl__generate($modes); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
35
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
36
|
|
|
|
|
|
|
. $self_class |
37
|
|
|
|
|
|
|
. ' found where SubExpression_137, VariableOrLiteral_228, or VarOrLitOrOpStrOrWord_230 expected, dying' |
38
|
|
|
|
|
|
|
) . "\n"; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return $rperl_source_group; |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub { |
45
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
46
|
|
|
|
|
|
|
my string_hashref $cpp_source_group |
47
|
|
|
|
|
|
|
= { CPP => |
48
|
|
|
|
|
|
|
q{// <<< RP::O::E::SE::L __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} |
49
|
|
|
|
|
|
|
. "\n" }; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#... |
52
|
|
|
|
|
|
|
return $cpp_source_group; |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_CPPTYPES = sub { |
56
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
57
|
|
|
|
|
|
|
my string_hashref $cpp_source_group; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# RPerl::diag( 'in Literal->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my string $self_class = ref $self; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
if (( $self_class eq 'SubExpression_137' ) # SubExpression -> Literal |
64
|
|
|
|
|
|
|
or ( $self_class eq 'VariableOrLiteral_228' ) # VariableOrLiteral -> Literal |
65
|
|
|
|
|
|
|
or ( $self_class eq 'VarOrLitOrOpStrOrWord_230' ) # VarOrLitOrOpStrOrWord -> Literal |
66
|
|
|
|
|
|
|
) |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
my object $number_or_string = $self->{children}->[0]; |
69
|
|
|
|
|
|
|
$cpp_source_group = $number_or_string->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
else { |
72
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
73
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
74
|
|
|
|
|
|
|
. $self_class |
75
|
|
|
|
|
|
|
. ' found where SubExpression_137, VariableOrLiteral_228, or VarOrLitOrOpStrOrWord_230 expected, dying' |
76
|
|
|
|
|
|
|
) . "\n"; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
return $cpp_source_group; |
80
|
|
|
|
|
|
|
}; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; # end of class |