class AdLint::Cc1::LogicalAndExpression

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 1957
def initialize(op, lhs_operand, rhs_operand)
  super

  # NOTE: The ISO C99 standard says;
  #
  # 6.5.13 Logical AND operator
  #
  # Semantics
  #
  # 4 Unlike the bitwise binary & 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 equal
  #   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 1984
def arithmetic?
  false
end
bitwise?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 1988
def bitwise?
  false
end
have_side_effect?() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 1976
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 1980
def logical?
  true
end
to_complemental_logical() click to toggle source
# File lib/adlint/cc1/syntax.rb, line 1998
def to_complemental_logical
  LogicalOrExpression.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 1992
def to_normalized_logical(parent_expr = nil)
  LogicalAndExpression.new(@operator,
                           @lhs_operand.to_normalized_logical(self),
                           @rhs_operand.to_normalized_logical(self))
end