Package org.apache.flex.compiler.internal.scopes

Examples of org.apache.flex.compiler.internal.scopes.PackageScope


    {
        List<IDefinition> definitions = getDefinitionPromises();
        ASFileScope fileScope = new ASFileScope(fileNode);

        String packageName = Multiname.getPackageNameForQName(definitions.get(0).getQualifiedName());
        PackageScope packageScope = new PackageScope(fileScope, packageName);
        packageScope.setContainingScope(fileScope);

        PackageDefinition packageDefinition = new PackageDefinition(packageName);
        packageDefinition.setContainedScope(packageScope);

        fileScope.addDefinition(packageDefinition);
       
        for(IDefinition def : definitions)
        {
            Multiname mname = Multiname.crackDottedQName(getProject(), def.getQualifiedName());
            INamespaceDefinition packageNS = Iterables.getOnlyElement(mname.getNamespaceSet());

            ClassDefinition classDefinition = new ClassDefinition(mname.getBaseName(), (INamespaceReference)packageNS);
            IReference baseClass = ReferenceFactory.packageQualifiedReference(getProject().getWorkspace(), getFlexProject().getResourceBundleClass());
            classDefinition.setBaseClassReference(baseClass);
            classDefinition.setExcludedClass();

            TypeScope classScope = new TypeScope(packageScope, classDefinition);
            classScope.setContainingDefinition(classDefinition);
            classDefinition.setContainedScope(classScope);
            classDefinition.setupThisAndSuper();

            packageScope.addDefinition(classDefinition);
        }

        return fileScope;
    }
View Full Code Here


             * there. This could be cleaned up somewhat by having a list of
             * package scopes on every file scope and then changing things such
             * that package scopes are not added the file scope's symbol table.
             */
            scope.addDefinition(definition);
            PackageScope packageScope = new PackageScope(scope, definition.getQualifiedName(), contentsNode);
            definition.setContainedScope(packageScope);
            scope = packageScope;
        }

        if (set.contains(PostProcessStep.RECONNECT_DEFINITIONS))
View Full Code Here

    private FXGFileScope createFileScope()
    {
        FXGFileScope fileScope = new FXGFileScope(this, getAbsoluteFilename());

        String packageName = Multiname.getPackageNameForQName(qname);
        PackageScope packageScope = new PackageScope(fileScope, packageName);
        packageScope.setContainingScope(fileScope);

        PackageDefinition packageDefinition = new PackageDefinition(packageName);
        packageDefinition.setContainedScope(packageScope);

        fileScope.addDefinition(packageDefinition);

        Multiname mname = Multiname.crackDottedQName(getProject(), qname);
        INamespaceDefinition packageNS = Iterables.getOnlyElement(mname.getNamespaceSet());

        ClassDefinition classDefinition = new ClassDefinition(mname.getBaseName(), (INamespaceReference)packageNS);
        IReference baseClass = ReferenceFactory.packageQualifiedReference(getProject().getWorkspace(), fxgBaseClassName);
        classDefinition.setBaseClassReference(baseClass);

        TypeScope classScope = new TypeScope(packageScope, classDefinition);
        classScope.setContainingDefinition(classDefinition);
        classDefinition.setContainedScope(classScope);
        classDefinition.setupThisAndSuper();

        packageScope.addDefinition(classDefinition);

        return fileScope;
    }
View Full Code Here

       
        this.qname = qname;

        fileScope = new MXMLFileScope(compilationUnit, fileName, mxmlData);
        String packageName = Multiname.getPackageNameForQName(qname);
        packageScope = new PackageScope(fileScope, packageName);
        packageScope.setContainingScope(fileScope);
        PackageDefinition packageDefinition = new PackageDefinition(packageName);
        // CMP-742: packages created for MXML scopes should be marked implicit
        packageDefinition.setImplicit();
        packageDefinition.setContainedScope(packageScope);
View Full Code Here

            // public members of a class get placed in the global public package "".
            ClassDefinition classDefinition = getContainingClassDefinition(scope);
            if (classDefinition != null)
                return PUBLIC;

            PackageScope packageScope = getContainingPackageScope(scope);
            if (packageScope != null)
                return packageScope.getPublicNamespace();

            // If we see a referenc to public outside of a package, but it is used as
            // a qualifier, then return the unnamed public namespace
            if( node.isExpressionQualifier() )
                return PUBLIC;
View Full Code Here

        if( first instanceof IPublicNamespaceDefinition && baseName.equals(INamespaceConstants.public_) )
        {
            // Anything that resolve to the unnanmed namespace won't have multiple namespaces
            if( first != PUBLIC )
            {
                PackageScope packageScope = getContainingPackageScope(scope);
                if( packageScope != null && packageScope.getPublicNamespace() == first )
                {
                    // "public" inside a package
                    // need to add the unnamed public namespace
                    nsrefs.add(PUBLIC);
                }
View Full Code Here

        // Interface members go in their own special namespace
        if (interfaceDef != null)
            return interfaceDef.getInterfaceNamespaceReference();

        PackageScope packageScope = getContainingPackageScope(scope);
        if (packageScope != null)
            return packageScope.getInternalNamespace();

        return getFileScope(scope).getFilePrivateNamespaceReference();
    }
View Full Code Here

    }

    @Override
    public void emitPackageHeaderContents(IPackageDefinition definition)
    {
        PackageScope containedScope = (PackageScope) definition
                .getContainedScope();

        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
        if (type == null)
            return;

        if (project == null)
            project = getWalker().getProject();
View Full Code Here

    }

    @Override
    public void emitPackageHeaderContents(IPackageDefinition definition)
    {
        PackageScope containedScope = (PackageScope) definition
                .getContainedScope();

        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
        if (type == null)
            return;

        List<String> list = resolveImports(type);
        for (String imp : list)
View Full Code Here

    }

    @Override
    public void emitPackageHeaderContents(IPackageDefinition definition)
    {
        PackageScope containedScope = (PackageScope) definition
                .getContainedScope();

        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
        if (type == null)
            return;

        List<String> list = resolveImports(type);
        for (String imp : list)
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.scopes.PackageScope

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.