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

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


    }

    @Override
    public void emitForEachLoop(IForLoopNode node)
    {
        IContainerNode xnode = (IContainerNode) node.getChild(1);
        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
                .getConditionalsContainerNode().getChild(0);
        IASNode childNode = bnode.getChild(0);

        write(JSGoogEmitterTokens.GOOG_ARRAY_FOREACH);
View Full Code Here


        }
        else if (node.getLiteralType() == LiteralType.ARRAY
                || node.getLiteralType() == LiteralType.OBJECT)
        {
            BaseLiteralContainerNode anode = (BaseLiteralContainerNode) node;
            IContainerNode cnode = anode.getContentsNode();
            emitter.emitLiteralContainer(cnode);
        }
    }
View Full Code Here

    @Override
    public void handle(IASNode node)
    {
        if (node.getNodeID() == ASTNodeID.BlockID)
        {
            IContainerNode container = (IContainerNode) node;
            ContainerType type = container.getContainerType();
            if (type != ContainerType.IMPLICIT
                    && type != ContainerType.SYNTHESIZED)
            {
                if (node.getChildCount() != 0)
                {
View Full Code Here

    @Override
    public void emitIf(IIfNode node)
    {
        IConditionalNode conditional = (IConditionalNode) node.getChild(0);

        IContainerNode xnode = (IContainerNode) conditional
                .getStatementContentsNode();

        write("if");
        write(" ");
        write("(");
        getWalker().walk(conditional.getChild(0)); // conditional expression
        write(")");
        if (!isImplicit(xnode))
            write(" ");

        getWalker().walk(conditional.getChild(1)); // BlockNode
        IConditionalNode[] nodes = node.getElseIfNodes();
        if (nodes.length > 0)
        {
            for (int i = 0; i < nodes.length; i++)
            {
                IConditionalNode enode = nodes[i];
                IContainerNode snode = (IContainerNode) enode
                        .getStatementContentsNode();

                final boolean isImplicit = isImplicit(snode);
                if (isImplicit)
                    write("\n");
                else
                    write(" ");

                write("else if");
                write(" ");
                write("(");
                getWalker().walk(enode.getChild(0));
                write(")");
                if (!isImplicit)
                    write(" ");

                getWalker().walk(enode.getChild(1)); // ConditionalNode
            }
        }

        ITerminalNode elseNode = node.getElseNode();
        if (elseNode != null)
        {
            IContainerNode cnode = (IContainerNode) elseNode.getChild(0);
            // if an implicit if, add a newline with no space
            final boolean isImplicit = isImplicit(cnode);
            if (isImplicit)
                write("\n");
            else
View Full Code Here

    }

    @Override
    public void emitForEachLoop(IForLoopNode node)
    {
        IContainerNode xnode = (IContainerNode) node.getChild(1);
        write("for");
        write(" ");
        write("each");
        write(" ");
        write("(");

        IContainerNode cnode = node.getConditionalsContainerNode();
        getWalker().walk(cnode.getChild(0));

        write(")");
        if (!isImplicit(xnode))
            write(" ");
View Full Code Here

    }

    @Override
    public void emitForLoop(IForLoopNode node)
    {
        IContainerNode xnode = (IContainerNode) node.getChild(1);

        write("for");
        write(" ");
        write("(");

        IContainerNode cnode = node.getConditionalsContainerNode();
        final IASNode node0 = cnode.getChild(0);
        if (node0.getNodeID() == ASTNodeID.Op_InID)
        {
            getWalker().walk(cnode.getChild(0));
        }
        else
        {
            visitForBody(cnode);
        }
View Full Code Here

        ITerminalNode dnode = getDefaultNode(node);

        for (int i = 0; i < cnodes.length; i++)
        {
            IConditionalNode casen = cnodes[i];
            IContainerNode cnode = (IContainerNode) casen.getChild(1);
            write("case");
            write(" ");
            getWalker().walk(casen.getConditionalExpressionNode());
            write(":");
            if (!isImplicit(cnode))
                write(" ");
            getWalker().walk(casen.getStatementContentsNode());
            if (i == cnodes.length - 1 && dnode == null)
            {
                indentPop();
                write("\n");
            }
            else
                write("\n");
        }
        if (dnode != null)
        {
            IContainerNode cnode = (IContainerNode) dnode.getChild(0);
            write("default");
            write(":");
            if (!isImplicit(cnode))
                write(" ");
            getWalker().walk(dnode);
View Full Code Here

    }

    @Override
    public void emitWhileLoop(IWhileLoopNode node)
    {
        IContainerNode cnode = (IContainerNode) node.getChild(1);
        write("while");
        write(" ");
        write("(");
        getWalker().walk(node.getConditionalExpressionNode());
        write(")");
View Full Code Here

    }

    @Override
    public void emitDoLoop(IWhileLoopNode node)
    {
        IContainerNode cnode = (IContainerNode) node.getChild(0);
        write("do");
        if (!isImplicit(cnode))
            write(" ");
        getWalker().walk(node.getStatementContentsNode());
        if (!isImplicit(cnode))
View Full Code Here

    }

    @Override
    public void emitWith(IWithNode node)
    {
        IContainerNode cnode = (IContainerNode) node.getChild(1);
        write("with");
        write(" ");
        write("(");
        getWalker().walk(node.getTargetNode());
        write(")");
View Full Code Here

TOP

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

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.