Examples of TypeClass


Examples of org.openquark.cal.compiler.TypeClass

        typeClassClass.setJavaDoc(jdc);

        // Build up a list of TypeClass names and sort.
        List<String> typeClassNames = new ArrayList<String>();
        for (int i = 0, n = moduleTypeInfo.getNTypeClasses(); i < n; ++i) {
            TypeClass tc = moduleTypeInfo.getNthTypeClass(i);
            if (tc.getScope().isPublic() != publicEntities) {
                continue;
            }
            typeClassNames.add(tc.getName().getUnqualifiedName());
        }
        Collections.sort(typeClassNames);
       
        if (typeClassNames.size() == 0) {
            return;
        }
       
        bindingClass.addInnerClass(typeClassClass);

        // Generate a QualifiedName field for each type class.
        for (final String typeClassName : typeClassNames) {
            TypeClass tc = moduleTypeInfo.getTypeClass(typeClassName);
            // Add a field for the TypeClass name.
            // 'static final String typeClassName = "typeClassName";'
            // We need to check for conflict between the functionName
            // and java keywords.  It is valid to have a CAL
            // function called assert but not valid to have java code
            // 'static final QualifiedName assert = ...
            String fieldName = fixupVarName(typeClassName);
           
            // Since TypeClass names are capitalized it's possible to have a conflict
            // between the name of the field and the name of the top level class.
            if (fieldName.equals(this.bindingClassName)) {
                fieldName = fieldName + "_";
            }
           
            JavaFieldDeclaration jfd =
                makeQualifiedNameDeclaration(fieldName, typeClassName);

            // Add JavaDoc.  We use any CALDoc for the type class if available.
            JavaDocComment comment;
            CALDocComment cdc = tc.getCALDocComment();
            if (cdc != null) {
                comment = new JavaDocComment(calDocCommentToJavaComment(cdc, null, false));
            } else {
                comment = new JavaDocComment("/** Name binding for TypeClass: " + tc.getName().getQualifiedName() + ". */");
            }
            jfd.setJavaDoc(comment);
           
            typeClassClass.addFieldDeclaration(jfd);
        }
View Full Code Here

Examples of org.openquark.cal.compiler.TypeClass

                    caldocComments.put("data cons " + dataCons.getName().getQualifiedName(), dataCons.getCALDocComment());
                }
            }
           
            for (int i = 0, n = moduleInfo.getNTypeClasses(); i < n; i++) {
                final TypeClass typeClass = moduleInfo.getNthTypeClass(i);
                caldocComments.put("class " + typeClass.getName().getQualifiedName(), typeClass.getCALDocComment());

                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    final ClassMethod method = typeClass.getNthClassMethod(j);
                    caldocComments.put("class method " + method.getName().getQualifiedName(), method.getCALDocComment());
                }
            }
           
            for (int i = 0, n = moduleInfo.getNClassInstances(); i < n; i++) {
                final ClassInstance instance = moduleInfo.getNthClassInstance(i);
                final TypeClass typeClass = instance.getTypeClass();
               
                caldocComments.put("instance " + instance.getNameWithContext(), instance.getCALDocComment());

                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    final ClassMethod method = typeClass.getNthClassMethod(j);
                    caldocComments.put(
                        "instance method " + instance.getNameWithContext() + " " + method.getName().getQualifiedName(),
                        method.getCALDocComment());
                }
            }
View Full Code Here

Examples of org.openquark.cal.compiler.TypeClass

            emptyModuleStatusStr = GemCutter.getResourceString("RNRD_EmptyModuleStatusTypeCons");
           
        } else if ( entityType == EntityType.TypeClass ) {
           
            for (int i = 0, n = module.getTypeInfo().getNTypeClasses(); i < n; i++) {
                TypeClass typeClass = module.getTypeInfo().getNthTypeClass(i);
                if(typeClass.getName().getModuleName().equals(module.getName())) {
                    entityList.add(typeClass.getName().getUnqualifiedName());
                }
            }
            emptyModuleComboStr = GemCutter.getResourceString("RNRD_EmptyModuleComboTypeClass");
            emptyModuleStatusStr = GemCutter.getResourceString("RNRD_EmptyModuleStatusTypeClass");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.