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.
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
#label ⇒ Object (readonly)
Returns the value of attribute label.
3396 3397 3398 |
# File 'lib/adlint/cc1/syntax.rb', line 3396 def label @label end |
#referrers ⇒ Object (readonly)
Returns the value of attribute referrers.
3398 3399 3400 |
# File 'lib/adlint/cc1/syntax.rb', line 3398 def referrers @referrers end |
#statement ⇒ Object (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 |
#location ⇒ Object
3400 3401 3402 |
# File 'lib/adlint/cc1/syntax.rb', line 3400 def location @label.location end |