def evaluate(self, env: Environment):
     e1, e2 = self.e1.evaluate(env), self.e2.evaluate(env)
     func: function.FunctionObj = env.find_function('^')
     ret = func.compute(
         [function.Param('e1', e1),
          function.Param('e2', e2)], env)
     return ret
Esempio n. 2
0
 def compute(self, env: Environment):
     e1, e2 = self.e1.evaluate(env), self.e2.evaluate(env)
     func: function.FunctionObj = env.find_function('/')
     new_env = arrange_params_with_function_args(
         [function.Param('e1', e1),
          function.Param('e2', e2)], func, env)
     ret = func.compute(new_env)
     return ret
Esempio n. 3
0
 def compute(self, env: Environment):
     x, y = self.x.evaluate(env), self.y.evaluate(env)
     func: function.FunctionObj = env.find_function('<=')
     new_env = arrange_params_with_function_args(
         [function.Param('x', x),
          function.Param('y', y)], func, env)
     ret = func.compute(new_env)
     return ret
Esempio n. 4
0
    def compute(self, env: Environment):
        fun_to_find = '<-'

        if isinstance(self.item, DLRObj):
            fun_to_find = '$<-'
        elif isinstance(self.item, AssignObj):
            fun_to_find = '[<-'
        elif isinstance(self.item, SuperAssignObj):
            fun_to_find = '[[<-'

        func: function.FunctionObj = env.global_env.find_function(
            fun_to_find, self.item.get_classes_as_python_list())

        new_env = arrange_params_with_function_args([
            function.Param('x', self.item),
            function.Param('value', self.value)
        ], func, env.global_env)
        ret = func.compute(new_env)
        return ret
 def evaluate(self, env: Environment):
     e = self.e.evaluate(env)
     func: function.FunctionObj = env.find_function('-')
     ret = func.compute([function.Param('e1', e)], env)
     return ret
 def evaluate(self, env: Environment):
     x, y = self.x.evaluate(env), self.y.evaluate(env)
     func: function.FunctionObj = env.find_function('!')
     ret = func.compute([function.Param('x', x)], env)
     return ret