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.



4333
4334
4335
4336
4337
# File 'lib/adlint/cc1/syntax.rb', line 4333

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.



4339
4340
4341
# File 'lib/adlint/cc1/syntax.rb', line 4339

def base
  @base
end

#size_expressionObject (readonly)

Returns the value of attribute size_expression.



4340
4341
4342
# File 'lib/adlint/cc1/syntax.rb', line 4340

def size_expression
  @size_expression
end

Instance Method Details

#function?(stack = []) ⇒ Boolean

Returns:

  • (Boolean)


4346
4347
4348
4349
4350
# File 'lib/adlint/cc1/syntax.rb', line 4346

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

#identifier_listObject



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

def identifier_list
  @base.identifier_list
end

#innermost_parameter_type_listObject



4356
4357
4358
# File 'lib/adlint/cc1/syntax.rb', line 4356

def innermost_parameter_type_list
  @base.innermost_parameter_type_list
end

#inspect(indent = 0) ⇒ Object



4364
4365
4366
# File 'lib/adlint/cc1/syntax.rb', line 4364

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

#locationObject



4342
4343
4344
# File 'lib/adlint/cc1/syntax.rb', line 4342

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

#parameter_type_listObject



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

def parameter_type_list
  @base.parameter_type_list
end