Class: AdLint::Cc1::CompoundAssignmentExpression

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)


2177
2178
2179
# File 'lib/adlint/cc1/syntax.rb', line 2177

def arithmetic?
  ["*=", "/=", "%=", "+=", "-="].include?(operator.type)
end

#bitwise?Boolean

Returns:

  • (Boolean)


2181
2182
2183
# File 'lib/adlint/cc1/syntax.rb', line 2181

def bitwise?
  ["<<=", ">>=", "&=", "^=", "|="].include?(operator.type)
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


2169
2170
2171
# File 'lib/adlint/cc1/syntax.rb', line 2169

def have_side_effect?
  true
end

#logical?Boolean

Returns:

  • (Boolean)


2173
2174
2175
# File 'lib/adlint/cc1/syntax.rb', line 2173

def logical?
  false
end

#to_complemental_logicalObject



2194
2195
2196
# File 'lib/adlint/cc1/syntax.rb', line 2194

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



2185
2186
2187
2188
2189
2190
2191
2192
# File 'lib/adlint/cc1/syntax.rb', line 2185

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