Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.CALDocComment


     * {@inheritDoc}
     */
    @Override
    void generateTypeClassDocHeader(TypeClass typeClass, int index) {
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeClassFeatureName(typeClass.getName()), getLocale());
        CALDocComment docComment = typeClass.getCALDocComment();

        /// Generate the name of the type class as the header, followed by a link to the usages if necessary
        //
        String unqualifiedName = typeClass.getName().getUnqualifiedName();
       
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    void generateClassMethodDoc(ClassMethod classMethod, int index) {
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata)getMetadata(CALFeatureName.getClassMethodFeatureName(classMethod.getName()), getLocale());
        CALDocComment docComment = classMethod.getCALDocComment();
       
        // We delegate the generation to the helper that handles all function agents
        generateFunctionalAgentDoc(classMethod, labelMaker.getLabel(classMethod), metadata, docComment, index, true);
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    void generateClassInstanceDocHeader(ClassInstance classInstance, int index) {
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getClassInstanceFeatureName(classInstance), getLocale());
        CALDocComment docComment = classInstance.getCALDocComment();

        /// Generate the name of the class instance as the header, followed by a link to the usages if necessary
        //
        currentPage
            .openTag(HTML.Tag.DL, classAttribute(getScopeStyleClass(minScopeForInstanceClassAndInstanceType(classInstance))))
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    void generateInstanceMethodDoc(ClassInstance classInstance, String methodName, ClassMethod classMethod, int index) {
        InstanceMethodMetadata metadata = (InstanceMethodMetadata)getMetadata(CALFeatureName.getInstanceMethodFeatureName(classInstance, methodName), getLocale());
        CALDocComment docComment = classInstance.getMethodCALDocComment(methodName);
       
        ////
        /// With an instance method, we attempt to figure out which CALDoc comment to refer to for documentation.
        /// Often it is the case that the instance method, or even the class instance, would be undocumented. In such situations,
        /// it would be beneficial to present the documentation on the class method, since after all it is a class method that
        /// ultimately ends up being used in expressions, not the instance method backing it.
        //
       
        Scope scope = null;
        String unqualifiedName = methodName;
        FunctionalAgent entityWithArgumentNames = classMethod;
        CALDocComment classMethodCALDocComment = classMethod.getCALDocComment();
        TypeExpr typeExpr = classInstance.getInstanceMethodType(methodName);
        ArgumentMetadata[] argMetadataArray = metadata.getArguments();
        String label = labelMaker.getLabel(classInstance, methodName);
       
        /// If there are no @arg blocks for the instance method's CALDoc comment, or there is no CALDoc comment for the method at
        /// all, use the CALDoc comment for the class method
        //
        final CALDocComment docCommentForArguments;
        if (docComment != null && docComment.getNArgBlocks() > 0) {
            docCommentForArguments = docComment;
        } else {
            docCommentForArguments = classMethodCALDocComment;
        }
       
        /// If there is no @return block for the instance method's CALDoc comment, or there is no CALDoc comment for the method at
        /// all, use the CALDoc comment for the class method - but only if the class method's arity matches the instance method's arity.
        //
        final CALDocComment docCommentForReturnValue;
        if (docComment != null && docComment.getReturnBlock() != null) {
            docCommentForReturnValue = docComment;
           
        } else if (classMethod.getTypeExpr().getArity() == typeExpr.getArity()) {
           
View Full Code Here

    void beginTypeConsUsageDoc(TypeConstructor typeConstructor) {
        ModuleName moduleName = typeConstructor.getName().getModuleName();
        String typeName = typeConstructor.getName().getUnqualifiedName();
       
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeConstructorFeatureName(typeConstructor.getName()), getLocale());
        CALDocComment docComment = typeConstructor.getCALDocComment();
       
        String label = labelMaker.getLabel(typeConstructor);
       
        // We delegate the generation of everything before the declaration to a helper method.
        generateUsageDocStartBeforeDeclaration(typeConstructor.getName(), label);
View Full Code Here

    @Override
    void beginTypeClassUsageDoc(TypeClass typeClass) {
        ModuleName moduleName = typeClass.getName().getModuleName();
       
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeClassFeatureName(typeClass.getName()), getLocale());
        CALDocComment docComment = typeClass.getCALDocComment();

        String label = labelMaker.getLabel(typeClass);
       
        // We delegate the generation of everything before the declaration to a helper method.
        generateUsageDocStartBeforeDeclaration(typeClass.getName(), label);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    void generateUsageDocArgTypeIndexEntry(ScopedEntity documentedEntity, FunctionalAgent entity) {
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata)getMetadata(entity, getLocale());
        CALDocComment docComment = entity.getCALDocComment();
       
        // We delegate to a helper method to generate a usage index entry
        generateUsageIndexEntry(entity, labelMaker.getLabel(entity), metadata, docComment, StyleClassConstants.OVERVIEW_TABLE_OUTER_DESCRIPTION);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    void generateUsageDocReturnTypeIndexEntry(ScopedEntity documentedEntity, FunctionalAgent entity) {
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata)getMetadata(entity, getLocale());
        CALDocComment docComment = entity.getCALDocComment();
       
        // We delegate to a helper method to generate a usage index entry
        generateUsageIndexEntry(entity, labelMaker.getLabel(entity), metadata, docComment, StyleClassConstants.OVERVIEW_TABLE_OUTER_DESCRIPTION);
    }
View Full Code Here

        //       as NOT being user saved names. This works fine here as a new input name object will be
        //       created with an initial name of whatever we supply.
        FunctionalAgentMetadata metadata = gemEntity.getMetadata(GemCutter.getLocaleFromPreferences());
        ArgumentMetadata[] argMetadata = metadata.getArguments();
        int numNamedArgs = gemEntity.getNNamedArguments();
        CALDocComment caldoc = gemEntity.getFunctionalAgent().getCALDocComment();
       
        for (int i = 0, numInputs = getNInputs(); i < numInputs; i++) {
            PartInput inputPart = getInputPart(i);
           
            String nameFromEntity = i < numNamedArgs ? gemEntity.getNamedArgument(i) : null;
            String displayName = i < argMetadata.length ? argMetadata[i].getDisplayName() : null;
            FieldName caldocName = (caldoc != null && i < caldoc.getNArgBlocks()) ? caldoc.getNthArgBlock(i).getArgName() : null;
           
            String originalName;
            if (displayName != null) {
                originalName = displayName;
            } else if (caldocName != null && caldocName instanceof FieldName.Textual) {
View Full Code Here

               
                ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                if (typeInfo == null) {
                    iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                } else {
                    CALDocComment comment = typeInfo.getCALDocComment();
                    if (comment != null) {
                        iceLogger.log(Level.INFO, "CALDoc for the " + moduleName + " module:\n" + CALDocToTextUtilities.getTextFromCALDocComment(comment));
                    } else {
                        iceLogger.log(Level.INFO, "There is no CALDoc for the " + moduleName + " module.");
                    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.CALDocComment

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.