Package org.openquark.cal.compiler

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


                    int argNum = inputPart.getInputNum();
                    argDesc = argNum < gemArguments.length ? gemArguments[argNum].getShortDescription() : null;
                   
                    // If there is no description of the gem argument, display the CALDoc instead.
                    if (argDesc == null) {
                        CALDocComment caldoc = faGem.getGemEntity().getFunctionalAgent().getCALDocComment();
                       
                        if (caldoc != null) {
                            if (argNum < caldoc.getNArgBlocks()) {
                                argCALDocDesc = NavHtmlFactory.getHtmlForCALDocTextBlockWithNoHyperlinks(caldoc.getNthArgBlock(argNum).getTextBlock(), true);
                            }
                        }
                    }
                }
               
                CollectorGem argTargetGem = GemGraph.getInputArgumentTarget(inputPart);
                if (argTargetGem != null) {
                    argTarget = argTargetGem.getUnqualifiedName();
                }
            }
        } else if (part instanceof Gem.PartOutput) {
           
            Gem gem = part.getGem();
            Gem.PartOutput outputPart = (Gem.PartOutput)part;
           
            if (!outputPart.isConnected() && gem instanceof FunctionalAgentGem) {
                FunctionalAgentGem faGem = (FunctionalAgentGem) gem;
                FunctionalAgentMetadata gemMetadata = faGem.getGemEntity().getMetadata(GemCutter.getLocaleFromPreferences());

                if (gemMetadata instanceof FunctionMetadata) {
                    argDesc = ((FunctionMetadata)gemMetadata).getReturnValueDescription();
                } else if (gemMetadata instanceof ClassMethodMetadata) {
                    argDesc = ((ClassMethodMetadata)gemMetadata).getReturnValueDescription();
                } else {
                    argDesc = null;
                }
               
                // If there is no description of the return value, display the CALDoc instead.
                if (argDesc == null) {
                    CALDocComment caldoc = faGem.getGemEntity().getFunctionalAgent().getCALDocComment();
                   
                    if (caldoc != null) {
                        CALDocComment.TextBlock returnBlock = caldoc.getReturnBlock();
                        if (returnBlock != null) {
                            argCALDocDesc = NavHtmlFactory.getHtmlForCALDocTextBlockWithNoHyperlinks(returnBlock, true);
                        }
                    }
                }
View Full Code Here


     * @param programModelManager the ProgramModelManager for the program containing the entity.
     * @param entity the ScopedEntity to be documented.
     * @return the HTML for the documentation.
     */
    public static String getHTMLForCALDocCommentOfScopedEntity(final ProgramModelManager programModelManager, final ScopedEntity entity) {
        final CALDocComment caldoc = entity.getCALDocComment();
       
        final HTMLDocumentationGeneratorConfiguration config = makeBareboneConfiguration();
        final HTMLDocumentationGenerator docGenerator = new HTMLDocumentationGenerator(programModelManager, null, config, true);
        docGenerator.startNewCurrentPageWithModule(entity.getName().getModuleName());
       
View Full Code Here

     * @param entity the ScopedEntity to be documented.
     * @param localFunctionOrPatternMatchVar the variable to be documented.
     * @return the HTML for the documentation.
     */
    private static String getHTMLForCALDocCommentOfLocalFunctionOrPatternMatchVar(final ProgramModelManager programModelManager, final Function entity, final IdentifierInfo.Local localFunctionOrPatternMatchVar) {
        final CALDocComment caldoc = entity.getCALDocComment();
       
        final HTMLDocumentationGeneratorConfiguration config = makeBareboneConfiguration();
        final HTMLDocumentationGenerator docGenerator = new HTMLDocumentationGenerator(programModelManager, null, config, true);
        docGenerator.startNewCurrentPageWithModule(entity.getName().getModuleName());
       
View Full Code Here

     * @param entity the ScopedEntity of the associated top-level/local function or class method.
     * @param parameter the parameter to be documented.
     * @return the HTML for the documentation.
     */
    public static String getHTMLForCALDocCommentOfFunctionParameter(final ProgramModelManager programModelManager, final FunctionalAgent entity, final IdentifierInfo.Local.Parameter parameter) {
        final CALDocComment caldoc = entity.getCALDocComment();
       
        final HTMLDocumentationGeneratorConfiguration config = makeBareboneConfiguration();
        final HTMLDocumentationGenerator docGenerator = new HTMLDocumentationGenerator(programModelManager, null, config, true);
        docGenerator.startNewCurrentPageWithModule(entity.getName().getModuleName());
       
View Full Code Here

        docGenerator.tooltip_generateDataConsFieldNameEntry(dataConsField);

        for (final DataConstructor dataCons : entities) {
            docGenerator.tooltip_generateHorizontalRule();

            final CALDocComment caldoc = dataCons.getCALDocComment();
            final String unqualifiedName = dataCons.getName().getUnqualifiedName();
           
            docGenerator.tooltip_generateDefListOpen();
            docGenerator.generateFunctionalAgentDoc(unqualifiedName, (FunctionalAgent)dataCons, "", (FunctionalAgentMetadata)MetadataManager.getEmptyMetadata(dataCons, LocaleUtilities.INVARIANT_LOCALE), caldoc, 0, false);
            docGenerator.tooltip_generateDefListClose();
View Full Code Here

     * Generates a plain text representation for a CALDoc comment of a ScopedEntity.
     * @param entity the entity with the CALDoc comment.
     * @return a plain text representation for the comment, or null if the entity does not have a CALDoc comment.
     */
    public static String getTextFromCALDocCommentOfScopedEntity(final ScopedEntity entity) {
        final CALDocComment caldoc = entity.getCALDocComment();
        if (caldoc == null) {
            return null;
        }
       
        if (entity instanceof FunctionalAgent) {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    void generateUsageDocInstanceIndexEntry(ScopedEntity documentedEntity, ClassInstance classInstance) {
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getClassInstanceFeatureName(classInstance), getLocale());
        CALDocComment docComment = classInstance.getCALDocComment();

        /// Generate the name of the class instance
        //
        currentPage
            .openTag(HTML.Tag.TR, classAttribute(getScopeStyleClass(minScopeForInstanceClassAndInstanceType(classInstance))))
View Full Code Here

     * @param moduleName the module to be described.
     */
    private void generateShortDescriptionForModule(final ModuleName moduleName) {
        ModuleTypeInfo moduleTypeInfo = programModelManager.getModuleTypeInfo(moduleName);
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getModuleFeatureName(moduleName), getLocale());
        CALDocComment docComment = moduleTypeInfo.getCALDocComment();

        generateShortDescription(metadata, docComment, new ReferenceGenerator(MODULES_SUBDIRECTORY));
    }
View Full Code Here

     */
    @Override
    void generateModuleDescription(ModuleTypeInfo moduleTypeInfo) {
        ModuleName moduleName = moduleTypeInfo.getModuleName();
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getModuleFeatureName(moduleName), getLocale());
        CALDocComment docComment = moduleTypeInfo.getCALDocComment();

        /// For a module, just generate its description and supplementary blocks
        //
        generateStandardDescription(metadata, docComment, inModulesSubdirectoryReferenceGenerator);
        generateStandardSupplementaryBlocks(metadata, docComment, inModulesSubdirectoryReferenceGenerator);
View Full Code Here

        // populated and ready to serve out disambiguated names.
        //
        addTypeConsNameToDisambiguationMap(typeConstructor.getName().getModuleName(), typeConstructor.getName().getUnqualifiedName());
       
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeConstructorFeatureName(typeConstructor.getName()), getLocale());
        CALDocComment docComment = typeConstructor.getCALDocComment();
       
        /// Generate the scope and name of the type constructor
        //
        currentPage
            .openTag(HTML.Tag.TR, classAttribute(getScopeStyleClass(typeConstructor.getScope())))
View Full Code Here

TOP

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

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.