Class: AdLint::Cc1::PointerAbstractDeclarator

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

Instance Attribute Summary collapse

Attributes inherited from Declarator

#pointer

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from AbstractDeclarator

#abstract?, #identifier

Methods inherited from Declarator

#abstract?, #full=, #full?, #identifier, #variable?

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(abstract_dcr, ptr) ⇒ PointerAbstractDeclarator

Returns a new instance of PointerAbstractDeclarator.



4283
4284
4285
4286
4287
# File 'lib/adlint/cc1/syntax.rb', line 4283

def initialize(abstract_dcr, ptr)
  super()
  @base = abstract_dcr
  @pointer = ptr
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



4289
4290
4291
# File 'lib/adlint/cc1/syntax.rb', line 4289

def base
  @base
end

Instance Method Details

#function?(stack = []) ⇒ Boolean

Returns:

  • (Boolean)


4295
4296
4297
4298
4299
# File 'lib/adlint/cc1/syntax.rb', line 4295

def function?(stack = [])
  stack.push(:pointer)
  @base.function?(stack) if @base
  stack.last == :function
end

#identifier_listObject



4309
4310
4311
# File 'lib/adlint/cc1/syntax.rb', line 4309

def identifier_list
  @base.identifier_list
end

#innermost_parameter_type_listObject



4305
4306
4307
# File 'lib/adlint/cc1/syntax.rb', line 4305

def innermost_parameter_type_list
  @base.innermost_parameter_type_list
end

#inspect(indent = 0) ⇒ Object



4313
4314
4315
# File 'lib/adlint/cc1/syntax.rb', line 4313

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

#locationObject



4291
4292
4293
# File 'lib/adlint/cc1/syntax.rb', line 4291

def location
  @base ? @base.location || head_location : head_location
end

#parameter_type_listObject



4301
4302
4303
# File 'lib/adlint/cc1/syntax.rb', line 4301

def parameter_type_list
  @base.parameter_type_list
end