Package org.openquark.cal.internal.machine.lecc.LECCModule

Examples of org.openquark.cal.internal.machine.lecc.LECCModule.FunctionGroupInfo


            // its function group.  If there is only one function in the function group we
            // don't need to disambiguate.
            ModuleName containingModuleName = scName.getModuleName();
            LECCModule containingModule = (LECCModule)module.findModule(containingModuleName);
            if (containingModule != null) {
                FunctionGroupInfo fgi = containingModule.getFunctionGroupInfo(scName);
                if(fgi.getNFunctions() == 1) {
                    needToDisambiguate = false;
                }
            }
        }
       
View Full Code Here


     * @param module
     * @return the Java name for the let variable definition function.
     */
    static String makeLetVarDefFunctionJavaName (QualifiedName qualifiedDefFunctionName, LECCModule module) {
        String defFunctionName = qualifiedDefFunctionName.getUnqualifiedName();
        FunctionGroupInfo fgi = module.getFunctionGroupInfo(qualifiedDefFunctionName);
       
        if (fgi != null && fgi.getNFunctions() == 1) {
            int firstDollarIndex = defFunctionName.indexOf('$');
            if (firstDollarIndex > 0) {
                int secondDollarIndex = defFunctionName.indexOf('$', firstDollarIndex + 1);
                if (secondDollarIndex > firstDollarIndex) {
                    defFunctionName = defFunctionName.substring(firstDollarIndex + 1);
View Full Code Here

            // Get the static 'make' method.
            Method m = c.getMethod("make", new Class[]{});
            return (RTValue)m.invoke(null, new Object[]{});
        }

        FunctionGroupInfo fgi = module.getFunctionGroupInfo(mf);
        if (fgi == null) {
            throw new NullPointerException ("Invalid FunctionGroupInfo in CALClassLoader.getStartPointInstance() for " + mf.getQualifiedName() + ".");
        }

        if (mf.getArity() == 0) {
            // Get the static 'make' method.
            if (fgi.getNCAFs() + fgi.getNZeroArityFunctions() <= 1) {
                Method m = c.getMethod("make", new Class[]{RTExecutionContext.class});
                return (RTValue)m.invoke(
                        null,
                        new Object[]{executionContext});
            } else {
                Method m = c.getMethod("make", new Class[]{int.class, RTExecutionContext.class});
                int functionIndex = fgi.getFunctionIndex(mf.getName());
                return (RTValue)m.invoke(
                        null,
                        new Object[]{Integer.valueOf(functionIndex), executionContext});
            }
        }
View Full Code Here

                JavaExpression.EMPTY_JAVA_EXPRESSION_ARRAY,
                JavaTypeName.NO_ARGS,
                javaTypeName);
        }
   
        final FunctionGroupInfo fgi = module.getFunctionGroupInfo(machineFunction);
        if (fgi == null) {
            throw new NullPointerException ("Invalid FunctionGroupInfo in getStartPointInstanceJavaExpression() for " + machineFunction.getQualifiedName() + ".");
        }
   
        if (machineFunction.getArity() == 0) {
            // Get the static 'make' method.
            if (fgi.getNCAFs() + fgi.getNZeroArityFunctions() <= 1) {
                return new JavaExpression.MethodInvocation.Static(
                    javaTypeName,
                    "make",
                    executionContextExpr,
                    JavaTypeNames.RTEXECUTION_CONTEXT,
                    JavaTypeNames.RTFUNCTION);
               
            } else {
                final int functionIndex = fgi.getFunctionIndex(machineFunction.getName());
                return new JavaExpression.MethodInvocation.Static(
                    javaTypeName,
                    "make",
                    new JavaExpression[] {JavaExpression.LiteralWrapper.make(new Integer(functionIndex)), executionContextExpr},
                    new JavaTypeName[] {JavaTypeName.INT, JavaTypeNames.RTEXECUTION_CONTEXT},
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.machine.lecc.LECCModule.FunctionGroupInfo

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.