Class: AdLint::Cc1::UnionType
- Inherits:
-
CompositeDataType
- Object
- Type
- CompositeDataType
- AdLint::Cc1::UnionType
- Defined in:
- lib/adlint/cc1/type.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
-
#location ⇒ Object
Returns the value of attribute location.
Attributes inherited from CompositeDataType
Attributes included from Scopeable
Attributes inherited from Type
#declarations, #name, #type_table
Instance Method Summary collapse
- #arithmetic_type_with(type) ⇒ Object
- #brief_image ⇒ Object
- #id ⇒ Object
-
#initialize(type_tbl, type_dcl, membs) ⇒ UnionType
constructor
TODO: Must implement member overlapping semantics.
- #named? ⇒ Boolean
- #struct? ⇒ Boolean
- #union? ⇒ Boolean
Methods inherited from CompositeDataType
#_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, #arbitrary_value, #argument_promoted_type, #array?, #base_type, #bit_alignment, #bit_size, #bitfield?, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #compatible?, #const?, #corresponding_signed_type, #corresponding_unsigned_type, #dup, #enum?, #enumerators, #explicitly_signed?, #floating?, #function?, #have_va_list?, #impl_length, #incomplete?, #integer?, #integer_conversion_rank, #integer_promoted_type, #length, #max, #member_named, #min, #nil_value, #parameter_types, #parameter_value, #pointer?, #qualified?, #real_type, #restrict?, #return_type, #return_value, #scalar?, #signed?, #standard?, #undeclared?, #undefined_value, #unqualify, #unresolved?, #user?, #void?, #volatile?, #zero_value
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, #argument_promoted_type, #array?, #base_type, #bit_alignment, #bit_size, #bitfield?, #byte_alignment, #byte_size, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #compatible?, #composite?, #const?, #convertible?, #corresponding_signed_type, #corresponding_unsigned_type, #dup, #enum?, #enumerators, #explicitly_signed?, #floating?, #function?, #have_va_list?, #impl_length, #incomplete?, #inspect, #integer?, #integer_conversion_rank, #integer_promoted_type, #length, #length=, #max, #member_named, #members, #min, #more_cv_qualified?, #nil_value, #parameter?, #parameter_types, #parameter_value, #pointer?, #qualified?, #real_type, #restrict?, #return_type, #return_value, #same_as?, #scalar?, #signed?, #standard?, #undeclared?, #undefined_value, #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
Constructor Details
#initialize(type_tbl, type_dcl, membs) ⇒ UnionType
TODO: Must implement member overlapping semantics.
6757 6758 6759 6760 6761 |
# File 'lib/adlint/cc1/type.rb', line 6757 def initialize(type_tbl, type_dcl, membs) super(type_tbl, type_dcl.identifier.value, [type_dcl], membs) @image = type_dcl.union_specifier.to_s @location = type_dcl.location end |
Instance Attribute Details
#image ⇒ Object
Returns the value of attribute image.
6763 6764 6765 |
# File 'lib/adlint/cc1/type.rb', line 6763 def image @image end |
#location ⇒ Object
Returns the value of attribute location.
6764 6765 6766 |
# File 'lib/adlint/cc1/type.rb', line 6764 def location @location end |
Instance Method Details
#arithmetic_type_with(type) ⇒ Object
6786 6787 6788 |
# File 'lib/adlint/cc1/type.rb', line 6786 def arithmetic_type_with(type) type._arithmetic_type_with_union(self) end |
#brief_image ⇒ Object
6770 6771 6772 |
# File 'lib/adlint/cc1/type.rb', line 6770 def brief_image "union #{name}" end |
#id ⇒ Object
6766 6767 6768 |
# File 'lib/adlint/cc1/type.rb', line 6766 def id @id ||= UnionTypeId.new(name) end |
#named? ⇒ Boolean
6774 6775 6776 |
# File 'lib/adlint/cc1/type.rb', line 6774 def named? declarations.all? { |dcl| !dcl.union_specifier.anonymous? } end |
#struct? ⇒ Boolean
6778 6779 6780 |
# File 'lib/adlint/cc1/type.rb', line 6778 def struct? false end |
#union? ⇒ Boolean
6782 6783 6784 |
# File 'lib/adlint/cc1/type.rb', line 6782 def union? true end |