Class: AdLint::Cc1::TypedefDeclaration

Inherits:
TypeDeclaration show all
Includes:
DeclarationSpecifiersHolder
Defined in:
lib/adlint/cc1/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from TypeDeclaration

#symbol

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods included from DeclarationSpecifiersHolder

#explicitly_typed?, #function_specifier, #implicitly_typed?, #storage_class_specifier, #type_qualifiers, #type_specifiers

Methods included from SymbolicElement

#mark_as_referred_by

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(dcl_specs, init_dcr, sym) ⇒ TypedefDeclaration

Returns a new instance of TypedefDeclaration.



2528
2529
2530
2531
2532
2533
# File 'lib/adlint/cc1/syntax.rb', line 2528

def initialize(dcl_specs, init_dcr, sym)
  super(sym)
  @declaration_specifiers = dcl_specs
  @init_declarator = init_dcr
  @type = nil
end

Instance Attribute Details

#declaration_specifiersObject (readonly)

Returns the value of attribute declaration_specifiers.



2535
2536
2537
# File 'lib/adlint/cc1/syntax.rb', line 2535

def declaration_specifiers
  @declaration_specifiers
end

#init_declaratorObject (readonly)

Returns the value of attribute init_declarator.



2536
2537
2538
# File 'lib/adlint/cc1/syntax.rb', line 2536

def init_declarator
  @init_declarator
end

#typeObject

Returns the value of attribute type.



2537
2538
2539
# File 'lib/adlint/cc1/syntax.rb', line 2537

def type
  @type
end

Instance Method Details

#declaratorObject



2543
2544
2545
# File 'lib/adlint/cc1/syntax.rb', line 2543

def declarator
  @init_declarator.declarator
end

#identifierObject



2539
2540
2541
# File 'lib/adlint/cc1/syntax.rb', line 2539

def identifier
  @init_declarator.declarator.identifier
end

#inspect(indent = 0) ⇒ Object



2551
2552
2553
2554
# File 'lib/adlint/cc1/syntax.rb', line 2551

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{location.inspect}) " +
    identifier.value
end

#locationObject



2547
2548
2549
# File 'lib/adlint/cc1/syntax.rb', line 2547

def location
  identifier.location
end