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

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


    protected ScopedBlockNode contentsNode;

    public FunctionContentsPart()
    {
        super();
        argumentsNode = new ContainerNode(2);
        argumentsNode.setContainerType(ContainerType.PARENTHESIS);
        contentsNode = new ScopedBlockNode(false);
        // Set the contents to implicit - the parser will set to BRACES if it
        // sees a function body
        contentsNode.setContainerType(ContainerType.SYNTHESIZED);
View Full Code Here


        // 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);
View Full Code Here

    {
        if (container == null || arrayLiteralNode == null)
            return;

        // Hoist content associated with the failed array literal.
        final ContainerNode contents = arrayLiteralNode.getContentsNode();
        for (int i = 0; i < contents.getChildCount(); i++)
        {
            final IASNode child = contents.getChild(i);
            if (child.getNodeID() == ASTNodeID.FunctionObjectID)
                container.addChild(((FunctionObjectNode)child).getFunctionNode());
            else
                container.addChild((NodeBase)child);
        }
View Full Code Here

    }

    @Override
    public void emitLiteralContainer(ILiteralContainerNode node)
    {
        final ContainerNode cnode = node.getContentsNode();
        final ContainerType type = cnode.getContainerType();
        String postFix = "";

        if (type == ContainerType.BRACES)
        {
            write(ASEmitterTokens.BLOCK_OPEN);
            postFix = ASEmitterTokens.BLOCK_CLOSE.getToken();
        }
        else if (type == ContainerType.BRACKETS)
        {
            write(ASEmitterTokens.SQUARE_OPEN);
            postFix = ASEmitterTokens.SQUARE_CLOSE.getToken();
        }
        else if (type == ContainerType.IMPLICIT)
        {
            // nothing to write, move along
        }
        else if (type == ContainerType.PARENTHESIS)
        {
            write(ASEmitterTokens.PAREN_OPEN);
            postFix = ASEmitterTokens.PAREN_CLOSE.getToken();
        }

        final int len = cnode.getChildCount();
        for (int i = 0; i < len; i++)
        {
            IASNode child = cnode.getChild(i);
            getWalker().walk(child);
            if (i < len - 1)
                writeToken(ASEmitterTokens.COMMA);
        }
View Full Code Here

    }

    @Override
    public void emitLiteralContainer(ILiteralContainerNode node)
    {
        final ContainerNode cnode = node.getContentsNode();
        final ContainerType type = cnode.getContainerType();
        String postFix = "";

        if (type == ContainerType.BRACES)
        {
            write(ASEmitterTokens.BLOCK_OPEN);
            postFix = ASEmitterTokens.BLOCK_CLOSE.getToken();
        }
        else if (type == ContainerType.BRACKETS)
        {
            write(ASEmitterTokens.SQUARE_OPEN);
            postFix = ASEmitterTokens.SQUARE_CLOSE.getToken();
        }
        else if (type == ContainerType.IMPLICIT)
        {
            // nothing to write, move along
        }
        else if (type == ContainerType.PARENTHESIS)
        {
            write(ASEmitterTokens.PAREN_OPEN);
            postFix = ASEmitterTokens.PAREN_CLOSE.getToken();
        }

        final int len = cnode.getChildCount();
        for (int i = 0; i < len; i++)
        {
            IASNode child = cnode.getChild(i);
            getWalker().walk(child);
            if (i < len - 1)
                writeToken(ASEmitterTokens.COMMA);
        }
View Full Code Here

TOP

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

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.