Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.CALDocComment$Paragraph


     * {@inheritDoc}
     */
    @Override
    void generateDataConsDoc(DataConstructor dataConstructor, int index) {
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata)getMetadata(CALFeatureName.getDataConstructorFeatureName(dataConstructor.getName()), getLocale());
        CALDocComment docComment = dataConstructor.getCALDocComment();

        // We delegate the generation to the helper that handles all function agents
        generateFunctionalAgentDoc(dataConstructor, labelMaker.getLabel(dataConstructor), metadata, docComment, index, false);
    }
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    void generateFunctionDoc(Function function, int index) {
        FunctionalAgentMetadata metadata = (FunctionalAgentMetadata)getMetadata(CALFeatureName.getFunctionFeatureName(function.getName()), getLocale());
        CALDocComment docComment = function.getCALDocComment();
       
        // We delegate the generation to the helper that handles all function agents.
        // The helper expects to work in the context of a definition list, so we create one.
        currentPage.openTag(HTML.Tag.DL, classAttribute(getScopeStyleClass(function.getScope())));
        generateFunctionalAgentDoc(function, labelMaker.getLabel(function), metadata, docComment, index, true);
View Full Code Here

     * {@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

TOP

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

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.