boustrophedonic accessors convert

This commit is contained in:
kevstone 2024-02-13 19:32:25 +00:00
parent 9e2bfed55c
commit 50d54a15cb
3 changed files with 12 additions and 2 deletions

View File

@ -28,8 +28,8 @@ grib_accessor_class_codetable_title.cc
grib_accessor_class_codetable_units.cc
grib_accessor_class_concept.cc
grib_accessor_class_data_apply_bitmap.cc
#grib_accessor_class_data_apply_boustrophedonic.cc
#grib_accessor_class_data_apply_boustrophedonic_bitmap.cc
grib_accessor_class_data_apply_boustrophedonic.cc
grib_accessor_class_data_apply_boustrophedonic_bitmap.cc
grib_accessor_class_data_secondary_bitmap.cc
grib_accessor_class_data_shsimple_packing.cc
#grib_accessor_class_dictionary.cc

View File

@ -3,6 +3,8 @@ import utils.debug as debug
import code_object.cast_expression as cast_expression
import code_object_converter.code_interface_converter as code_interface_converter
import code_object_converter.conversion_funcs as conversion_funcs
from code_object.code_interface import NONE_VALUE
from code_object_converter.conversion_utils import as_commented_out_code
class CastExpressionConverter(code_interface_converter.CodeInterfaceConverter):
def __init__(self, ccode_object) -> None:
@ -15,5 +17,10 @@ class CastExpressionConverter(code_interface_converter.CodeInterfaceConverter):
cpp_cast_value = conversion_funcs.convert_ccode_object(self._ccode_object.cast_value, conversion_pack)
cpp_expression = conversion_funcs.convert_ccode_object(self._ccode_object.expression, conversion_pack)
if cpp_expression == NONE_VALUE:
debug.line("create_cpp_code_object", f"cpp_expression=[{debug.as_debug_string(cpp_expression)}] => returning [NONE_VALUE]")
return NONE_VALUE
cppcast_expression = cast_expression.CastExpression(cpp_cast_type, cpp_cast_value, cpp_expression)
return conversion_pack.conversion_validation.validate_cast_expression(self._ccode_object, cppcast_expression)

View File

@ -23,6 +23,9 @@ class VariableDeclarationConverter(code_interface_converter.CodeInterfaceConvert
debug.line("create_cpp_code_object", f"VariableDeclarationConverter [1] cpp_value=[{debug.as_debug_string(cpp_value)}] for self._ccode_object.value=[{debug.as_debug_string(self._ccode_object.value)}]")
if cpp_value == NONE_VALUE:
return as_commented_out_code(self._ccode_object, f"Removed invalid value")
cpp_variable_declaration = variable_declaration.VariableDeclaration(cpp_variable, cpp_value)
return conversion_pack.conversion_validation.validate_variable_declaration(self._ccode_object, cpp_variable_declaration)