Class: Rubycc::Front::AST::Binary

Inherits:
Data
  • Object
show all
Defined in:
lib/rubycc/front/ast.rb

Overview

Binary operation. op is one of :add, :sub, :mul, :div, :mod (arithmetic), :and, :or, :xor (bitwise), :shl, :shr (shifts) or :eq, :ne, :lt, :le, :gt, :ge (comparisons yielding int 0/1). The unary bitwise-not "~x" has no op of its own: the parser desugars it to the Binary "x ^ -1", so it reaches the generator as an ordinary :xor.

Instance Attribute Summary collapse

Instance Attribute Details

#lhsObject (readonly)

Returns the value of attribute lhs

Returns:

  • (Object)

    the current value of lhs



35
36
37
# File 'lib/rubycc/front/ast.rb', line 35

def lhs
  @lhs
end

#opObject (readonly)

Returns the value of attribute op

Returns:

  • (Object)

    the current value of op



35
36
37
# File 'lib/rubycc/front/ast.rb', line 35

def op
  @op
end

#rhsObject (readonly)

Returns the value of attribute rhs

Returns:

  • (Object)

    the current value of rhs



35
36
37
# File 'lib/rubycc/front/ast.rb', line 35

def rhs
  @rhs
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



35
36
37
# File 'lib/rubycc/front/ast.rb', line 35

def token
  @token
end