Examples of IASNode


Examples of org.apache.flex.compiler.tree.as.IASNode

    void generateAccess(Binding binding, final boolean is_super, AccessType accessType, InstructionList result)
    {
        final Name name = binding.getName();
        assert (name != null) : "binding must have a name when calling generateAccess()";

        final IASNode node = binding.getNode();
        if ( name.isTypeName() )
        {
            // a type names node should always be a ITypedExpressionNode
            ITypedExpressionNode typeNode = (ITypedExpressionNode)node;
            IExpressionNode collectionNode = typeNode.getCollectionNode();
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

        result.addAll(stem);

        if ( isAnyNamespace(qualifier) )
        {
            IASNode site = qualifier.getNode() != null? qualifier.getNode(): iNode;

            currentScope.addProblem(new AnyNamespaceCannotBeQualifierProblem(site));
        }
        else if ( ! isNamespace(qualifier) )
        {
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

     */
    private static VariableNode findIteratorVariable(final ForLoopNode for_loop_node)
    {
        assert for_loop_node != null : "'for' loop node can't be null";

        final IASNode conditionalStatement = for_loop_node.getConditionalsContainerNode().getChild(0);
        final BinaryOperatorInNode in_node = (BinaryOperatorInNode)conditionalStatement;
        final VariableExpressionNode var_expr_node = (VariableExpressionNode)in_node.getLeftOperandNode();
        final VariableNode var_node = (VariableNode)var_expr_node.getChild(0);
        return var_node;
    }
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

            return true;

        // So do any visual children (MX or Spark) of an MX container.
        if (isDeferredInstantiationUIComponent())
        {
            IASNode parent = getParent();
            if (parent instanceof IMXMLClassReferenceNode &&
                ((IMXMLClassReferenceNode)parent).isContainer())
            {
                return true;
            }
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

    @Override
    public VariableClassification getVariableClassification()
    {
        IScopedNode scopedNode = getScopeNode();
        IASNode node = scopedNode;
       
        if (node != null)
        {
            if (node instanceof ICommonClassNode || node.getParent() instanceof ICommonClassNode)
                return VariableClassification.CLASS_MEMBER;
           
            if (node.getParent() instanceof IInterfaceNode)
                return VariableClassification.INTERFACE_MEMBER;
           
            if (node.getParent() instanceof PackageNode)
                return VariableClassification.PACKAGE_MEMBER;
           
            if (node instanceof FileNode) //this is an include
                return VariableClassification.FILE_MEMBER;
        }
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

        if (!(getParent() instanceof IVariableNode))
        {
            int numChildren = getChildCount();
            for (int i = 0; i < numChildren; i++)
            {
                IASNode child = getChild(i);
                if (child instanceof IVariableNode && i > 0)
                { // we got a chained variable
                    varEnd = getChild(i - 1).getEnd();
                    break;
                }
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

     *
     * @return The Context that this expression occurs in
     */
    public Context getContext()
    {
        IASNode p = getParent();

        Context c = null;

        while (p != null && c == null)
        {
            if (p instanceof VariableNode)
            {
                VariableNode vn = (VariableNode)p;
                IVariableDefinition varDef = (IVariableDefinition)vn.getDefinition();
                switch (varDef.getVariableClassification())
                {
                    case CLASS_MEMBER:
                    {
                        if (varDef.hasModifier(ASModifier.STATIC))
                            c = Context.STATIC_CONTEXT;
                        else
                            c = Context.INSTANCE_CONTEXT;
                        break;
                    }

                    case PACKAGE_MEMBER:
                    {
                        c = Context.PACKAGE_CONTEXT;
                        break;
                    }

                    case FILE_MEMBER:
                    {
                        c = Context.GLOBAL_CONTEXT;
                        break;
                    }

                    // Otherwise, Keep looking, context will be based on the enclosing definition of the
                    // Variable Decl
                    //case LOCAL:
                    //case PARAMETER:
                    //break;
                }
            }
            else if (p instanceof FunctionNode)
            {
                FunctionNode fn = (FunctionNode)p;
                FunctionDefinition funcDef = fn.getDefinition();
                switch (funcDef.getFunctionClassification())
                {
                    case CLASS_MEMBER:
                    case INTERFACE_MEMBER:
                    {
                        if (funcDef.hasModifier(ASModifier.STATIC))
                            c = Context.STATIC_CONTEXT;
                        else
                            c = Context.INSTANCE_CONTEXT;
                        break;
                    }
                   
                    case PACKAGE_MEMBER:
                    case FILE_MEMBER:
                    {
                        c = Context.GLOBAL_CONTEXT;
                        break;
                    }
                }
            }
           
            if (p instanceof FunctionObjectNode)
            {
                // 'this' could be anything in a function expression - callers can use whatever 'this' they like
                c = Context.GLOBAL_CONTEXT;
            }
            else if (p instanceof ClassNode)
            {
                // If we get here then this expression must be loose code in a class def,
                // so we are running in a static context
                c = Context.STATIC_CONTEXT;
            }
            else if (p instanceof PackageNode)
            {
                // If we get here, then this expression must be loose code in a package def,
                // so we're running in a package context
                c = Context.PACKAGE_CONTEXT;
            }
            else if (p instanceof IMXMLScriptNode)
            {
                // If we get here then this expression must be loose code in a <fx:Script> tag,
                // which is compiled as if it was loose code in a class, so we are a static context
                c = Context.STATIC_CONTEXT;
            }
            else if (p instanceof IMXMLDocumentNode)
            {
                // If we get here, the this expression must be loose code in a MXML document, such
                // as in a databinding expression, so we're in Instance context
                c = Context.INSTANCE_CONTEXT;
            }

            p = p.getParent();
        }

        // If we run out of parents, then we must be in a global context
        if (c == null)
            c = Context.GLOBAL_CONTEXT;
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

        {
            if (attributeName == null)
                throw new NullPointerException();
           
            ICompilationUnit splashUnit = null;
            IASNode asNode = getRootNode();
           
            if (!(asNode instanceof IMXMLFileNode))
                return null;
           
            IMXMLFileNode mxmlNode = (IMXMLFileNode)asNode;
            List<IEmbedResolver> embedNodes = mxmlNode.getEmbedNodes();
            for (IEmbedResolver node : embedNodes)
            {
               
                if (node instanceof IMXMLEmbedNode)
                {
                    IMXMLEmbedNode embedNode = (IMXMLEmbedNode)node;
                    IASNode parent = embedNode.getParent();
                    if (parent instanceof IMXMLPropertySpecifierNode)
                    {
                        IMXMLPropertySpecifierNode propertyNode = (IMXMLPropertySpecifierNode)parent;
                        IDefinition propertyDefinition = propertyNode.getDefinition();
                        if (propertyDefinition instanceof ISetterDefinition)
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

        }
       
        private ITargetAttributes computeTargetAttributes() throws InterruptedException
        {
            IASNode root = getRootNode();
            if (!(root instanceof IFileNode))
                return NilTargetAttributes.INSTANCE;

            final ITargetAttributes nodeTargetAttributes = ((IFileNode)root).getTargetAttributes(flexProject);
            if (nodeTargetAttributes == null)
View Full Code Here

Examples of org.apache.flex.compiler.tree.as.IASNode

     * @return  true if this variable is declared inside a control flow construct
     */
    private boolean isInControlFlow()
    {
        boolean result = false;
        IASNode n = getParent();
        while( n !=null )
        {
            if( n instanceof BlockNode || // OK to be nested in empty blocks
                n instanceof ChainedVariableNode )// OK to be nested in a chained variable
            {
                n = n.getParent();
            }
            else if( n instanceof BaseDefinitionNode )
            {
                // If we hit a DefinitionNode, then we made it to our containing definition
                // we can stop looking now
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.