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

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


        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"));
        ContainerNode args = byteArrayCall.getArgumentsNode();
        args.addItem(newBytes);
        BinaryOperatorNodeBase assignmentBytes = BinaryOperatorNodeBase.create(assignToken, new IdentifierNode("bytes"), byteArrayCall);
        ifContents.addItem(assignmentBytes);

        // generate: return bytes;
        ReturnNode returnStmt = new ReturnNode(null);
        returnStmt.setStatementExpression(new IdentifierNode("bytes"));
        movieClipDataContents.addItem(returnStmt);
View Full Code Here


            if (parent instanceof BlockNode)
            {
                IASNode node = parent.getParent();
                if (node instanceof MemberedNode)
                {
                    BlockNode contents = ((MemberedNode)node).getScopedNode();
                    int childCount = contents.getChildCount();
                    boolean found = false;
                    for (int i = 0; i < childCount; i++)
                    {
                        IASNode child = contents.getChild(i);
                        if (found)
                        {
                            if (child instanceof IDefinitionNode)
                            {
                                decoratedNode = (IDefinitionNode)child;
                                if (child instanceof ClassNode)
                                {
                                    analyze(EnumSet.of(PostProcessStep.POPULATE_SCOPE), ((ClassNode)child).getScopedNode().getASScope(), new ArrayList<ICompilerProblem>(0));
                                }
                                if (child instanceof BaseDefinitionNode)
                                {
                                    ((BaseDefinitionNode)child).setMetaTags(this);
                                }
                                break;
                            }
                        }
                        else
                        {
                            if (child == this)
                            {
                                found = true;
                            }
                        }
                    }
                    //we're still null, so let's loop through backwards to see if we can find the node we are decorating
                    //this could happen in MXML land when the mx:MetaData block comes after a script/event block
                    if (decoratedNode == null && found)
                    {
                        for (int i = childCount - 1; i >= 0; i--)
                        {
                            IASNode child = contents.getChild(i);
                            if (child instanceof IDefinitionNode)
                            {
                                decoratedNode = (IDefinitionNode)child;
                                if (child instanceof ClassNode)
                                {
View Full Code Here

TOP

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

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.