Package org.apache.flex.compiler.internal.definitions

Examples of org.apache.flex.compiler.internal.definitions.PackageDefinition


        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)
        {
View Full Code Here


    @Override
    protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
    {
        if (set.contains(PostProcessStep.POPULATE_SCOPE))
        {
            PackageDefinition definition = buildDefinition();
            setDefinition(definition);
            /*
             * This could be improved because neither code model or the
             * compiler will ever dig package definitions out of there by name.
             * CM won't get them out of a file scope by name because of this
             * check here. The compiler won't ever get them out of a file scope
             * by name because the namespace specifier on all package
             * definitions is the CM implicit namespace. I opted to leave the
             * package definitions in the file scope for two reasons: #1. We
             * need to pin the package scopes otherwise they and their contents
             * will get GC'd. #2. There is code that enumerates the contents of
             * the file scope and that code wants to find package definitions in
             * 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

    }

    PackageDefinition buildDefinition()
    {
        String definitionName = getName();
        PackageDefinition definition = new PackageDefinition(definitionName);
        definition.setNode(this);
        this.setDefinition(definition);

        return definition;
    }
View Full Code Here

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

        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);
        fileScope.addDefinition(packageDefinition);
       
        problems = new LinkedList<ICompilerProblem>();

        includeHandler = new IncludeHandler(fileSpecGetter);
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.definitions.PackageDefinition

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.