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

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


            // Only check for packages if we don't have a base expression.
            // in a.b.c, 'a', 'a.b', or 'a.b.c' could be package names, but not 'c' or 'b.c'
            String ref = this.computeSimpleReference();
            if (ref != null)
            {
                ASScope scope = getASScope();

                if (scope.isPackageName(ref))
                    isPackage = true;
            }
        }
        return isPackage;
    }
View Full Code Here


    /**
     * @return true if this ExpressionNodeBase is in a with scope.
     */
    public boolean inWith()
    {
        ASScope scope = getASScope();
        return scope != null ? scope.isInWith() : false;
    }
View Full Code Here

       
        // getter or setter with same name as a package gets a warning/
        // we don't return true, however, as it isn't "really" a multiple definition
        if (funcDef instanceof IAccessorDefinition)
        {
            ASScope cs = (ASScope)funcDef.getContainingScope();
            if (cs.isPackageName(funcDef.getBaseName()))
            {
                IFunctionNode funcNode = (IFunctionNode)iNode;
                IASNode funcNameNode = funcNode.getNameExpressionNode();
                addProblem(new DefinitionShadowedByPackageNameProblem(funcNameNode));
            }
View Full Code Here

        {
            addProblem(new ConflictingInheritedNameInNamespaceProblem(iNode, varDef.getBaseName(), getNamespaceStringFromDef(varDef) ));
        }
           
        // Now look to see if the variable name is also a package name
        ASScope cs = (ASScope)varDef.getContainingScope();
        if (cs.isPackageName(varDef.getBaseName()))
        {
            IVariableNode varNode = (IVariableNode)iNode;
            IASNode varNameNode = varNode.getNameExpressionNode();
            addProblem(new DefinitionShadowedByPackageNameProblem(varNameNode));
        }
View Full Code Here

    {
        // Get the variable definition for the id from the class scope.
        MXMLClassDefinitionNode classDefinitionNode =
                (MXMLClassDefinitionNode)getClassDefinitionNode();
        IClassDefinition classDefinition = classDefinitionNode.getClassDefinition();
        ASScope classScope = (ASScope)classDefinition.getContainedScope();
        IDefinitionSet definitionSet = classScope.getLocalDefinitionSetByName(id);
        int n = definitionSet.getSize();
        for (int i = 0; i < n; i++)
        {
            IDefinition definition = definitionSet.getDefinition(i);
            if (definition instanceof IVariableDefinition)
View Full Code Here

        String percentProxy = propertyDefinition.getPercentProxy(project);
        if (percentProxy == null)
            return null;

        // Find the definition for the proxy property.
        ASScope classScope = (ASScope)propertyDefinition.getContainingScope();
        IClassDefinition classDefinition = (IClassDefinition)classScope.getDefinition();
        IDefinition proxyDefinition = classScope.getPropertyFromDef(
                project, classDefinition, percentProxy, false);
        if (!(proxyDefinition instanceof IVariableDefinition))
            return null;

        return (IVariableDefinition)proxyDefinition;
View Full Code Here

        // Reparse the file from which this definition came
        // 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)
View Full Code Here

    /** common code used by all the constructors
     */
    private void finishInit(MXMLClassDirectiveProcessor host)
    {
        ClassDefinition classDef = host.getClassDefinition();
        ASScope classScope = classDef.getContainedScope();
        analyzeExpression(host.getProject(), classScope);
       
        // TODO: we should be able to assert that we make a dest string, becuase
        // in general the bindign manager needs one, even if we have a dest func.
        // HOWEVER - we don't always generate on now, and it seems OK.
View Full Code Here

    private static ClassDefinition getContainingClassDefinition(IASScope scope)
    {
        if (!(scope instanceof ASScope))
            return null;

        ASScope asScope = (ASScope)scope;
        IDefinition containingDef = asScope.getContainingDefinition();
        if (containingDef == null)
            return null;
        if (containingDef instanceof ClassDefinition)
            return (ClassDefinition)containingDef;
View Full Code Here

          project.getFunctionReturnWatcherClass(),
          project.getXMLWatcherClass(),
          project.getBindingManagerClass()
        };
       
        ASScope scope = bindingDataBase.getScope();
        IWorkspace workspace = project.getWorkspace();
     
    
        for (String depend : depends)
        {
View Full Code Here

TOP

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

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.