Class: AdLint::Cc1::InitDeclarator

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(dcr, init, equals_sign) ⇒ InitDeclarator

Returns a new instance of InitDeclarator.



2695
2696
2697
2698
2699
2700
# File 'lib/adlint/cc1/syntax.rb', line 2695

def initialize(dcr, init, equals_sign)
  super()
  @declarator = dcr
  @initializer = init
  @equals_sign = equals_sign
end

Instance Attribute Details

#declaratorObject (readonly)

Returns the value of attribute declarator.



2702
2703
2704
# File 'lib/adlint/cc1/syntax.rb', line 2702

def declarator
  @declarator
end

#equals_signObject (readonly)

Returns the value of attribute equals_sign.



2704
2705
2706
# File 'lib/adlint/cc1/syntax.rb', line 2704

def equals_sign
  @equals_sign
end

#initializerObject (readonly)

Returns the value of attribute initializer.



2703
2704
2705
# File 'lib/adlint/cc1/syntax.rb', line 2703

def initializer
  @initializer
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



2710
2711
2712
# File 'lib/adlint/cc1/syntax.rb', line 2710

def inspect(indent = 0)
  " " * indent + short_class_name
end

#locationObject



2706
2707
2708
# File 'lib/adlint/cc1/syntax.rb', line 2706

def location
  @declarator.identifier.location
end