Class: AdLint::Cc1::SwitchStatement

Inherits:
SelectionStatement 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(expr, stmt) ⇒ SwitchStatement

Returns a new instance of SwitchStatement.



3557
3558
3559
3560
3561
3562
# File 'lib/adlint/cc1/syntax.rb', line 3557

def initialize(expr, stmt)
  super()
  @expression = expr
  @statement = stmt
  derive_clause_conditions
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



3564
3565
3566
# File 'lib/adlint/cc1/syntax.rb', line 3564

def expression
  @expression
end

#statementObject (readonly)

Returns the value of attribute statement.



3565
3566
3567
# File 'lib/adlint/cc1/syntax.rb', line 3565

def statement
  @statement
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3571
3572
3573
3574
# File 'lib/adlint/cc1/syntax.rb', line 3571

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

#locationObject



3567
3568
3569
# File 'lib/adlint/cc1/syntax.rb', line 3567

def location
  head_location
end