Class: AdLint::Cc1::FloatingType

Inherits:
ScalarDataType show all
Defined in:
lib/adlint/cc1/type.rb

Direct Known Subclasses

StandardFloatingType

Instance Attribute Summary

Attributes inherited from ScalarDataType

#bit_alignment, #bit_size

Attributes inherited from Type

#declarations, #name, #type_table

Instance Method Summary collapse

Methods inherited from ScalarDataType

#_arithmetic_type_with_array, #_arithmetic_type_with_bitfield, #_arithmetic_type_with_char, #_arithmetic_type_with_double, #_arithmetic_type_with_enum, #_arithmetic_type_with_extended_big_int, #_arithmetic_type_with_float, #_arithmetic_type_with_function, #_arithmetic_type_with_int, #_arithmetic_type_with_long, #_arithmetic_type_with_long_double, #_arithmetic_type_with_long_int, #_arithmetic_type_with_long_long, #_arithmetic_type_with_long_long_int, #_arithmetic_type_with_pointer, #_arithmetic_type_with_short, #_arithmetic_type_with_short_int, #_arithmetic_type_with_signed, #_arithmetic_type_with_signed_char, #_arithmetic_type_with_signed_int, #_arithmetic_type_with_signed_long, #_arithmetic_type_with_signed_long_int, #_arithmetic_type_with_signed_long_long, #_arithmetic_type_with_signed_long_long_int, #_arithmetic_type_with_signed_short, #_arithmetic_type_with_signed_short_int, #_arithmetic_type_with_struct, #_arithmetic_type_with_undeclared, #_arithmetic_type_with_union, #_arithmetic_type_with_unresolved, #_arithmetic_type_with_unsigned, #_arithmetic_type_with_unsigned_char, #_arithmetic_type_with_unsigned_int, #_arithmetic_type_with_unsigned_long, #_arithmetic_type_with_unsigned_long_int, #_arithmetic_type_with_unsigned_long_long, #_arithmetic_type_with_unsigned_long_long_int, #_arithmetic_type_with_unsigned_short, #_arithmetic_type_with_unsigned_short_int, #_arithmetic_type_with_void, #arbitrary_value, #array?, #base_type, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #const?, #function?, #have_va_list?, #impl_length, #initialize, #length, #member_named, #members, #named?, #nil_value, #parameter_types, #parameter_value, #qualified?, #real_type, #restrict?, #return_type, #return_value, #scalar?, #standard?, #struct?, #undeclared?, #undefined_value, #union?, #unqualify, #unresolved?, #user?, #void?, #volatile?, #zero_value

Methods included from UsualArithmeticTypeConversion

#do_usual_arithmetic_type_conversion

Methods inherited from Type

#==, #_arithmetic_type_with_array, #_arithmetic_type_with_bitfield, #_arithmetic_type_with_char, #_arithmetic_type_with_double, #_arithmetic_type_with_enum, #_arithmetic_type_with_extended_big_int, #_arithmetic_type_with_float, #_arithmetic_type_with_function, #_arithmetic_type_with_int, #_arithmetic_type_with_long, #_arithmetic_type_with_long_double, #_arithmetic_type_with_long_int, #_arithmetic_type_with_long_long, #_arithmetic_type_with_long_long_int, #_arithmetic_type_with_pointer, #_arithmetic_type_with_short, #_arithmetic_type_with_short_int, #_arithmetic_type_with_signed, #_arithmetic_type_with_signed_char, #_arithmetic_type_with_signed_int, #_arithmetic_type_with_signed_long, #_arithmetic_type_with_signed_long_int, #_arithmetic_type_with_signed_long_long, #_arithmetic_type_with_signed_long_long_int, #_arithmetic_type_with_signed_short, #_arithmetic_type_with_signed_short_int, #_arithmetic_type_with_struct, #_arithmetic_type_with_undeclared, #_arithmetic_type_with_union, #_arithmetic_type_with_unresolved, #_arithmetic_type_with_unsigned, #_arithmetic_type_with_unsigned_char, #_arithmetic_type_with_unsigned_int, #_arithmetic_type_with_unsigned_long, #_arithmetic_type_with_unsigned_long_int, #_arithmetic_type_with_unsigned_long_long, #_arithmetic_type_with_unsigned_long_long_int, #_arithmetic_type_with_unsigned_short, #_arithmetic_type_with_unsigned_short_int, #_arithmetic_type_with_void, #aligned_bit_size, #aligned_byte_size, #arbitrary_value, #array?, #base_type, #bit_alignment, #bit_size, #byte_alignment, #byte_size, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #composite?, #const?, #convertible?, #function?, #have_va_list?, #impl_length, #initialize, #inspect, #length, #length=, #member_named, #members, #more_cv_qualified?, #named?, #nil_value, #parameter?, #parameter_types, #parameter_value, #qualified?, #real_type, #restrict?, #return_type, #return_value, #same_as?, #scalar?, #standard?, #struct?, #undeclared?, #undefined_value, #union?, #unqualify, #unresolved?, #unsigned?, #user?, #void?, #volatile?, #zero_value

Methods included from StandardTypesAccessor

#char_alignment, #char_as_unsigned_char?, #char_size, #code_ptr_alignment, #code_ptr_size, #data_ptr_alignment, #data_ptr_size, #double_alignment, #double_size, #float_alignment, #float_size, #int_alignment, #int_size, #long_alignment, #long_double_alignment, #long_double_size, #long_long_alignment, #long_long_size, #long_size, #short_alignment, #short_size, #standard_types

Methods included from ArithmeticAccessor

#arithmetic, #logical_right_shift?

Methods included from Visitable

#accept

Constructor Details

This class inherits a constructor from AdLint::Cc1::ScalarDataType

Instance Method Details

#argument_promoted_typeObject



5340
5341
5342
# File 'lib/adlint/cc1/type.rb', line 5340

def argument_promoted_type
  subclass_responsibility
end

#arithmetic_type_with(type) ⇒ Object



5344
5345
5346
# File 'lib/adlint/cc1/type.rb', line 5344

def arithmetic_type_with(type)
  subclass_responsibility
end

#bitfield?Boolean

Returns:

  • (Boolean)


5308
5309
5310
# File 'lib/adlint/cc1/type.rb', line 5308

def bitfield?
  false
end

#brief_imageObject



5276
5277
5278
# File 'lib/adlint/cc1/type.rb', line 5276

def brief_image
  name
end

#compatible?(to_type) ⇒ Boolean

Returns:

  • (Boolean)


5288
5289
5290
# File 'lib/adlint/cc1/type.rb', line 5288

def compatible?(to_type)
  type.floating? && to_type.min <= min && max <= to_type.max
end

#corresponding_signed_typeObject



5348
5349
5350
# File 'lib/adlint/cc1/type.rb', line 5348

def corresponding_signed_type
  self # NOTREACHED
end

#corresponding_unsigned_typeObject



5352
5353
5354
# File 'lib/adlint/cc1/type.rb', line 5352

def corresponding_unsigned_type
  self # NOTREACHED
end

#dupObject



5356
5357
5358
# File 'lib/adlint/cc1/type.rb', line 5356

def dup
  subclass_responsibility
end

#enum?Boolean

Returns:

  • (Boolean)


5304
5305
5306
# File 'lib/adlint/cc1/type.rb', line 5304

def enum?
  false
end

#enumeratorsObject



5320
5321
5322
# File 'lib/adlint/cc1/type.rb', line 5320

def enumerators
  []
end

#explicitly_signed?Boolean

Returns:

  • (Boolean)


5316
5317
5318
# File 'lib/adlint/cc1/type.rb', line 5316

def explicitly_signed?
  true
end

#floating?Boolean

Returns:

  • (Boolean)


5296
5297
5298
# File 'lib/adlint/cc1/type.rb', line 5296

def floating?
  true
end

#idObject



5268
5269
5270
# File 'lib/adlint/cc1/type.rb', line 5268

def id
  subclass_responsibility
end

#imageObject



5272
5273
5274
# File 'lib/adlint/cc1/type.rb', line 5272

def image
  name
end

#incomplete?Boolean

Returns:

  • (Boolean)


5284
5285
5286
# File 'lib/adlint/cc1/type.rb', line 5284

def incomplete?
  false
end

#integer?Boolean

Returns:

  • (Boolean)


5292
5293
5294
# File 'lib/adlint/cc1/type.rb', line 5292

def integer?
  false
end

#integer_conversion_rankObject



5332
5333
5334
# File 'lib/adlint/cc1/type.rb', line 5332

def integer_conversion_rank
  0 # NOTREACHED
end

#integer_promoted_typeObject



5336
5337
5338
# File 'lib/adlint/cc1/type.rb', line 5336

def integer_promoted_type
  self # NOTREACHED
end

#locationObject



5280
5281
5282
# File 'lib/adlint/cc1/type.rb', line 5280

def location
  nil
end

#maxObject



5328
5329
5330
# File 'lib/adlint/cc1/type.rb', line 5328

def max
  (2**fraction_bit_size * 10**(exponent_bit_size - 1)).to_f
end

#minObject



5324
5325
5326
# File 'lib/adlint/cc1/type.rb', line 5324

def min
  (-2**fraction_bit_size * 10**(exponent_bit_size - 1)).to_f
end

#pointer?Boolean

Returns:

  • (Boolean)


5300
5301
5302
# File 'lib/adlint/cc1/type.rb', line 5300

def pointer?
  false
end

#signed?Boolean

Returns:

  • (Boolean)


5312
5313
5314
# File 'lib/adlint/cc1/type.rb', line 5312

def signed?
  true
end