Class: AdLint::Cc1::GenericLabeledStatement
- Inherits:
-
LabeledStatement
- Object
- SyntaxNode
- Statement
- LabeledStatement
- AdLint::Cc1::GenericLabeledStatement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#referrers ⇒ Object
readonly
Returns the value of attribute referrers.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Attributes inherited from Statement
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(label, stmt) ⇒ GenericLabeledStatement
constructor
A new instance of GenericLabeledStatement.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods inherited from Statement
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
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
#label ⇒ Object (readonly)
Returns the value of attribute label.
3415 3416 3417 |
# File 'lib/adlint/cc1/syntax.rb', line 3415 def label @label end |
#referrers ⇒ Object (readonly)
Returns the value of attribute referrers.
3417 3418 3419 |
# File 'lib/adlint/cc1/syntax.rb', line 3417 def referrers @referrers end |
#statement ⇒ Object (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 |
#location ⇒ Object
3419 3420 3421 |
# File 'lib/adlint/cc1/syntax.rb', line 3419 def location @label.location end |