Exemplo n.º 1
0
 public void AddFunction(string function, int arity, string literal)
 {
     try
     {
         string error = FunctionRegister.CheckFunctionName(function);
         if (error != null)
         {
             //logger.warning(error);
         }
         else
         {
             functions.Add(function, new RuleToFunction(literal, arity));
         }
     }
     catch (Exception e)
     {
         //logger.log(Level.SEVERE, "Error registering function " + literal, e);
     }
 }
Exemplo n.º 2
0
 //Class<? extends ArithFunction> c ?? wtf is this
 private void AddFunction(Type c, bool user)
 {
     try
     {
         ArithFunction af    = (ArithFunction)Activator.CreateInstance(typeof(ArithFunction));
         string        error = null;
         if (user)
         {
             error = FunctionRegister.CheckFunctionName(af.GetName());
         }
         if (error != null)
         {
             //logger.warning(error);
         }
         else
         {
             functions.Add(af.GetName(), af);
         }
     }
     catch (Exception e)
     {
         //logger.log(Level.SEVERE, "Error registering function " + c.getName(), e);
     }
 }