Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.QualifiedName


            if (unqualifiedClassName.equals(unqualifiedBuilderClassName)) {
                return builder.getOuterClassRep();
            }

            for (final MachineFunction mf : mfs.getTopLevelCALFunctions()) {
                QualifiedName calFunctionName = mf.getQualifiedName();
                if (unqualifiedClassName.equals(CALToJavaNames.createStrictInnerClassNameFromSC(calFunctionName, module))) {
                    return builder.getStrictAppClass(mf);
                }
                if (unqualifiedClassName.equals(CALToJavaNames.createLazyInnerClassNameFromSC(calFunctionName, module))) {
                    return builder.getLazyAppClass(mf);
View Full Code Here


            okButton.setEnabled(true);
            return;
        }

        // check if the selected data type is already imported under a different name
        QualifiedName existingName;
        try {
            existingName = getExistingTypeName(memberList.getCurrentClass());
        } catch (UnableToResolveForeignEntityException e) {
           
            String message = GeneratorMessages.getString("JGF_UnableToResolveForeignEntity", e.getCompilerMessage().getMessage());
            statusLabel.setText(message);
            statusLabel.setToolTipText(message);
            statusLabel.setIcon(ERROR_ICON);
            okButton.setEnabled(false);
            return;
        }
       
        if (addingDataType && existingName != null) {
           
            String message = GeneratorMessages.getString("JGF_DataTypeAlreadyImported", existingName.getQualifiedName());
            statusLabel.setText(message);
            statusLabel.setToolTipText(message);
            statusLabel.setIcon(WARNING_ICON);
            okButton.setEnabled(true);
            return;
View Full Code Here

        }

        // Add the required data types.
        for (final Class<?> dataClass : newDataTypes.keySet()) {
       
            QualifiedName dataName = newDataTypes.get(dataClass);
            String dataSource = getDataDeclaration(dataClass, dataName.getUnqualifiedName());
       
            sourceDefinitions.put(dataName.getUnqualifiedName(), dataSource);
        }

        // Finally add the method/field/constructor definition.
        if (javaImport != null) {
            sourceDefinitions.put(gemName, gemSource);
View Full Code Here

            }
        }
       
        // Looks like we have to make our own data declaration for this.
        // Pick a sensible name and add it to the map before returning it.
        QualifiedName typeName = getUniqueTypeName(javaType);
        newDataTypes.put(javaType, typeName);

        return typeName;
    }
View Full Code Here

     * @return whether argument was transformed to function
     */
    boolean changeArgumentToDefaultFunction(String argumentName) {

        // Check if this was already mapped
        QualifiedName qualifiedName = userQualifiedIdentifiers.getQualifiedName(argumentName, SourceIdentifier.Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD);
        if (qualifiedName != null) {
            // Yes, use previous qualification
            changeArgumentToQualification(argumentName, qualifiedName.getModuleName());
            return true;
        }

        // Put variable in first candidate module
        List<ModuleName> candidateModules = CodeAnalyser.getModulesContainingIdentifier(
View Full Code Here

     * @param oldName
     * @param newName
     * @param category
     */
    void updateQualificationsForEntityRename(QualifiedName oldName, QualifiedName newName, SourceIdentifier.Category category) {
        QualifiedName storedQualification = userQualifiedIdentifiers.getQualifiedName(oldName.getUnqualifiedName(), category);
        if (oldName.equals(storedQualification)) {
            userQualifiedIdentifiers.removeQualification(oldName.getUnqualifiedName(), category);
            userQualifiedIdentifiers.putQualification(newName.getUnqualifiedName(), newName.getModuleName(), category);
        }
    }
View Full Code Here

           // Get the set of unqualifiedNames associated with this category, and look up their respective qualifications.
           // If the module name associated with them is the old module name, replace the qualification with a new one
           // referring to the new module name.
           Set<String> unqualifiedNames = userQualifiedIdentifiers.getUnqualifiedNames(category);
           for (final String unqualifiedName : unqualifiedNames) {
               QualifiedName qualifiedName = userQualifiedIdentifiers.getQualifiedName(unqualifiedName, category);
               if (qualifiedName.getModuleName().equals(oldModuleName)) {
                   userQualifiedIdentifiers.removeQualification(unqualifiedName, category);
                   userQualifiedIdentifiers.putQualification(unqualifiedName, newModuleName, category);
               }
           }
       }
View Full Code Here

                return;
            } else {
                // Qualified completion, and type of the identifier is known
                // So do a smart insert and update the qualification map
                SourceIdentifier.Category identifierCategory = identifier.getCategory();
                QualifiedName completedName = QualifiedName.makeFromCompoundName(insertion);
                EditorTextTransferHandler.insertEditorQualification(gemCodePanel.getCALEditorPane(), completedName, identifierCategory, userQualifiedIdentifiers, true);
            }

        } catch (BadLocationException e) {
            throw new IllegalStateException("bad location on auto-complete insert");
View Full Code Here

                throw new IllegalArgumentException("For the from name to be preset, the entity type must be specified");
            } else if (entityType == EntityType.Module) {
                this.moduleName = ModuleName.make(fromName);
                this.fromName = fromName;
            } else {
                QualifiedName qualifiedFromName = QualifiedName.makeFromCompoundName(fromName);
                this.moduleName = qualifiedFromName.getModuleName();
                this.fromName = qualifiedFromName.getUnqualifiedName();
            }
        }

        this.workspaceManager = workspaceManager;
        this.perspective = perspective;
View Full Code Here

        List<ModuleSourceDefinition> dependentModuleSources = new ArrayList<ModuleSourceDefinition>();
        for (final ModuleName moduleName2 : dependentModules) {
            dependentModuleSources.add(getWorkspace().getSourceDefinition(moduleName2));
        }

        QualifiedName qualifiedFromName;
        QualifiedName qualifiedToName;
        if (entityType == EntityType.Module) {
            qualifiedFromName = QualifiedName.make(ModuleName.make(fromName), Refactorer.Rename.UNQUALIFIED_NAME_FOR_MODULE_RENAMING);
            qualifiedToName = QualifiedName.make(ModuleName.make(toName), Refactorer.Rename.UNQUALIFIED_NAME_FOR_MODULE_RENAMING);
        } else {
            qualifiedFromName = QualifiedName.make(moduleName, fromName);
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.