class AdLint::Cc1::ParameterType

NOTE: ParameterType is a decorator which attaches a parameter name to other

types.

Attributes

param_name[R]
type[R]

Public Class Methods

new(type_tbl, type, dcl_or_def = nil) click to toggle source
Calls superclass method AdLint::Cc1::Type::new
# File lib/adlint/cc1/type.rb, line 6950
def initialize(type_tbl, type, dcl_or_def = nil)
  super(type_tbl, type.name, type.declarations)
  @type = type

  if dcl_or_def and dcr = dcl_or_def.declarator
    identifier = dcr.identifier
  end

  @param_name = identifier ? identifier.value : ""
  @declaration_or_definition = dcl_or_def
end

Public Instance Methods

dup() click to toggle source
# File lib/adlint/cc1/type.rb, line 7088
def dup
  ParameterType.new(type_table, @type.dup, @declaration_or_definition)
end
location() click to toggle source
# File lib/adlint/cc1/type.rb, line 6969
def location
  @declaration_or_definition ?
    @declaration_or_definition.location : @type.location
end
parameter?() click to toggle source
# File lib/adlint/cc1/type.rb, line 6994
def parameter?
  true
end
real_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 6980
def real_type
  ParameterType.new(type_table, @type.real_type,
                    @declaration_or_definition)
end