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

Examples of org.apache.flex.compiler.internal.tree.as.ConditionalNode


        // generate: if (bytes == null)
        ASToken compareToken = new ASToken(ASTokenTypes.TOKEN_OPERATOR_EQUAL, -1, -1, -1, -1, "==");
        BinaryOperatorNodeBase nullCheck = BinaryOperatorNodeBase.create(compareToken, new IdentifierNode("bytes"), new LiteralNode(LiteralType.NULL, nullToken));
        IfNode ifStmt = new IfNode(null);
        ConditionalNode cNode = new ConditionalNode(null);
        cNode.setConditionalExpression(nullCheck);
        ifStmt.addBranch(cNode);
        movieClipDataContents.addItem(ifStmt);
        BlockNode ifContents = cNode.getContentsNode();

        // generate: bytes = ByteArray(new $assetByteArray());
        ASToken newToken = new ASToken(ASTokenTypes.TOKEN_KEYWORD_NEW, -1, -1, -1, -1, IASKeywordConstants.NEW);
        FunctionCallNode newBytes = new FunctionCallNode(newToken, new IdentifierNode(byteArrayClassName));
        FunctionCallNode byteArrayCall = new FunctionCallNode(new IdentifierNode("ByteArray"));
View Full Code Here


                    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;
            case SwitchID:
                {
                    SwitchNode switchNode = (SwitchNode)node;
                    populateLabelMap(labelMap, switchNode.getStatementContentsNode());
                }
                break;
            case ConditionalID:
                {
                    ConditionalNode conditionalNode = (ConditionalNode)node;
                    populateLabelMap(labelMap, conditionalNode.getStatementContentsNode());
                }
                break;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.tree.as.ConditionalNode

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.