Class: AdLint::Cc1::IfStatement

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, header_term) ⇒ IfStatement

Returns a new instance of IfStatement.



3488
3489
3490
3491
3492
3493
# File 'lib/adlint/cc1/syntax.rb', line 3488

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

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



3495
3496
3497
# File 'lib/adlint/cc1/syntax.rb', line 3495

def expression
  @expression
end

#header_terminatorObject (readonly)

Returns the value of attribute header_terminator.



3497
3498
3499
# File 'lib/adlint/cc1/syntax.rb', line 3497

def header_terminator
  @header_terminator
end

#statementObject (readonly)

Returns the value of attribute statement.



3496
3497
3498
# File 'lib/adlint/cc1/syntax.rb', line 3496

def statement
  @statement
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



3503
3504
3505
3506
# File 'lib/adlint/cc1/syntax.rb', line 3503

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

#locationObject



3499
3500
3501
# File 'lib/adlint/cc1/syntax.rb', line 3499

def location
  head_location
end