Class: AdLint::Cc1::CaseLabeledStatement

Inherits:
LabeledStatement 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) ⇒ CaseLabeledStatement

Returns a new instance of CaseLabeledStatement.



3411
3412
3413
3414
3415
# File 'lib/adlint/cc1/syntax.rb', line 3411

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

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



3417
3418
3419
# File 'lib/adlint/cc1/syntax.rb', line 3417

def expression
  @expression
end

#normalized_expressionObject

Returns the value of attribute normalized_expression.



3419
3420
3421
# File 'lib/adlint/cc1/syntax.rb', line 3419

def normalized_expression
  @normalized_expression
end

#statementObject (readonly)

Returns the value of attribute statement.



3418
3419
3420
# File 'lib/adlint/cc1/syntax.rb', line 3418

def statement
  @statement
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3425
3426
3427
3428
# File 'lib/adlint/cc1/syntax.rb', line 3425

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

#locationObject



3421
3422
3423
# File 'lib/adlint/cc1/syntax.rb', line 3421

def location
  head_location
end