Package org.asturlinux.frade.currin.program

Examples of org.asturlinux.frade.currin.program.Function



    public void run( String function_name, Vector run_parameters )
  throws InterpreterException {

  Function main;
  try {
      main = _program.findFunction(function_name);
  } catch (InterpreterException ie) {
      main = BuiltInRepository.getInstance().getBuiltInFunction(function_name);
  }

  //Function loads her own code (to allow builtin functions)
  main.run(this, run_parameters);

        Logger logger = Logger.getLogger("Runtime");
  logger.info("Begins execution of function " + function_name);

  Instruction i;
View Full Code Here


public class BuiltInRepositoryTest extends TestCase {

    public void testGetPrimitiveSimple()
  throws InterpreterException, ClassCastException {
  Function result = BuiltInRepository.getInstance().getBuiltInFunction("compare");
  assertEquals("Solicited compare primitive",
         "org.asturlinux.frade.currin.program.builtin.ComparePrimitive",
         result.getClass().getName());
        
    }
View Full Code Here

        
    }

    public void testGetPrimitiveWithVariants()
    throws InterpreterException {
  Function result = BuiltInRepository.getInstance().getBuiltInFunction("_43_");

  assertEquals("Solicited Add int primitive",
         "org.asturlinux.frade.currin.program.builtin.AddIntPrimitive",
         result.getClass().getName());

  Function result2 = BuiltInRepository.getInstance().getBuiltInFunction("_43__46_");
  assertEquals("Solicited Add float primitive",
         "org.asturlinux.frade.currin.program.builtin.AddFloatPrimitive",
         result2.getClass().getName());
    }
View Full Code Here

         result2.getClass().getName());
    }

    public void testGetInexistentPrimitive() {
  try {
      Function result = BuiltInRepository.getInstance().getBuiltInFunction("NOEXISTE");
      fail("Must throw InterpreterException, function not exist");
  } catch (InterpreterException ie) {
  }
 
    }
View Full Code Here

 
    }
   
    public void testGet64Variants()
  throws InterpreterException {
  Function ascii64 = BuiltInRepository.getInstance().getBuiltInFunction("_64_");
  assertEquals("Solicited _64_ primitive",
         "org.asturlinux.frade.currin.program.builtin.Ascii64Primitive",
         ascii64.getClass().getName());
 
  Function ascii64_2 = BuiltInRepository.getInstance().getBuiltInFunction("_64_2");
  assertEquals("Solicited _64_2 primitive",
         "org.asturlinux.frade.currin.program.builtin.Ascii64Primitive",
         ascii64_2.getClass().getName());

  Function ascii64_9 = BuiltInRepository.getInstance().getBuiltInFunction("_64_9");
  assertEquals("Solicited _64_9 primitive",
         "org.asturlinux.frade.currin.program.builtin.Ascii64Primitive",
         ascii64_9.getClass().getName());
    }
View Full Code Here

TOP

Related Classes of org.asturlinux.frade.currin.program.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.