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.



4215
4216
4217
4218
4219
4220
4221
# File 'lib/adlint/cc1/syntax.rb', line 4215

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.



4224
4225
4226
# File 'lib/adlint/cc1/syntax.rb', line 4224

def abstract_declarator
  @abstract_declarator
end

#specifier_qualifier_listObject (readonly)

Returns the value of attribute specifier_qualifier_list.



4223
4224
4225
# File 'lib/adlint/cc1/syntax.rb', line 4223

def specifier_qualifier_list
  @specifier_qualifier_list
end

#typeObject

Returns the value of attribute type.



4225
4226
4227
# File 'lib/adlint/cc1/syntax.rb', line 4225

def type
  @type
end

#type_declarationObject (readonly)

Returns the value of attribute type_declaration.



4226
4227
4228
# File 'lib/adlint/cc1/syntax.rb', line 4226

def type_declaration
  @type_declaration
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



4236
4237
4238
# File 'lib/adlint/cc1/syntax.rb', line 4236

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

#locationObject



4228
4229
4230
# File 'lib/adlint/cc1/syntax.rb', line 4228

def location
  @specifier_qualifier_list.location
end

#to_sObject



4232
4233
4234
# File 'lib/adlint/cc1/syntax.rb', line 4232

def to_s
  @type.image
end