Class: AdLint::Cc1::ParameterDeclaration

Inherits:
SyntaxNode
  • Object
show all
Includes:
DeclarationSpecifiersHolder
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 included from DeclarationSpecifiersHolder

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

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, dcr) ⇒ ParameterDeclaration

Returns a new instance of ParameterDeclaration.



3357
3358
3359
3360
3361
3362
# File 'lib/adlint/cc1/syntax.rb', line 3357

def initialize(dcl_specs, dcr)
  super()
  @declaration_specifiers = dcl_specs
  @declarator = dcr
  @type = nil
end

Instance Attribute Details

#declaration_specifiersObject (readonly)

Returns the value of attribute declaration_specifiers.



3364
3365
3366
# File 'lib/adlint/cc1/syntax.rb', line 3364

def declaration_specifiers
  @declaration_specifiers
end

#declaratorObject (readonly)

Returns the value of attribute declarator.



3365
3366
3367
# File 'lib/adlint/cc1/syntax.rb', line 3365

def declarator
  @declarator
end

#typeObject

Returns the value of attribute type.



3366
3367
3368
# File 'lib/adlint/cc1/syntax.rb', line 3366

def type
  @type
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3372
3373
3374
# File 'lib/adlint/cc1/syntax.rb', line 3372

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

#locationObject



3368
3369
3370
# File 'lib/adlint/cc1/syntax.rb', line 3368

def location
  @declarator ? @declarator.location : @declaration_specifiers.location
end