Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.QualifiedName


     * @see ValueNode#transmuteValueNode(ValueNodeBuilderHelper, ValueNodeTransformer, TypeExpr)
     */
    @Override
    public ValueNode transmuteValueNode(ValueNodeBuilderHelper valueNodeBuilderHelper, ValueNodeTransformer valueNodeTransformer, TypeExpr newTypeExpr) {

        QualifiedName typeConsName = getTypeExpr().rootTypeConsApp().getName();
        TypeConsApp newTypeConsApp = newTypeExpr.rootTypeConsApp();

        // If we don't need to change type constructors, then we just basically copy the value.
        if (newTypeConsApp != null && typeConsName.equals(newTypeConsApp.getName())) {

            List<ValueNode> componentList = getChildrenList();
            List<ValueNode> newComponentList = new ArrayList<ValueNode>(componentList.size());
   
            // Go thru the component ValueNodes and transmute them.
View Full Code Here


        if (dataConstructor == null) {
            return LiteralValueNode.getDefaultValue(typeExpr);
        }
       
        // must be a Boolean data constructor
        QualifiedName dcName = dataConstructor.getName();
        if (dcName.equals(CAL_Prelude.DataConstructors.True)) {
            return Boolean.TRUE;
        } else if (dcName.equals(CAL_Prelude.DataConstructors.False)) {
            return Boolean.FALSE;
        }
       
        throw new IllegalArgumentException("Can't get literal value for given args.");
    }
View Full Code Here

            List<SourceModel.Name.TypeClass> constrainingClassNames = getConstrainingClassNames(typeVarName);
           
            for (int i = 0, n = constrainingClassNames.size(); i < n; i++) {
                SourceModel.Name.TypeClass constrainingClassName = constrainingClassNames.get(i);
                // NOTE: We require that the type class name be fully qualified with a non-null module name.
                QualifiedName qualifiedClassName = QualifiedName.make(SourceModel.Name.Module.toModuleName(constrainingClassName.getModuleName()), constrainingClassName.getUnqualifiedName());
               
                getAppropriateIndex(classUsageIndices, qualifiedClassName).add(entity);
            }
   
            return null;
View Full Code Here

     */
    private static final class ClassInstanceComparator implements Comparator<ClassInstance> {
        /** {@inheritDoc} */
        public int compare(ClassInstance a, ClassInstance b) {
           
            QualifiedName aTypeClassName = a.getTypeClass().getName();
            QualifiedName bTypeClassName = b.getTypeClass().getName();
           
            /// first compare the type classes' names in a case-insensitive manner
            //
            int typeClassUnqualifiedNameComparison = aTypeClassName.getUnqualifiedName().compareTo(bTypeClassName.getUnqualifiedName());
           
            if (typeClassUnqualifiedNameComparison != 0) {
                return typeClassUnqualifiedNameComparison;
            } else {
                /// then comparse the type classes' names in a case-sensitive manner
                //
                int typeClassModuleNameComparison = aTypeClassName.getModuleName().compareTo(bTypeClassName.getModuleName());
               
                if (typeClassModuleNameComparison != 0) {
                    return typeClassModuleNameComparison;
                } else {
                    /// the type classes' are in fact the same, so compare the instance type:
View Full Code Here

        int nTypeConstructors = typeConstructors.length;
        beginTypeConsDocSection(nTypeConstructors, calcMaxScopeOfScopedEntities(typeConstructors));
        for (int i = 0; i < nTypeConstructors; i++) {
           
            TypeConstructor typeConstructor = typeConstructors[i];
            QualifiedName name = typeConstructor.getName();
            perModuleTypeIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(typeConstructor), typeConstructor.getScope(), IndexEntry.Kind.TYPE));
           
            generateTypeConsDoc(typeConstructor, i);
        }
        endTypeConsDocSection(nTypeConstructors);
    }
View Full Code Here

        int nFunctions = functions.length;
        beginFunctionsDocSection(nFunctions, calcMaxScopeOfScopedEntities(functions));
        for (int i = 0; i < nFunctions; i++) {
           
            Function function = functions[i];
            QualifiedName name = function.getName();
            perModuleFunctionalAgentIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(function), function.getScope(), IndexEntry.Kind.FUNCTIONAL_AGENT));
           
            processEnvEntityForArgAndReturnTypeIndices(function);
           
            generateFunctionDoc(function, i);
        }
View Full Code Here

        int nTypeClasses = typeClasses.length;
        beginTypeClassesDocSection(nTypeClasses, calcMaxScopeOfScopedEntities(typeClasses));
        for (int i = 0; i < nTypeClasses; i++) {
           
            TypeClass typeClass = typeClasses[i];
            QualifiedName name = typeClass.getName();
            perModuleClassIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(typeClass), typeClass.getScope(), IndexEntry.Kind.TYPE_CLASS));
           
            generateTypeClassDoc(typeClass, i);
        }
        endTypeClassesDocSection(nTypeClasses);
    }
View Full Code Here

        int nDataConstructorsToGenerate = dataConstructorsList.size();
        beginDataConsDocList(nDataConstructorsToGenerate, calcMaxScopeOfScopedEntities(dataConstructorsList));
        for (int i = 0; i < nDataConstructorsToGenerate; i++) {
           
            DataConstructor dataConstructor = dataConstructorsList.get(i);
            QualifiedName name = dataConstructor.getName();
            perModuleFunctionalAgentIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(dataConstructor), dataConstructor.getScope(), IndexEntry.Kind.FUNCTIONAL_AGENT));
           
            processEnvEntityForArgAndReturnTypeIndices(dataConstructor);
           
            generateDataConsDoc(dataConstructor, i);
        }
View Full Code Here

        int nClassMethodsToGenerate = classMethodsList.size();
        beginClassMethodDocList(nClassMethodsToGenerate);
        for (int i = 0; i < nClassMethodsToGenerate; i++) {
           
            ClassMethod classMethod = classMethodsList.get(i);
            QualifiedName classMethodName = classMethod.getName();
            perModuleFunctionalAgentIndex.add(new IndexEntry(classMethodName.getUnqualifiedName(), labelMaker.getLabel(classMethod), classMethod.getScope(), IndexEntry.Kind.FUNCTIONAL_AGENT));
           
            processEnvEntityForArgAndReturnTypeIndices(classMethod);
           
            generateClassMethodDoc(classMethod, i);
        }
View Full Code Here

     */
    boolean areDocForInstanceClassAndInstanceTypeGenerated(ClassInstance classInstance) {
        ////
        /// First check the type class of the instance.
        //
        QualifiedName typeClassName = classInstance.getTypeClass().getName();
        if (!isDocForTypeClassGenerated(typeClassName.getModuleName(), typeClassName.getUnqualifiedName())) {
            return false;
        }
       
        ////
        /// Documentation is generated for the type class, so check the instance type.
View Full Code Here

TOP

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

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.