Class: AdLint::Cc1::BinaryExpression
- Inherits:
-
Expression
- Object
- SyntaxNode
- Expression
- AdLint::Cc1::BinaryExpression
- Defined in:
- lib/adlint/cc1/syntax.rb
Direct Known Subclasses
AdditiveExpression, AndExpression, CompoundAssignmentExpression, EqualityExpression, ExclusiveOrExpression, InclusiveOrExpression, LogicalAndExpression, LogicalOrExpression, MultiplicativeExpression, RelationalExpression, ShiftExpression, SimpleAssignmentExpression
Instance Attribute Summary collapse
-
#lhs_operand ⇒ Object
readonly
Returns the value of attribute lhs_operand.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#rhs_operand ⇒ Object
readonly
Returns the value of attribute rhs_operand.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(op, lhs_operand, rhs_operand) ⇒ BinaryExpression
constructor
A new instance of BinaryExpression.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from Expression
#arithmetic?, #bitwise?, #constant?, #full=, #have_side_effect?, #logical?, #object_specifiers, #to_complemental_logical, #to_normalized_logical
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(op, lhs_operand, rhs_operand) ⇒ BinaryExpression
Returns a new instance of BinaryExpression.
1689 1690 1691 1692 1693 1694 |
# File 'lib/adlint/cc1/syntax.rb', line 1689 def initialize(op, lhs_operand, rhs_operand) super() @operator = op @lhs_operand = lhs_operand @rhs_operand = rhs_operand end |
Instance Attribute Details
#lhs_operand ⇒ Object (readonly)
Returns the value of attribute lhs_operand.
1697 1698 1699 |
# File 'lib/adlint/cc1/syntax.rb', line 1697 def lhs_operand @lhs_operand end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
1696 1697 1698 |
# File 'lib/adlint/cc1/syntax.rb', line 1696 def operator @operator end |
#rhs_operand ⇒ Object (readonly)
Returns the value of attribute rhs_operand.
1698 1699 1700 |
# File 'lib/adlint/cc1/syntax.rb', line 1698 def rhs_operand @rhs_operand end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
1708 1709 1710 1711 |
# File 'lib/adlint/cc1/syntax.rb', line 1708 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + "#{@operator.value} #{lhs_operand.inspect} #{rhs_operand.inspect}" end |
#location ⇒ Object
1700 1701 1702 |
# File 'lib/adlint/cc1/syntax.rb', line 1700 def location @operator.location end |
#to_s ⇒ Object
1704 1705 1706 |
# File 'lib/adlint/cc1/syntax.rb', line 1704 def to_s "#{@lhs_operand.to_s} #{@operator.value} #{@rhs_operand.to_s}" end |