our
$VERSION
= 0.004_000;
package
string_hashref::method;
package
object;
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
'SubExpression_161'
) {
$self
=
$self
->{children}->[0];
$self_class
=
ref
$self
;
}
if
(
$self_class
eq
'HashReference_232'
) {
my
string
$left_brace
=
$self
->{children}->[0];
my
object
$hash_entry
=
$self
->{children}->[1];
my
object
$hash_entries_star
=
$self
->{children}->[2];
my
string
$right_brace
=
$self
->{children}->[3];
$rperl_source_group
->{PMC} .=
$left_brace
;
my
string_hashref
$rperl_source_subgroup
=
$hash_entry
->ast_to_rperl__generate(
$modes
);
RPerl::Generator::source_group_append(
$rperl_source_group
,
$rperl_source_subgroup
);
foreach
my
$hash_entry_star
( @{
$hash_entries_star
->{children} } ) {
if
(
ref
$hash_entry_star
eq
'TERMINAL'
) {
if
(
$hash_entry_star
->{attr} ne
q{,}
) {
die
RPerl::Parser::rperl_rule__replace(
q{ERROR ECOGEASRP000, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '}
.
$hash_entry_star
->{attr}
.
q{' found where OP21_LIST_COMMA ',' expected, dying}
) .
"\n"
;
}
$rperl_source_group
->{PMC}
.=
$hash_entry_star
->{attr} .
q{ }
;
}
else
{
$rperl_source_subgroup
=
$hash_entry_star
->ast_to_rperl__generate(
$modes
);
RPerl::Generator::source_group_append(
$rperl_source_group
,
$rperl_source_subgroup
);
}
}
$rperl_source_group
->{PMC} .=
$right_brace
;
}
elsif
(
$self_class
eq
'HashReference_233'
) {
my
string
$left_brace
=
$self
->{children}->[0];
my
string
$right_brace
=
$self
->{children}->[1];
$rperl_source_group
->{PMC} .=
$left_brace
.
$right_brace
;
}
else
{
die
RPerl::Parser::rperl_rule__replace(
'ERROR ECOGEASRP000, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
. (
$self_class
)
.
' found where HashReference_232, HashReference_233, or SubExpression_161 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::DS::H::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_hashref
$modes
) =
@ARG
;
my
string_hashref
$cpp_source_group
= {
CPP
=>
q{}
};
my
string
$self_class
=
ref
$self
;
if
(
$self_class
eq
'SubExpression_161'
) {
$self
=
$self
->{children}->[0];
$self_class
=
ref
$self
;
}
if
(
$self_class
eq
'HashReference_232'
) {
my
object
$hash_entry
=
$self
->{children}->[1];
my
object
$hash_entries_star
=
$self
->{children}->[2];
$cpp_source_group
->{CPP} .=
'{ '
;
my
string_hashref
$cpp_source_subgroup
=
$hash_entry
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
foreach
my
$hash_entry_star
( @{
$hash_entries_star
->{children} } ) {
if
(
ref
$hash_entry_star
eq
'TERMINAL'
) {
if
(
$hash_entry_star
->{attr} ne
q{,}
) {
die
RPerl::Parser::rperl_rule__replace(
q{ERROR ECOGEASCP000, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '}
.
$hash_entry_star
->{attr}
.
q{' found where OP21_LIST_COMMA ',' expected, dying}
) .
"\n"
;
}
$cpp_source_group
->{CPP} .=
$hash_entry_star
->{attr} .
q{ }
;
}
else
{
$cpp_source_subgroup
=
$hash_entry_star
->ast_to_cpp__generate__CPPOPS_CPPTYPES(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
}
}
$cpp_source_group
->{CPP} .=
' }'
;
}
elsif
(
$self_class
eq
'HashReference_233'
) {
$cpp_source_group
->{CPP} .=
'{}'
;
}
else
{
die
RPerl::Parser::rperl_rule__replace(
'ERROR ECOGEASCP000, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '
. (
$self_class
)
.
' found where HashReference_232, HashReference_233, or SubExpression_161 expected, dying'
) .
"\n"
;
}
return
$cpp_source_group
;
}
sub
ast_to_cpp__generate__CPPOPS_CPPTYPES__bson_build {
{
my
string_hashref::method
$RETURN_TYPE
};
(
my
object
$self
,
my
string_hashref
$modes
) =
@ARG
;
my
string_hashref
$cpp_source_group
= {
CPP
=>
q{}
};
my
string
$self_class
=
ref
$self
;
if
(
$self_class
eq
'SubExpression_161'
) {
$self
=
$self
->{children}->[0];
$self_class
=
ref
$self
;
}
if
(
$self_class
eq
'HashReference_232'
) {
my
object
$hash_entry
=
$self
->{children}->[1];
my
object
$hash_entries_star
=
$self
->{children}->[2];
my
boolean
$modes_bson_build_top_local
=
$modes
->{_bson_build_top};
$modes
->{_bson_build_top} = 0;
if
(
$modes_bson_build_top_local
) {
}
else
{
$cpp_source_group
->{CPP} .=
'bson_hashref_begin'
;
}
my
string_hashref
$cpp_source_subgroup
=
$hash_entry
->ast_to_cpp__generate__CPPOPS_CPPTYPES__bson_build(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
foreach
my
$hash_entry_star
( @{
$hash_entries_star
->{children} } ) {
if
(
ref
$hash_entry_star
eq
'TERMINAL'
) {
if
(
$hash_entry_star
->{attr} ne
q{,}
) {
die
RPerl::Parser::rperl_rule__replace(
q{ERROR ECOGEASCP000, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '}
.
$hash_entry_star
->{attr}
.
q{' found where OP21_LIST_COMMA ',' expected, dying}
) .
"\n"
;
}
}
else
{
$cpp_source_subgroup
=
$hash_entry_star
->ast_to_cpp__generate__CPPOPS_CPPTYPES__bson_build(
$modes
);
RPerl::Generator::source_group_append(
$cpp_source_group
,
$cpp_source_subgroup
);
}
}
if
(
$modes_bson_build_top_local
) {
}
else
{
$cpp_source_group
->{CPP} .=
' << bson_hashref_end'
;
}
}
elsif
(
$self_class
eq
'HashReference_233'
) {
}
else
{
die
RPerl::Parser::rperl_rule__replace(
'ERROR ECOGEASCP000, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '
. (
$self_class
)
.
' found where HashReference_232, HashReference_233, or SubExpression_161 expected, dying'
) .
"\n"
;
}
return
$cpp_source_group
;
}
1;