Package org.boris.xlloop.script

Examples of org.boris.xlloop.script.LispFunctionHandler


        return new FunctionServer(port, new DebugFunctionHandler(createHandler()));
    }

    public static IFunctionHandler createHandler() {
        ReflectFunctionHandler rfh = new ReflectFunctionHandler();
        LispFunctionHandler lfh = new LispFunctionHandler();
        lfh.eval(new File("functions"), true); // evaluate any lisp files
        ScriptRepository srep = new ScriptRepository(new File("functions"), "Script.");
        rfh.addMethods("Math.", Math.class);
        rfh.addMethods("Math.", Maths.class);
        rfh.addMethods("Reflect.", Reflect.class);
        rfh.addMethods("CSV.", CSV.class);
        rfh.addMethods("Test.", Test.class);
        rfh.addMethods("Fin.", Finance1.class);
        rfh.addMethods("", AnnotationsTest.class);
        CompositeFunctionHandler cfh = new CompositeFunctionHandler();
        cfh.add(rfh);
        cfh.add(srep);
        cfh.add(lfh);
        FunctionInformationHandler firh = new FunctionInformationHandler();
        firh.add(rfh.getFunctions());
        firh.add(lfh.getInformation());
        firh.add(srep); // add script repository as a function provider
        cfh.add(firh);
        cfh.add(new MenuHandler(new TestMenu()));
        cfh.add(new CompTest1());
        return cfh;
View Full Code Here


    public static void main(String[] args) throws Exception {
        // Create a new function server on default port
        FunctionServer fs = new FunctionServer();

        // Create our lisp function handler
        LispFunctionHandler lfh = new LispFunctionHandler();

        // Evaluate any lisp files in this directory (and sub-dirs)
        lfh.eval(new File("functions"), true);

        // Expose a function called "Eval" for the lisp handler
        FunctionInformationHandler firh = new FunctionInformationHandler();
        firh.add(lfh.getInformation());

        // Create a composite function handler
        CompositeFunctionHandler cfh = new CompositeFunctionHandler();
        cfh.add(firh);
        cfh.add(lfh);
View Full Code Here

TOP

Related Classes of org.boris.xlloop.script.LispFunctionHandler

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.