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

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


    {
        // If node reference is set, find the source file name from
        // offset lookup
        if (nodeRef != NodeReference.noReference)
        {
            final ASFileScope fileScope = getFileScope();
            if (fileScope != null && fileScope.getOffsetLookup() != null)
            {
                return fileScope.getOffsetLookup().getFilename(getAbsoluteStart());
            }
        }

        ASScope containingScope = (ASScope)getContainingScope();
        if (containingScope != null)
View Full Code Here


        ASScope containingScope = getContainingASScope();
        if (containingScope == null)
            return null;

        ASFileScope fileScope = containingScope.getFileScope();
        if (fileScope == null)
            return null;

        IASNode node = nodeRef.getNode(fileScope.getWorkspace(), getContainingASScope());
        if (!(node instanceof IDefinitionNode))
            return null;

        return (IDefinitionNode)node;
    }
View Full Code Here

            final FileNode fileNode = (FileNode)getAncestorOfType(FileNode.class);
            assert fileNode != null : "FileNode not found: function " + getName();
            final IWorkspace workspace = fileNode.getWorkspace();

            ASFileScope fileScope = fileNode.getFileScope();
            fileScope.addParsedFunctionBodies(this);

            try
            {
                // select function body source
                final Reader sourceReader;
View Full Code Here

            final ScopedBlockNode contents = getScopedNode();
            if (contents.getChildCount() > 0)
            {
                final FileNode fileNode = (FileNode)getAncestorOfType(FileNode.class);
                ASFileScope fileScope = fileNode.getFileScope();
                fileScope.removeParsedFunctionBodies(this);

                contents.removeAllChildren();

                // Now we need to remove all the definitions in this function scope, except
                // we keep the parameters. This is because the initial "skeleton parse" goes as
View Full Code Here

    }

    protected void initializeScope(ASScope containingScope)
    {
        //containing scope will always be null here
        final ASFileScope fileScope = new ASFileScope(this);
        if (offsetLookup != null)
            fileScope.setOffsetLookup(offsetLookup);
        scope = fileScope;
    }
View Full Code Here

        final Collection<ICompilerProblem> problems = builder.getProblems();

        setSourcePath(attribute.getParent().getParent().getFileSpecification().getPath());

        final int startOffsetLocal = attribute.getValueStart();
        final ASFileScope fileScope = builder.getFileScope();
        final OffsetLookup offsetLookup = fileScope.getOffsetLookup();
        assert offsetLookup != null : "Expected OffsetLookup on FileScope.";
        final String filePath = getContainingFilePath();
        final int[] absoluteOffsets =
                offsetLookup.getAbsoluteOffset(filePath, startOffsetLocal);
        final int startOffsetAbsolute = absoluteOffsets[0];
View Full Code Here

        // to create a new AST.
        // TODO Detect whether the file has changed since the definition was created.
        if( workspace != null )
        {
            ASScope s = scope;
            ASFileScope fileScope = null;
            // Get the file scope, and reconnect the AST to the definitions/scopes that
            // already exist
            while( s != null )
            {
                if( s instanceof ASFileScope )
                {
                    fileScope = (ASFileScope)s;
                }
                s = s.getContainingScope();
            }
            if( fileScope != null) {

                // Grab the lock
                synchronized (this)
                {
                    // Check again in case another thread already updated the node reference
                    node = nodeRef.get();
                    if(node != null )
                        return node;

                    // Get the file node from the file scope
                    IASNode fileNode = fileScope.getNode();

                    if (fileNode != null)
                    {
                        // Find the node that produced this definition,
                        // using the starting offset stored in this definition.
View Full Code Here

    @Override
    public IFileSpecification getFileSpecification()
    {
        // TODO Make sure this works with include processing!!!
        ASFileScope fileScope = getFileScope();
        IWorkspace w = fileScope.getWorkspace();
        return w.getFileSpecification(fileScope.getContainingPath());
    }
View Full Code Here

            if (!(qualifierNamespaceRef instanceof INamespaceDefinition))
                return qualifierNamespaceRef.getBaseName() + ":";
            // file private not handled in here, generatURI handles file private.
            if (qualifierNamespaceRef instanceof IFilePrivateNamespaceDefinition)
            {
                ASFileScope containingFileScope = ((ASScope)containingScope).getFileScope();
                assert containingFileScope != null;
                return generateQualifierPrefixStringForFilePrivate(qualifierNamespaceRef.getBaseName(), containingFileScope) + ":";
            }
            if (qualifierNamespaceRef instanceof IPrivateNamespaceDefinition)
                return "private:";
View Full Code Here

TOP

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

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.