class AdLint::Cc1::UnionType

Attributes

image[RW]
location[RW]

Public Class Methods

new(type_tbl, type_dcl, membs) click to toggle source

TODO: Must implement member overlapping semantics.

Calls superclass method AdLint::Cc1::CompositeDataType::new
# 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

Public Instance Methods

arithmetic_type_with(type) click to toggle source
# File lib/adlint/cc1/type.rb, line 6786
def arithmetic_type_with(type)
  type._arithmetic_type_with_union(self)
end
brief_image() click to toggle source
# File lib/adlint/cc1/type.rb, line 6770
def brief_image
  "union #{name}"
end
id() click to toggle source
# File lib/adlint/cc1/type.rb, line 6766
def id
  @id ||= UnionTypeId.new(name)
end
named?() click to toggle source
# File lib/adlint/cc1/type.rb, line 6774
def named?
  declarations.all? { |dcl| !dcl.union_specifier.anonymous? }
end
struct?() click to toggle source
# File lib/adlint/cc1/type.rb, line 6778
def struct?
  false
end
union?() click to toggle source
# File lib/adlint/cc1/type.rb, line 6782
def union?
  true
end