Class: AddNode

Inherits:
BinaryNode show all
Defined in:
lib/ast.rb

Overview

Operaciones Suma, Resta, Multiplicacion, Division y Modulo

Instance Attribute Summary

Attributes inherited from BinaryNode

#left, #right

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ AddNode

Returns a new instance of AddNode.



23
24
25
# File 'lib/ast.rb', line 23

def initialize(left, right)
  super(left,right) # Llama o recibe los atributos del padre
end

Instance Method Details

#evaluateObject



27
28
29
# File 'lib/ast.rb', line 27

def evaluate() 
  return @left.evaluate() + @right.evaluate() #No es necesario el "Return"
end