Class: AdLint::Cc1::SwitchStatement
- Inherits:
-
SelectionStatement
- Object
- SyntaxNode
- Statement
- SelectionStatement
- AdLint::Cc1::SwitchStatement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#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(expr, stmt) ⇒ SwitchStatement
constructor
A new instance of SwitchStatement.
- #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(expr, stmt) ⇒ SwitchStatement
Returns a new instance of SwitchStatement.
3538 3539 3540 3541 3542 3543 |
# File 'lib/adlint/cc1/syntax.rb', line 3538 def initialize(expr, stmt) super() @expression = expr @statement = stmt derive_clause_conditions end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3545 3546 3547 |
# File 'lib/adlint/cc1/syntax.rb', line 3545 def expression @expression end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
3546 3547 3548 |
# File 'lib/adlint/cc1/syntax.rb', line 3546 def statement @statement end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3552 3553 3554 3555 |
# File 'lib/adlint/cc1/syntax.rb', line 3552 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1) end |
#location ⇒ Object
3548 3549 3550 |
# File 'lib/adlint/cc1/syntax.rb', line 3548 def location head_location end |