Class: Ronin::Code::SQL::BinaryExpr

Inherits:
Expr
  • Object
show all
Defined in:
lib/ronin/code/sql/binary_expr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expr

#===, #in?, #not_in?

Constructor Details

#initialize(op, left, right) ⇒ BinaryExpr

Returns a new instance of BinaryExpr.



38
39
40
41
42
# File 'lib/ronin/code/sql/binary_expr.rb', line 38

def initialize(op,left,right)
  @op = op
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Left-hand side



33
34
35
# File 'lib/ronin/code/sql/binary_expr.rb', line 33

def left
  @left
end

#opObject (readonly)

Operator



30
31
32
# File 'lib/ronin/code/sql/binary_expr.rb', line 30

def op
  @op
end

#rightObject (readonly)

Right-hand side



36
37
38
# File 'lib/ronin/code/sql/binary_expr.rb', line 36

def right
  @right
end

Instance Method Details

#emitObject



44
45
46
# File 'lib/ronin/code/sql/binary_expr.rb', line 44

def emit
  emit_value(@left) + emit_token(@op) + emit_value(@right)
end