original_docstring: Generate the C declaration for a constant (a single <enum>
          value).
  
          <enum> tags may specify their values in several ways, but are
          usually just integers or floating-point numbers.
docstring: Generate the C declaration for a constant (a single 
  value).
  
   tags may specify their values in several ways, but are
  usually just integers or floating-point numbers.
docstring_tokens: Generate the C declaration for a constant ( a single value ) . tags may specify their values in several ways but are usually just integers or floating - point numbers .
code: def buildConstantCDecl(self, enuminfo, name, alias):
          """Generate the C declaration for a constant (a single <enum>
          value).
  
          <enum> tags may specify their values in several ways, but are
          usually just integers or floating-point numbers."""
  
          (_, strVal) = self.enumToValue(enuminfo.elem, False)
  
          if self.misracppstyle() and enuminfo.elem.get('type') and not alias:
              # Generate e.g.: static constexpr uint32_t x = ~static_cast<uint32_t>(1U);
              # This appeases MISRA "underlying type" rules.
              typeStr = enuminfo.elem.get('type');
              invert = '~' in strVal
              number = strVal.strip("()~UL")
              if typeStr != "float":
                  number += 'U'
              strVal = "~" if invert else ""
              strVal += "static_cast<" + typeStr + ">(" + number + ")"
              body = 'static constexpr ' + typeStr.ljust(9) + name.ljust(33) + ' {' + strVal + '};'
          elif enuminfo.elem.get('type') and not alias:
              # Generate e.g.: #define x (~0ULL)
              typeStr = enuminfo.elem.get('type');
              invert = '~' in strVal
              paren = '(' in strVal
              number = strVal.strip("()~UL")
              if typeStr != "float":
                  if typeStr == "uint64_t":
                      number += 'ULL'
                  else:
                      number += 'U'
              strVal = "~" if invert else ""
              strVal += number
              if paren:
                  strVal = "(" + strVal + ")";
              body = '#define ' + name.ljust(33) + ' ' + strVal;
          else:
              body = '#define ' + name.ljust(33) + ' ' + strVal
  
          return body
code_tokens: def buildConstantCDecl ( self , enuminfo , name , alias ) : ( _ , strVal ) = self . enumToValue ( enuminfo . elem , False ) if self . misracppstyle ( ) and enuminfo . elem . get ( 'type' ) and not alias : typeStr = enuminfo . elem . get ( 'type' ) ; invert = '~' in strVal number = strVal . strip ( "()~UL" ) if typeStr != "float" : number += 'U' strVal = "~" if invert else "" strVal += "static_cast<" + typeStr + ">(" + number + ")" body = 'static constexpr ' + typeStr . ljust ( 9 ) + name . ljust ( 33 ) + ' {' + strVal + '};' elif enuminfo . elem . get ( 'type' ) and not alias : typeStr = enuminfo . elem . get ( 'type' ) ; invert = '~' in strVal paren = '(' in strVal number = strVal . strip ( "()~UL" ) if typeStr != "float" : if typeStr == "uint64_t" : number += 'ULL' else : number += 'U' strVal = "~" if invert else "" strVal += number if paren : strVal = "(" + strVal + ")" ; body = '#define ' + name . ljust ( 33 ) + ' ' + strVal ; else : body = '#define ' + name . ljust ( 33 ) + ' ' + strVal return body
short_docstring: Generate the C declaration for a constant (a single <enum>
  value).
short_docstring_tokens: Generate the C declaration for a constant ( a single <enum > value ) .
comment: """Generate the C declaration for a constant (a single <enum>
          value).
  
          <enum> tags may specify their values in several ways, but are
          usually just integers or floating-point numbers."""$SEP$# Generate e.g.: static constexpr uint32_t x = ~static_cast<uint32_t>(1U);$SEP$# This appeases MISRA "underlying type" rules.$SEP$# Generate e.g.: #define x (~0ULL)