class AdLint::Cc1::PointerTypeId

Attributes

base_type[R]

Public Class Methods

new(base_type) click to toggle source
Calls superclass method AdLint::Cc1::TypeId::new
# File lib/adlint/cc1/type.rb, line 5232
def initialize(base_type)
  super(create_value(base_type))
  @base_type = base_type
end

Public Instance Methods

==(rhs_id) click to toggle source
# File lib/adlint/cc1/type.rb, line 5237
def ==(rhs_id)
  case rhs_id
  when PointerTypeId
    @base_type == rhs_id.base_type
  else
    false
  end
end
hash() click to toggle source
# File lib/adlint/cc1/type.rb, line 5246
def hash
  "#{@base_type.id.hash}*".hash
end

Private Instance Methods

create_value(base_type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5254
def create_value(base_type)
  real_type = base_type.real_type

  if real_type.function?
    "#{real_type.return_type.brief_image}(*)(" +
      real_type.parameter_types.map { |type| type.brief_image }.join(",") +
      (real_type.have_va_list? ? ",...)" : ")")
  else
    "#{real_type.brief_image} *"
  end
end