Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.Scope


           
            String displayName = entry.getDisplayName();
            String label = entry.getLabel();
           
            int scopeNum;
            Scope scope = entry.getScope();
            if (scope.isPrivate()) {
                scopeNum = 0;
            } else if (scope.isProtected()) {
                scopeNum = 1;
            } else if (scope.isPublic()) {
                scopeNum = 2;
            } else {
                throw new IllegalStateException("Invalid scope: " + scope);
            }
           
View Full Code Here


     */
    /*
     * @implementation this method is exposed via package scope to allow reuse by the CALDocToTooltipHTMLUtilities
     */
    void generateFunctionalAgentDoc(String unqualifiedName, FunctionalAgent entity, String label, FunctionalAgentMetadata metadata, CALDocComment docComment, int indexInList, boolean shouldDisplayReturnBlock) {
        Scope scope = entity.getScope();
        TypeExpr typeExpr = entity.getTypeExpr();
        ArgumentMetadata[] argMetadataArray = metadata.getArguments();
       
        generateFunctionalAgentOrInstanceMethodDocHeading(scope, unqualifiedName, entity, typeExpr, label, argMetadataArray, docComment, indexInList, false);
       
View Full Code Here

     */
    private void generateForeignTypeInfo(TypeConstructor typeConstructor) {
        ForeignTypeInfo foreignTypeInfo = typeConstructor.getForeignTypeInfo();
        if (foreignTypeInfo != null) {
           
            Scope implScope = foreignTypeInfo.getImplementationVisibility();
            if (filter.shouldAcceptBasedOnScopeOnly(implScope)) {
               
                try {
                    String className = JavaTypeName.getFullJavaSourceName(foreignTypeInfo.getForeignType());
                   
                    currentPage
                        .openTag(HTML.Tag.DL, classAttribute(getScopeStyleClass(implScope)))
                        .addTaggedText(HTML.Tag.DT, classAttribute(StyleClassConstants.ATTRIBUTE_HEADER), LocalizableUserVisibleString.IMPLEMENTATION_VISIBILITY_COLON.toResourceString())
                        .addTaggedText(HTML.Tag.DD, implScope.toString())
                        .addTaggedText(HTML.Tag.DT, classAttribute(StyleClassConstants.ATTRIBUTE_HEADER), LocalizableUserVisibleString.FOREIGN_TYPE_COLON.toResourceString())
                        .addTaggedText(HTML.Tag.DD, className)
                        .closeTag(HTML.Tag.DL);
                   
                } catch (UnableToResolveForeignEntityException e) {
View Full Code Here

        /// 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();
View Full Code Here

        // For now, use the fully qualified name.  This will be ugly though.
        String typeConsName = generationInfo.getTypeConsName(foreignClass);
       
        // Determine the generated scopes.
        GenerationScope generationScope = generationInfo.getGenerationScope();
        Scope typeScope = generationScope == GenerationScope.ALL_PRIVATE ? Scope.PRIVATE : Scope.PUBLIC;
        Scope implementationScope = generationScope == GenerationScope.ALL_PUBLIC ? Scope.PUBLIC : Scope.PRIVATE;
       
        /*
         * Possible type classes:
         *
         * Always ok:
View Full Code Here

       
        // Create a valid function name.
        final String functionName = generationInfo.getNewFunctionName(javaMember, javaClass);
       
        // Determine scope.
        final Scope scope = (generationInfo.getGenerationScope() == GenerationScope.ALL_PRIVATE) ? Scope.PRIVATE : Scope.PUBLIC;
       
        // Create the external name.
        final String externalName;
        {
            final StringBuilder externalNameSB = new StringBuilder();
View Full Code Here

     * @param classInstance the class instance to check.
     * @return the minimum scope of the class instance's type class and instance type.
     */
    Scope minScopeForInstanceClassAndInstanceType(ClassInstance classInstance) {
       
        Scope cachedScope = classInstanceMinScopeCache.get(classInstance);
        if (cachedScope != null) {
            return cachedScope;
        }
       
        Scope instanceClassScope = classInstance.getTypeClass().getScope();
       
        SourceModel.TypeSignature instanceType = classInstance.getType().toSourceModel();
        MinScopeCalculatorForTypeConsInTypeSig calculator = new MinScopeCalculatorForTypeConsInTypeSig();
        instanceType.accept(calculator, null);
       
        Scope instanceTypeMinScope = calculator.getMinScope();
       
        Scope instanceMinScope = minScope(instanceClassScope, instanceTypeMinScope);
       
        classInstanceMinScopeCache.put(classInstance, instanceMinScope);
       
        return instanceMinScope;
    }
View Full Code Here

     * Calculates the maximum scope of all the specified entities.
     * @param entities the scoped entities.
     * @return the maximum scope of all the specified entities.
     */
    static Scope calcMaxScopeOfScopedEntities(ScopedEntity[] entities) {
        Scope max = Scope.PRIVATE;
       
        for (final ScopedEntity scopedEntity : entities) {
            max = maxScope(max, scopedEntity.getScope());
           
            // we're done if the maximum is the public scope, since there's no scope more visible than public
View Full Code Here

     * Calculates the maximum scope of all the specified entities.
     * @param entities the scoped entities.
     * @return the maximum scope of all the specified entities.
     */
    static Scope calcMaxScopeOfScopedEntities(Collection<? extends ScopedEntity> entities) {
        Scope max = Scope.PRIVATE;
       
        for (final ScopedEntity scopedEntity : entities) {
            max = maxScope(max, scopedEntity.getScope());
           
            // we're done if the maximum is the public scope, since there's no scope more visible than public
View Full Code Here

     * Calculates the maximum scope of all the specified instances.
     * @param classInstances the class instances.
     * @return the maximum scope of all the specified instances.
     */
    Scope calcMaxScopeOfClassInstances(ClassInstance[] classInstances) {
        Scope max = Scope.PRIVATE;
       
        for (final ClassInstance classInstance : classInstances) {
            max = maxScope(max, minScopeForInstanceClassAndInstanceType(classInstance));
           
            // we're done if the maximum is the public scope, since there's no scope more visible than public
View Full Code Here

TOP

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

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.