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.



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

#expressionObject (readonly)

Returns the value of attribute expression.



3545
3546
3547
# File 'lib/adlint/cc1/syntax.rb', line 3545

def expression
  @expression
end

#statementObject (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

#locationObject



3548
3549
3550
# File 'lib/adlint/cc1/syntax.rb', line 3548

def location
  head_location
end