Class: AdLint::Cc1::GenericLabeledStatement

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

Instance Attribute Summary collapse

Attributes inherited from Statement

#executed

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from Statement

#executed?

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(label, stmt) ⇒ GenericLabeledStatement

Returns a new instance of GenericLabeledStatement.



3389
3390
3391
3392
3393
3394
# File 'lib/adlint/cc1/syntax.rb', line 3389

def initialize(label, stmt)
  super()
  @label = label
  @statement = stmt
  @referrers = []
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



3396
3397
3398
# File 'lib/adlint/cc1/syntax.rb', line 3396

def label
  @label
end

#referrersObject (readonly)

Returns the value of attribute referrers.



3398
3399
3400
# File 'lib/adlint/cc1/syntax.rb', line 3398

def referrers
  @referrers
end

#statementObject (readonly)

Returns the value of attribute statement.



3397
3398
3399
# File 'lib/adlint/cc1/syntax.rb', line 3397

def statement
  @statement
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3404
3405
3406
3407
# File 'lib/adlint/cc1/syntax.rb', line 3404

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{@label.inspect})\n" +
    @statement.inspect(indent + 1)
end

#locationObject



3400
3401
3402
# File 'lib/adlint/cc1/syntax.rb', line 3400

def location
  @label.location
end