Class: AdLint::Cc1::ArrayAbstractDeclarator

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, size_expr) ⇒ ArrayAbstractDeclarator

Returns a new instance of ArrayAbstractDeclarator.



4352
4353
4354
4355
4356
# File 'lib/adlint/cc1/syntax.rb', line 4352

def initialize(abstract_dcr, size_expr)
  super()
  @base = abstract_dcr
  @size_expression = size_expr
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



4358
4359
4360
# File 'lib/adlint/cc1/syntax.rb', line 4358

def base
  @base
end

#size_expressionObject (readonly)

Returns the value of attribute size_expression.



4359
4360
4361
# File 'lib/adlint/cc1/syntax.rb', line 4359

def size_expression
  @size_expression
end

Instance Method Details

#function?(stack = []) ⇒ Boolean

Returns:

  • (Boolean)


4365
4366
4367
4368
4369
# File 'lib/adlint/cc1/syntax.rb', line 4365

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

#identifier_listObject



4379
4380
4381
# File 'lib/adlint/cc1/syntax.rb', line 4379

def identifier_list
  @base.identifier_list
end

#innermost_parameter_type_listObject



4375
4376
4377
# File 'lib/adlint/cc1/syntax.rb', line 4375

def innermost_parameter_type_list
  @base.innermost_parameter_type_list
end

#inspect(indent = 0) ⇒ Object



4383
4384
4385
# File 'lib/adlint/cc1/syntax.rb', line 4383

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

#locationObject



4361
4362
4363
# File 'lib/adlint/cc1/syntax.rb', line 4361

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

#parameter_type_listObject



4371
4372
4373
# File 'lib/adlint/cc1/syntax.rb', line 4371

def parameter_type_list
  @base.parameter_type_list
end