Package org.apache.flex.compiler.units

Examples of org.apache.flex.compiler.units.ICompilationUnit


                    Set<IDefinition> shadowedDefinitions = projectScope.getShadowedDefinitionsByQName(qName);
                    if (shadowedDefinitions != null)
                    {
                        for (IDefinition shadowedDefinition : shadowedDefinitions)
                        {
                            ICompilationUnit shadowedCompilationUnit =
                                projectScope.getCompilationUnitForDefinition(shadowedDefinition);
                            result.add(shadowedCompilationUnit);
                        }
                    }
                }
View Full Code Here


     * <p>
     * This method is used by the definition-shadowing logic.
     */
    private int compareDefinitions(IDefinition a, IDefinition b)
    {
        ICompilationUnit cuA = getCompilationUnitForDefinition(a);
        ICompilationUnit cuB = getCompilationUnitForDefinition(b);
        return compareCompilationUnits(cuA, cuB);
    }
View Full Code Here

       
        // Compare the definition priorities of the two definitions'
        // compilation units to determine which goes into the shadowed set
        // and which goes into the visible store.
       
        ICompilationUnit visibleDefinitionCU = getCompilationUnitForDefinition(visibleDefinition);
        ICompilationUnit newDefinitionCU = getCompilationUnitForDefinition(newDefinition);
       
        if (compareCompilationUnits(visibleDefinitionCU, newDefinitionCU) >= 0)
        {
            // Old shadows new.
            // Put the new definition into the shadow set,
View Full Code Here

           
            if ((!(visibleDefinition instanceof DefinitionPromise)) && (definition instanceof DefinitionPromise))
            {
                // visibleDefinition might be the actual definition of the
                // promise we are trying to remove.
                ICompilationUnit visibleDefinitionCU = getCompilationUnitForDefinition(visibleDefinition);
                if (visibleDefinitionCU == ((DefinitionPromise)definition).getCompilationUnit())
                {
                    // visibleDefinition is the actual definition for the definition we are trying to remove.
                    // We'll just remove the actual definition for our promise, by calling this method recursively.
                    assert visibleDefinition == findVisibleDefinition(visibleDefinition) : "assert if we are about to start infinite recursion";
View Full Code Here

        if (scope == null)
            return null;

        ASFileScope fileScope = (ASFileScope)scope;
        ICompilationUnit compilationUnit = fileScope.getCompilationUnit();
        if (compilationUnit != null)
        {
            assert compilationUnit.getProject() == getProject();
            return compilationUnit;
        }
        readLock.lock();
        try
        {
            assert fileScope instanceof SWCFileScope : "only SWCFileScope should be in swcFileScopeToCompilationUnitMap";
            ICompilationUnit swcCompilationUnit = swcFileScopeToCompilationUnitMap.get(fileScope);
            assert (swcCompilationUnit == null) || (swcCompilationUnit.getProject() == getProject());
            return swcCompilationUnit;
        }
        finally
        {
            readLock.unlock();
View Full Code Here

        if (AppliedVectorDefinition.isVectorScope(scope))
            return;
       
        // find the compilation unit which corresponds to the scope, and maintain a mapping
        // of compilation unit to scopes, so we can easily invalidate the scope caches
        ICompilationUnit compilationUnit = getCompilationUnitForScope(scope);
        assert compilationUnit != null;
        Collection<IASScope> relatedScopes = compilationUnitToScopeList.getUnchecked(compilationUnit);
        relatedScopes.add(scope);
       
    }
View Full Code Here

       
    }
   
    public void getPropertyForScopeChain(ASScope referencingScope, Collection<IDefinition> defs, String baseName, Set<INamespaceDefinition> namespaceSet, DependencyType dt)
    {
        final ICompilationUnit referencingCU = getCompilationUnitForScope(referencingScope);
       
        if ((referencingCU != null) && (referencingCU.isInvisible()))
        {
            getPropertyForScopeChainInvisibleCompilationUnit(referencingCU, defs, baseName, namespaceSet);
        }
       
        if ((dt != null) && !AppliedVectorDefinition.isVectorScope(referencingScope))
View Full Code Here

                    for (final String definitionQName : script.getDefinitions())
                    {
                        qnames.add(definitionQName.replace(":", "."));
                    }

                    final ICompilationUnit cu = new SWCCompilationUnit(
                            project, swc, library, script, qnames, order);
                    result.add(cu);
                }
            }
           
View Full Code Here

                problemQuery.clear();
            }

            final IFileSpecification sourceFileSpec = new FileSpecification(sourceFilename);
            workspace.fileAdded(sourceFileSpec);
            final ICompilationUnit cu = ASCompilationUnit.createMainCompilationUnitForASC(
                    applicationProject,
                    sourceFileSpec,
                    this);
            mainUnits.add(cu);
            unitOrdering.put(cu,unitOrdering.size());
           
            // add compilation unit to project
            applicationProject.addCompilationUnit(cu);
            applicationProject.updatePublicAndInternalDefinitions(Collections.singletonList(cu));
           
            // The logic that re-parses a garbage collected syntax tree, does not
            // know about the files included with the -in option, so we'll pin
            // the syntax tree here so we know we will never need to re-parse the
            // the synax tree for the root compilation unit.
            rootedSyntaxTrees.add(cu.getSyntaxTreeRequest().get().getAST());
           
            // syntax errors
            for (final ICompilationUnit compilationUnit : applicationProject.getCompilationUnits())
            {
                final ICompilerProblem[] problems = compilationUnit.getSyntaxTreeRequest().get().getProblems();
                problemQuery.addAll(problems);
            }
           
            //  Parse trees
            if ( getShowParseTrees() )
            {
                final String outputSyntaxFilename = FilenameUtils.removeExtension(sourceFilename).concat(".p");
                try
                {
                    PrintWriter syntaxFile = new PrintWriter(outputSyntaxFilename);
                    final IASNode ast = cu.getSyntaxTreeRequest().get().getAST();
                    if(ast instanceof FileNode)
                    {
                        // Parse the full tree and add the new problems found in the
                        // function bodies into the problem collection.
                        final FileNode fileNode = (FileNode)ast;
View Full Code Here

        final List<ICompilationUnit> compilationUnits = new ArrayList<ICompilationUnit>();

        // import ABC files
        for (final String importFilename : getImportFilenames())
        {
            final ICompilationUnit cu;
            String lcFilename = importFilename.toLowerCase();
            if (lcFilename.endsWith(".abc"))
            {
                cu  = new ABCCompilationUnit(applicationProject, importFilename);
                compilationUnits.add(cu);
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.units.ICompilationUnit

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.