Class: AdLint::Cc1::TypeName

Inherits:
SyntaxNode show all
Defined in:
lib/adlint/cc1/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from SyntaxNode

#head_location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(spec_qual_list, abstract_dcr, sym_tbl) ⇒ TypeName

Returns a new instance of TypeName.



4234
4235
4236
4237
4238
4239
4240
# File 'lib/adlint/cc1/syntax.rb', line 4234

def initialize(spec_qual_list, abstract_dcr, sym_tbl)
  super()
  @specifier_qualifier_list = spec_qual_list
  @abstract_declarator = abstract_dcr
  @type = nil
  @type_declaration = build_type_declaration(spec_qual_list, sym_tbl)
end

Instance Attribute Details

#abstract_declaratorObject (readonly)

Returns the value of attribute abstract_declarator.



4243
4244
4245
# File 'lib/adlint/cc1/syntax.rb', line 4243

def abstract_declarator
  @abstract_declarator
end

#specifier_qualifier_listObject (readonly)

Returns the value of attribute specifier_qualifier_list.



4242
4243
4244
# File 'lib/adlint/cc1/syntax.rb', line 4242

def specifier_qualifier_list
  @specifier_qualifier_list
end

#typeObject

Returns the value of attribute type.



4244
4245
4246
# File 'lib/adlint/cc1/syntax.rb', line 4244

def type
  @type
end

#type_declarationObject (readonly)

Returns the value of attribute type_declaration.



4245
4246
4247
# File 'lib/adlint/cc1/syntax.rb', line 4245

def type_declaration
  @type_declaration
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



4255
4256
4257
# File 'lib/adlint/cc1/syntax.rb', line 4255

def inspect(indent = 0)
  " " * indent + short_class_name + " (#{@type ? @type.image : "nil"})"
end

#locationObject



4247
4248
4249
# File 'lib/adlint/cc1/syntax.rb', line 4247

def location
  @specifier_qualifier_list.location
end

#to_sObject



4251
4252
4253
# File 'lib/adlint/cc1/syntax.rb', line 4251

def to_s
  @type.image
end