tools/json_to_struct/element_generator.py
def GenerateElements(type_name, schema, description, field_name_count={}):
  """Generate the static structure initializer for all the elements in the
  description['elements'] dictionary, as well as for any variables in
  description['int_variables'].
  """
  result = [];
  for var_name, value in description.get('int_variables', {}).items():
    result.append('const int %s = %s;' % (var_name, value))
  result.append('')

  for element_name, element in description.get('elements', {}).items():
    result.append(GenerateElement(type_name, schema, element_name, element,
                                  field_name_count))
    result.append('')
  return '\n'.join(result)
Generate the static structure initializer for all the elements in the
  description['elements'] dictionary, as well as for any variables in
  description['int_variables'].
  
Generate the static structure initializer for all the elements in the
description['elements'] dictionary, as well as for any variables in
description['int_variables'].
Generate the static structure initializer for all the elements in the description [ ' elements ' ] dictionary as well as for any variables in description [ ' int_variables ' ] .
def GenerateElements(type_name, schema, description, field_name_count={}):
  result = [];
  for var_name, value in description.get('int_variables', {}).items():
    result.append('const int %s = %s;' % (var_name, value))
  result.append('')
  for element_name, element in description.get('elements', {}).items():
    result.append(GenerateElement(type_name, schema, element_name, element,
                                  field_name_count))
    result.append('')
  return '\n'.join(result)
def GenerateElements ( type_name , schema , description , field_name_count = { } ) : result = [ ] ; for var_name , value in description . get ( 'int_variables' , { } ) . items ( ) : result . append ( 'const int %s = %s;' % ( var_name , value ) ) result . append ( '' ) for element_name , element in description . get ( 'elements' , { } ) . items ( ) : result . append ( GenerateElement ( type_name , schema , element_name , element , field_name_count ) ) result . append ( '' ) return '\n' . join ( result )
Generate the static structure initializer for all the elements in the
description['elements'] dictionary, as well as for any variables in
description['int_variables'].
Generate the static structure initializer for all the elements in the description [ ' elements ' ] dictionary as well as for any variables in description [ ' int_variables ' ] .
"""Generate the static structure initializer for all the elements in the
  description['elements'] dictionary, as well as for any variables in
  description['int_variables'].
  """
type_name
schema
description
field_name_count