Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.Function


        private QualifiedName findMakeDCName (DataConstructor dc) {
            TypeExpr dcTypeExpr = dc.getTypeExpr();
            String probableFunctionName = "make" + dc.getName().getUnqualifiedName();

            for (int i = 0; i < module.getNFunctions(); ++i) {
                Function function = module.getNthFunction(i);
                if (function.getName().getUnqualifiedName().equals(probableFunctionName)) {
                    if (dcTypeExpr.sameType(function.getTypeExpr())) {
                        return QualifiedName.make(module.getModuleName(), probableFunctionName);
                    }
                }
            }
           
View Full Code Here


             * Functions
             */
            int nModuleFunctions = moduleTypeInfo.getNFunctions();
            totalTopLevelFunctions += nModuleFunctions;
            for (int i = 0; i < nModuleFunctions; i++) {
                Function nthFunction = moduleTypeInfo.getNthFunction(i);
                int nFunctionLocalFunctions = nthFunction.getNLocalFunctions();
                totalLocalFunctions += nFunctionLocalFunctions;

                if (nthFunction.getForeignFunctionInfo() != null) {
                    totalForeignFunctions++;
                }
                if (nthFunction.isPrimitive()) {
                    totalPrimitiveFunctions++;
                }
               
                // See if any of the local functions are foreign..
                // (Is this possible?)
View Full Code Here

        HashSet<String> labels = new HashSet<String>();
       
        // Gather all the labels, which will be used as a checklist later to see whether all the labels have
        // corresponding entries generated.
        for (int i = 0, n = moduleInfo.getNFunctions(); i < n; i++) {
            Function function = moduleInfo.getNthFunction(i);
           
            if (parent.isDocForFunctionOrClassMethodGenerated(function.getName().getModuleName(), function.getName().getUnqualifiedName())) {
                labels.add(labelMaker.getLabel(function));
            }
        }
       
        for (int i = 0, n = moduleInfo.getNTypeConstructors(); i < n; i++) {
View Full Code Here

        functionsClass.setJavaDoc(jdc);
       
        // Build up and sort the list of function names.
        Map<String, FunctionalAgent> nameToFuncInfo = new TreeMap<String, FunctionalAgent>();
        for (int i = 0, n = moduleTypeInfo.getNFunctions(); i < n; ++i) {
            Function fe = moduleTypeInfo.getNthFunction(i);
            if (fe.getScope().isPublic() != publicEntities) {
                continue;
            }
            nameToFuncInfo.put(fe.getName().getUnqualifiedName(), fe);
        }
       
        for (int i = 0, n = moduleTypeInfo.getNTypeClasses(); i < n; ++i) {
            TypeClass tc = moduleTypeInfo.getNthTypeClass(i);
View Full Code Here

        }
       
        int nFunctions = moduleTypeInfo.getNFunctions();
        List<Function> functionsList = new ArrayList<Function>(nFunctions);
        for (int i = 0; i < nFunctions; i++) {
            Function function = moduleTypeInfo.getNthFunction(i);
            if (filter.shouldGenerateScopedEntity(function)) {
                functionsList.add(function);
            }
        }
       
View Full Code Here

        //
        int nFunctions = functions.length;
        beginFunctionsDocSection(nFunctions, calcMaxScopeOfScopedEntities(functions));
        for (int i = 0; i < nFunctions; i++) {
           
            Function function = functions[i];
            QualifiedName name = function.getName();
            perModuleFunctionalAgentIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(function), function.getScope(), IndexEntry.Kind.FUNCTIONAL_AGENT));
           
            processEnvEntityForArgAndReturnTypeIndices(function);
           
            generateFunctionDoc(function, i);
        }
View Full Code Here

            final Map<String, CALDocComment> caldocComments = new LinkedHashMap<String, CALDocComment>();
           
            caldocComments.put("module " + moduleName, moduleInfo.getCALDocComment());
           
            for (int i = 0, n = moduleInfo.getNFunctions(); i < n; i++) {
                final Function function = moduleInfo.getNthFunction(i);
                caldocComments.put("function " + function.getName().getQualifiedName(), function.getCALDocComment());
            }
           
            for (int i = 0, n = moduleInfo.getNTypeConstructors(); i < n; i++) {
                final TypeConstructor typeCons = moduleInfo.getNthTypeConstructor(i);
                caldocComments.put("type cons " + typeCons.getName().getQualifiedName(), typeCons.getCALDocComment());
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.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.