Examples of ImportPath


Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.ImportPath

    @Override
    public void visit(Tree.PackageLiteral that) {
        super.visit(that);
        Package p;
        if (that.getImportPath()==null) {
            that.setImportPath(new ImportPath(null));
            p = unit.getPackage();
        }
        else {
            p = TypeVisitor.getPackage(that.getImportPath());
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.ImportPath

    @Override
    public void visit(Tree.ModuleLiteral that) {
        super.visit(that);
        Module m;
        if (that.getImportPath()==null) {
            that.setImportPath(new ImportPath(null));
            m = unit.getPackage().getModule();
        }
        else {
            m = TypeVisitor.getModule(that.getImportPath());
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.ImportPath

            compilationUnit.visit(new Validator());
            compilationUnit.visit(new Visitor() {
                @Override
                public void visit(ModuleDescriptor that) {
                    super.visit(that);
                    ImportPath importPath = that.getImportPath();
                    if (importPath != null) {
                        String moduleName = Util.formatPath(importPath.getIdentifiers());
                        ModuleManager moduleManager = moduleManagerRef.get();
                        if (moduleManager != null) {
                            for (Module otherModule : moduleManager.getCompiledModules()) {
                                String otherModuleName = otherModule.getNameAsString();
                                if (moduleName.startsWith(otherModuleName + ".") ||
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.ImportPath

    @Override
    public void visit(Tree.ModuleDescriptor that) {
        super.visit(that);
        if (phase==Phase.SRC_MODULE) {
            String version = getVersionString(that.getVersion());
            ImportPath importPath = that.getImportPath();
            List<String> name = getNameAsList(importPath);
            if (pkg.getNameAsString().isEmpty()) {
                that.addError("module descriptor encountered in root source directory");
            }
            else if (name.isEmpty()) {
                that.addError("missing module name");
            }
            else {
                String initialName = name.get(0);
                if (initialName.equals(Module.DEFAULT_MODULE_NAME)) {
                    importPath.addError("reserved module name: 'default'");
                }
                else if (name.size()==1 && initialName.equals("ceylon")) {
                    importPath.addError("reserved module name: 'ceylon'");
                }
                else {
                    if (initialName.equals("ceylon")) {
                        importPath.addUsageWarning(Warning.ceylonNamespace,
                                "discouraged module name: this namespace is used by Ceylon platform modules");
                    }
                    else if (initialName.equals("java") || initialName.equals("javax")) {
                        importPath.addUnsupportedError("unsupported module name: this namespace is used by Java platform modules");
                    }
                    mainModule = moduleManager.getOrCreateModule(name, version);
                    importPath.setModel(mainModule);
                    if (!completeOnlyAST) {
                        mainModule.setUnit(unit.getUnit());
                        mainModule.setVersion(version);
                    }
                    String nameString = formatPath(importPath.getIdentifiers());
                  if ( !pkg.getNameAsString().equals(nameString) ) {
                        importPath
                            .addError("module name does not match descriptor location: '" +
                                nameString + "' should be '" + pkg.getNameAsString() + "'",
                                8000);
                    }
                    if (!completeOnlyAST) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.