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.



3408
3409
3410
3411
3412
3413
# File 'lib/adlint/cc1/syntax.rb', line 3408

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

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



3415
3416
3417
# File 'lib/adlint/cc1/syntax.rb', line 3415

def label
  @label
end

#referrersObject (readonly)

Returns the value of attribute referrers.



3417
3418
3419
# File 'lib/adlint/cc1/syntax.rb', line 3417

def referrers
  @referrers
end

#statementObject (readonly)

Returns the value of attribute statement.



3416
3417
3418
# File 'lib/adlint/cc1/syntax.rb', line 3416

def statement
  @statement
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3423
3424
3425
3426
# File 'lib/adlint/cc1/syntax.rb', line 3423

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

#locationObject



3419
3420
3421
# File 'lib/adlint/cc1/syntax.rb', line 3419

def location
  @label.location
end