Class: AdLint::Cc1::UnaryArithmeticExpression
Instance Attribute Summary
#operand, #operator
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary
collapse
#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
#analysis_target?
Methods included from Visitable
#accept
Instance Method Details
#arithmetic? ⇒ Boolean
1462
1463
1464
|
# File 'lib/adlint/cc1/syntax.rb', line 1462
def arithmetic?
false
end
|
#bitwise? ⇒ Boolean
1466
1467
1468
|
# File 'lib/adlint/cc1/syntax.rb', line 1466
def bitwise?
operator.type == "~"
end
|
#have_side_effect? ⇒ Boolean
1454
1455
1456
|
# File 'lib/adlint/cc1/syntax.rb', line 1454
def have_side_effect?
operand.have_side_effect?
end
|
#logical? ⇒ Boolean
1458
1459
1460
|
# File 'lib/adlint/cc1/syntax.rb', line 1458
def logical?
operator.type == "!"
end
|
#to_complemental_logical ⇒ Object
1484
1485
1486
1487
1488
1489
1490
1491
1492
|
# File 'lib/adlint/cc1/syntax.rb', line 1484
def to_complemental_logical
if operator.type == "!"
__NOTREACHED__
else
self
end
end
|
#to_normalized_logical(parent_expr = nil) ⇒ Object
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
|
# File 'lib/adlint/cc1/syntax.rb', line 1470
def to_normalized_logical(parent_expr = nil)
if operator.type == "!"
normalized_operand = @operand.to_normalized_logical
GroupedExpression.new(normalized_operand.to_complemental_logical)
else
case parent_expr
when nil, LogicalAndExpression, LogicalOrExpression
create_normalized_logical_of(self)
else
self
end
end
end
|