Class: AdLint::Cc1::AdditiveExpression

Inherits:
BinaryExpression show all
Defined in:
lib/adlint/cc1/syntax.rb

Instance Attribute Summary

Attributes inherited from BinaryExpression

#lhs_operand, #operator, #rhs_operand

Attributes inherited from SyntaxNode

#head_token, #subsequent_sequence_point, #tail_token

Instance Method Summary collapse

Methods inherited from BinaryExpression

#initialize, #inspect, #location, #to_s

Methods inherited from Expression

#constant?, #full=, #initialize, #object_specifiers, #to_s

Methods inherited from SyntaxNode

#head_location, #initialize, #inspect, #location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

This class inherits a constructor from AdLint::Cc1::BinaryExpression

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


1754
1755
1756
# File 'lib/adlint/cc1/syntax.rb', line 1754

def arithmetic?
  true
end

#bitwise?Boolean

Returns:

  • (Boolean)


1758
1759
1760
# File 'lib/adlint/cc1/syntax.rb', line 1758

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


1746
1747
1748
# File 'lib/adlint/cc1/syntax.rb', line 1746

def have_side_effect?
  lhs_operand.have_side_effect? || rhs_operand.have_side_effect?
end

#logical?Boolean

Returns:

  • (Boolean)


1750
1751
1752
# File 'lib/adlint/cc1/syntax.rb', line 1750

def logical?
  false
end

#to_complemental_logicalObject



1771
1772
1773
# File 'lib/adlint/cc1/syntax.rb', line 1771

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



1762
1763
1764
1765
1766
1767
1768
1769
# File 'lib/adlint/cc1/syntax.rb', line 1762

def to_normalized_logical(parent_expr = nil)
  case parent_expr
  when nil, LogicalAndExpression, LogicalOrExpression
    create_normalized_logical_of(self)
  else
    self
  end
end