Package org.apache.flex.compiler.tree.as

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


        processPropertyOrStyleOverride(styleOverride, styleNode, context);
    }
   
    void processPropertyOrStyleOverride(Name overrideName, IMXMLPropertySpecifierNode propertyOrStyleNode, Context context)
    {
        IASNode parentNode = propertyOrStyleNode.getParent();
        String id = parentNode instanceof IMXMLInstanceNode ?
                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
                    "";
       
        String name = propertyOrStyleNode.getName();       
View Full Code Here


    void processEventOverride(IMXMLEventSpecifierNode eventNode, Context context)
    {
        FlexProject project = getProject();
        Name eventOverride = project.getEventOverrideClassName();
       
        IASNode parentNode = eventNode.getParent();
        String id = parentNode instanceof IMXMLInstanceNode ?
                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
                    "";
       
        String name = eventNode.getName();
View Full Code Here

        {
            // Check the parent - if it's an instance then we want to use these
            // nodes to get our property values from. If not, then it's the root
            // and we don't need to specify destination
           
            IASNode parent = propertySpecifier.getParent();
            if (parent instanceof IMXMLInstanceNode)
            {
               IMXMLInstanceNode parentInstance = (IMXMLInstanceNode)parent;
               String parentId = parentInstance.getEffectiveID();
               assert parentId != null;
               String propName = propertySpecifier.getName();
              
              
               if (getProject().getTargetSettings().getMxmlChildrenAsData())
               {
                   addItemsIL.addInstruction(OP_pushstring, "destination");
                   addItemsIL.addInstruction(OP_pushtrue); // simple type
                   addItemsIL.addInstruction(OP_pushstring, parentId);
                   addItemsIL.addInstruction(OP_pushstring, "propertyName");
                   addItemsIL.addInstruction(OP_pushtrue); // simple type
                   addItemsIL.addInstruction(OP_pushstring, propName);
                   addItemsCounter += 2;
               }
               else
               {
                   context.addInstruction(OP_dup);         // stack: ..., addItems, addItems
                   context.addInstruction(OP_pushstring, parentId);
                   context.addInstruction(OP_setproperty, new Name("destination"));
                                                           // stack: ..., addItems
                   context.addInstruction(OP_dup);         // stack: ..., addItems, addItems
                   context.addInstruction(OP_pushstring, propName);
                   context.addInstruction(OP_setproperty, new Name("propertyName"));
                                                           // stack: ..., addItems
               }
            }
        } 
       
        //---------------------------------------------------------------
        // Third property set: position and relativeTo
        String positionPropertyValue = null;
        String relativeToPropertyValue = null;
      
        // look to see if we have any sibling nodes that are not state dependent
        // that come BEFORE us
        IASNode instanceParent = instanceNode.getParent();
        IASNode prevStatelessSibling=null;
        for (int i=0; i< instanceParent.getChildCount(); ++i)
        {
            IASNode sib = instanceParent.getChild(i);
            if (sib instanceof IMXMLInstanceNode)
            {
              
                // stop looking for previous nodes when we find ourself
                if (sib == instanceNode)
View Full Code Here

     *    at the time the ControlFlowContextManager was built.
     */
    ControlFlowContextManager(LexicalScope current_scope)
    {
        this.currentScope = current_scope;
        IASNode initialControlFlowRegionNode = currentScope.getInitialControlFlowRegionNode();
        if (initialControlFlowRegionNode != null)
        {
            LabelScopeControlFlowContext rootContext = new LabelScopeControlFlowContext(initialControlFlowRegionNode);
            activeFlowContexts.add(rootContext);
        }
View Full Code Here

                {
                    IfNode ifNode = (IfNode) node;
                    int nIfNodeChildren = ifNode.getChildCount();
                    for (int i = 0; i < nIfNodeChildren; ++i)
                    {
                        IASNode ifNodeChild = ifNode.getChild(i);
                        if (ifNodeChild instanceof ConditionalNode)
                        {
                            ConditionalNode conditionalNode = (ConditionalNode) ifNodeChild;
                            IASNode conditionalBlockNode = conditionalNode.getContentsNode();
                            assert conditionalBlockNode != null;
                            populateLabelMap(labelMap, conditionalBlockNode);
                        }
                        else if (ifNodeChild instanceof TerminalNode)
                        {
                            TerminalNode terminalNode = (TerminalNode) ifNodeChild;
                            IASNode terminalBlockNode = terminalNode.getContentsNode();
                            assert terminalBlockNode != null;
                            populateLabelMap(labelMap, terminalBlockNode);
                        }
                    }
                }
                break;
            case LabledStatementID:
                {
                    LabeledStatementNode labelNode = (LabeledStatementNode) node;
                    String labelName = labelNode.getLabel();
                    if (labelName != null)
                        labelMap.put(labelName, labelNode);
                    populateLabelMap(labelMap, labelNode.getLabeledStatement());
                }
                break;
            case FileID:
            case BlockID:
            case MXMLEventSpecifierID:
                {
                    int childCount = node.getChildCount();
                    for (int i = 0; i < childCount; ++i)
                    {
                        IASNode child = node.getChild(i);
                        assert child != null;
                        populateLabelMap(labelMap, child);
                    }
                }
                break;
View Full Code Here

        return true;
    }

    public String getParentQualifiedName()
    {
        IASNode parent = getParent();
        if (parent instanceof MetaTagsNode)
        {
            IASNode decNode = ((MetaTagsNode)parent).getDecoratedDefinition();
            if (decNode != null)
                return ((IDefinitionNode)decNode).getQualifiedName();
        }
        return null;
    }
View Full Code Here

    }

    @Override
    public IScopedNode getScopeNode()
    {
        IASNode parent = getParent();
       
        if (parent instanceof IterationFlowNode)
        {
            // we're a label for a break statement
            return null;
        }
       
        // If our parent is a DefaultPropertTag [DefaultProperty("property")]
        // then it is referencing a property that is not in the same scope;
        // so find the MemberedNode it is above and use that scope instead.
        if (parent instanceof DefaultPropertyTagNode)
        {
            // Get containing block.
            IASNode node = parent.getAncestorOfType(BlockNode.class);
            if (node instanceof BlockNode)
            {
                int childCount = node.getChildCount();
                boolean descend = false;
                for (int i = 0; i < childCount; i++)
                {
                    IASNode child = node.getChild(i);
                    if (!descend && child instanceof MetaTagsNode)
                    {
                        IMetaTagNode[] allTags = ((MetaTagsNode)child).getAllTags();
                        for (int t = 0; t < allTags.length; t++)
                        {
                            if (allTags[t] == parent)
                            {
                                descend = true;
                                break;
                            }
                        }
                    }
                    if (descend && child instanceof MemberedNode)
                    {
                        return ((MemberedNode)child).getScopedNode().getScopeNode();
                    }
                }
            }
        }
       
        else if (parent instanceof EventTagNode ||
                 parent instanceof EffectTagNode ||
                 parent instanceof StyleTagNode)
        {
            IASNode parentNode = parent.getParent();
            if (parentNode instanceof MetaTagsNode)
            {
                IASNode decoratedNode = ((MetaTagsNode)parentNode).getDecoratedDefinition();
                if (decoratedNode instanceof MemberedNode)
                    return ((MemberedNode)decoratedNode).getScopedNode().getScopeNode();
            }
            else if (parentNode instanceof IMXMLMetadataNode)
            {
View Full Code Here

     * @return the parent IDefinitionNode, or null if the parent is not an
     * IDefinitionNode
     */
    private BaseDefinitionNode getParentAsDefinition()
    {
        IASNode p = getParent();
        BaseDefinitionNode def = p instanceof BaseDefinitionNode ? (BaseDefinitionNode)p : null;
        return def;
    }
View Full Code Here

        DependencyType dt = getDependencyType();
        if (dt == DependencyType.SIGNATURE || dt == DependencyType.INHERITANCE)
            return true;
        if (dt == DependencyType.EXPRESSION)
        {
            final IASNode parent = getParent();
            if (parent instanceof BaseTypedDefinitionNode && this == ((BaseTypedDefinitionNode)parent).getTypeNode())
                return true;
        }

        return false;
View Full Code Here

               name == INamespaceConstants.ANY;
    }

    public boolean isExpressionQualifier()
    {
        IASNode p = getParent();
        if( p instanceof NamespaceAccessExpressionNode )
        {
            return ((NamespaceAccessExpressionNode) p).getLeftOperandNode() == this;
        }
        return false;
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IASNode

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.