our
$VERSION
= 0.006_000;
our
hashref
$properties
= {};
sub
ast_to_rperl__generate {
{
my
string_hashref::method
$RETURN_TYPE
};
(
my
object
$self
,
my
string_hashref
$modes
) =
@ARG
;
my
string_hashref
$rperl_source_group
= {
PMC
=>
q{}
};
my
string
$self_class
=
ref
$self
;
if
(
$self_class
eq
'VariableRetrieval_199'
) {
my
string
$arrow_left_bracket
=
$self
->{children}->[0];
my
object
$subexpression
=
$self
->{children}->[1];
my
string
$right_bracket
=
$self
->{children}->[2];
$rperl_source_group
->{PMC} .=
$arrow_left_bracket
.
q{ }
;
my
string_hashref
$rperl_source_subgroup
=
$subexpression
->ast_to_rperl__generate(
$modes
);
RPerl::Generator::source_group_append(
$rperl_source_group
,
$rperl_source_subgroup
);
$rperl_source_group
->{PMC} .=
q{ }
.
$right_bracket
;
}
elsif
(
$self_class
eq
'VariableRetrieval_200'
) {
my
string
$arrow_left_brace
=
$self
->{children}->[0];
my
object
$subexpression
=
$self
->{children}->[1];
my
string
$right_brace
=
$self
->{children}->[2];
$rperl_source_group
->{PMC} .=
$arrow_left_brace
.
q{ }
;
my
string_hashref
$rperl_source_subgroup
=
$subexpression
->ast_to_rperl__generate(
$modes
);
RPerl::Generator::source_group_append(
$rperl_source_group
,
$rperl_source_subgroup
);
$rperl_source_group
->{PMC} .=
q{ }
.
$right_brace
;
}
elsif
(
$self_class
eq
'VariableRetrieval_201'
) {
my
string
$arrow_left_brace
=
$self
->{children}->[0];
my
string
$word
=
$self
->{children}->[1];
my
string
$right_brace
=
$self
->{children}->[2];
$rperl_source_group
->{PMC} .=
$arrow_left_brace
.
q{ }
.
$word
.
q{ }
.
$right_brace
;
}
else
{
die
RPerl::Parser::rperl_rule__replace(
'ERROR ECOGEASRP000, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
. (
$self_class
)
.
' found where VariableRetrieval_199, VariableRetrieval_199, or VariableRetrieval_199 expected, dying'
)
.
"\n"
;
}
return
$rperl_source_group
;
}
sub
ast_to_cpp__generate__CPPOPS_PERLTYPES {
{
my
string_hashref::method
$RETURN_TYPE
};
(
my
object
$self
,
my
string_hashref
$modes
) =
@ARG
;
my
string_hashref
$cpp_source_group
= {
CPP
=>
q{// <<< RP::O::E::SE::V::R __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
.
"\n"
};
return
$cpp_source_group
;
}
sub
ast_to_cpp__generate__CPPOPS_CPPTYPES {
{
my
string_hashref::method
$RETURN_TYPE
};
(
my
object
$self
,
my
string
$variable_symbol
,
my
string
$base_type
,
my
string_hashref
$modes
) =
@ARG
;
my
string_hashref
$cpp_source_group
= {
CPP
=>
q{}
};
my
string
$self_class
=
ref
$self
;
my
string
$subtype
;
if
(
$self_class
eq
'VariableRetrieval_199'
) {
my
object
$subexpression
=
$self
->{children}->[1];
if
(
$base_type
=~ /_arrayref$/ ) {
$subtype
=
substr
$base_type
, 0, ( (
length
$base_type
) - 9 );
if
(
exists
$rperlnamespaces_generated::RPERL
->{
$subtype
.
'::'
} ) {
if
(
$subtype
eq
'arrayref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
eq
'hashref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
=~ /sse_number_pair$/xms ) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
else
{
$cpp_source_group
->{CPP} .=
'['
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
$cpp_source_group
->{CPP} .=
']'
;
}
}
else
{
$cpp_source_group
->{CPP} .=
'['
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
$cpp_source_group
->{CPP} .=
']'
;
}
}
elsif
(
$base_type
eq
'sse_number_pair'
) {
$cpp_source_group
->{CPP} .=
'['
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
$cpp_source_group
->{CPP} .=
']'
;
}
elsif
(
$base_type
=~ /_hashref$/ ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use arrayref retrieval on hashref type '
.
$base_type
.
', dying'
.
"\n"
;
}
elsif
(
exists
$rperlnamespaces_generated::RPERL
->{
$base_type
.
'::'
} ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use arrayref retrieval on scalar type '
.
$base_type
.
', dying'
.
"\n"
;
}
else
{
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use arrayref retrieval on object of user-defined class '
.
$base_type
.
', dying'
.
"\n"
;
}
}
elsif
(
$self_class
eq
'VariableRetrieval_200'
) {
my
object
$subexpression
=
$self
->{children}->[1];
if
(
$base_type
=~ /_arrayref$/ ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on arrayref type '
.
$base_type
.
', dying'
.
"\n"
;
}
elsif
(
$base_type
eq
'sse_number_pair'
) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on SSE type '
.
$base_type
.
', dying'
.
"\n"
;
}
elsif
(
$base_type
=~ /_hashref$/ ) {
$subtype
=
substr
$base_type
, 0, ( (
length
$base_type
) - 8 );
if
(
exists
$rperlnamespaces_generated::RPERL
->{
$subtype
.
'::'
} ) {
if
(
$subtype
eq
'arrayref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
eq
'hashref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
=~ /sse_number_pair$/xms ) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
else
{
$cpp_source_group
->{CPP} .=
'['
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
$cpp_source_group
->{CPP} .=
']'
;
}
}
else
{
$cpp_source_group
->{CPP} .=
'['
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
$cpp_source_group
->{CPP} .=
']'
;
}
}
elsif
(
exists
$rperlnamespaces_generated::RPERL
->{
$base_type
.
'::'
} ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on scalar type '
.
$base_type
.
', dying'
.
"\n"
;
}
else
{
$cpp_source_group
->{CPP} .=
'->'
;
my
string_hashref
$cpp_source_subgroup
=
$subexpression
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
}
}
elsif
(
$self_class
eq
'VariableRetrieval_201'
) {
my
string
$word
=
$self
->{children}->[1];
if
(
$base_type
=~ /_arrayref$/ ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on arrayref type '
.
$base_type
.
', dying'
.
"\n"
;
}
elsif
(
$base_type
eq
'sse_number_pair'
) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on SSE type '
.
$base_type
.
', dying'
.
"\n"
;
}
elsif
(
$base_type
=~ /_hashref$/ ) {
$subtype
=
substr
$base_type
, 0, ( (
length
$base_type
) - 8 );
if
(
exists
$rperlnamespaces_generated::RPERL
->{
$subtype
.
'::'
} ) {
if
(
$subtype
eq
'arrayref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
eq
'hashref'
) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
elsif
(
$subtype
=~ /sse_number_pair$/xms ) {
die
'NEED TEST & IMPLEMENT!!!'
;
}
else
{
$cpp_source_group
->{CPP} .=
'["'
.
$word
.
'"]'
;
}
}
else
{
$cpp_source_group
->{CPP} .=
'["'
.
$word
.
'"]'
;
}
}
elsif
(
exists
$rperlnamespaces_generated::RPERL
->{
$base_type
.
'::'
} ) {
die
'ERROR ECOGEASCP0xd, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Variable retrieval, can not use hashref retrieval on scalar type '
.
$base_type
.
', dying'
.
"\n"
;
}
else
{
$cpp_source_group
->{CPP} .=
'->'
.
$word
;
}
}
else
{
die
RPerl::Parser::rperl_rule__replace(
'ERROR ECOGEASCP000, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '
. (
$self_class
)
.
' found where VariableRetrieval_199, VariableRetrieval_199, or VariableRetrieval_199 expected, dying'
)
.
"\n"
;
}
return
$cpp_source_group
;
}
1;