class AdLint::Cc1::LogicalOrExpression

Public Class Methods

new(op, lhs_operand, rhs_operand) click to toggle source
Calls superclass method AdLint::Cc1::BinaryExpression::new
# File lib/adlint/cc1/syntax.rb, line 2006
def initialize(op, lhs_operand, rhs_operand)
  super

  # NOTE: The ISO C99 standard says;
  #
  # 6.5.14 Logical OR operator
  #
  # Semantics
  #
  # 4 Unlike the bitwise | operator, the || operator guarantees
  #   left-to-right evaluation; there is a sequence point after the
  #   evaluation of the first operand.  If the first operand compares
  #   unequal to 0, the second operand is not evaluated.
  #
  # NOTE: Sequence point will be reached after lhs value reference.
  #       So, notification should be done by ExpressionEvaluator manually.
  # @lhs_operand.append_sequence_point!
end

Public Instance Methods

arithmetic?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2033
def arithmetic?
  false
end
bitwise?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2037
def bitwise?
  false
end
have_side_effect?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2025
def have_side_effect?
  lhs_operand.have_side_effect? || rhs_operand.have_side_effect?
end
logical?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2029
def logical?
  true
end
to_complemental_logical() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2047
def to_complemental_logical
  LogicalAndExpression.new(Token.new("&&", "&&", @operator.location),
                           @lhs_operand.to_complemental_logical,
                           @rhs_operand.to_complemental_logical)
end
to_normalized_logical(parent_expr = nil) click to toggle source
# File lib/adlint/cc1/syntax.rb, line 2041
def to_normalized_logical(parent_expr = nil)
  LogicalOrExpression.new(@operator,
                          @lhs_operand.to_normalized_logical(self),
                          @rhs_operand.to_normalized_logical(self))
end