class AdLint::Cpp::BinaryExpression

Attributes

lhs_expression[R]
operator[R]
rhs_expression[R]

Public Class Methods

new(val, op, lhs_expr, rhs_expr) click to toggle source
Calls superclass method AdLint::Cpp::Expression::new
# File lib/adlint/cpp/syntax.rb, line 837
def initialize(val, op, lhs_expr, rhs_expr)
  super(val)
  @operator = op
  @lhs_expression = lhs_expr
  @rhs_expression = rhs_expr
end

Public Instance Methods

inspect(indent = 0) click to toggle source
# File lib/adlint/cpp/syntax.rb, line 856
def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{@operator.inspect})\n" +
    @lhs_expression.inspect(indent + 1) + "\n" +
      @rhs_expression.inspect(indent + 1)
end
location() click to toggle source
# File lib/adlint/cpp/syntax.rb, line 848
def location
  @lhs_expression.location
end
to_s() click to toggle source
# File lib/adlint/cpp/syntax.rb, line 852
def to_s
  "#{@lhs_expression.to_s} #{@operator.value} #{@rhs_expression.to_s}"
end