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

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


     * @param is_super Flag indicating whether the stem of the array index expression is <code>super</code>.
     * @return Instructions for executing the {@code for-in} statement.
     */
    public InstructionList reduce_forKeyValueArrayStmt(IASNode iNode, InstructionList stem, InstructionList index, InstructionList base, InstructionList body, int opcode, boolean is_super)
    {
        IContainerNode conditionalStatementsNode = ((IForLoopNode)iNode).getConditionalsContainerNode();
        IBinaryOperatorNode inNode = (IBinaryOperatorNode)SemanticUtils.getNthChild(conditionalStatementsNode, 0);
        IDynamicAccessNode arrayIndexNode = (IDynamicAccessNode)inNode.getLeftOperandNode();
       
        ForKeyValueLoopState fkv = new ForKeyValueLoopState();

View Full Code Here


                    // well, we are a local function without a name. So let's make up a name offset.
                    // so for something like: function():void
                    // we want the name offset to be the location right before the open parent of the
                    // parameter list.
                    // We will derive this offset by getting the "parameters" node and subtracting one
                    IContainerNode parametersNode = functionNode.getParametersContainerNode();

                    int synthesizedNameOffset = parametersNode.getStart();
                    if (synthesizedNameOffset > 0)
                        synthesizedNameOffset--;

                    this.setNameLocation(synthesizedNameOffset, synthesizedNameOffset);
                }
View Full Code Here

     *  Check a Vector literal.
     */
    public void checkVectorLiteral(IASNode iNode, Binding type_param)
    {
        IDefinition type_def = type_param.getDefinition();
        IContainerNode contentsNode = ((VectorLiteralNode)iNode).getContentsNode();
        if ( type_def != null )
        {
            boolean isNumericTypeOrBoolean = SemanticUtils.isNumericTypeOrBoolean(type_def, project);
            String typeName = type_def.getBaseName();
            boolean isInt = SemanticUtils.isBuiltin(type_def, BuiltinType.INT, project);
            boolean isUint = SemanticUtils.isBuiltin(type_def, BuiltinType.UINT, project);

            for ( int i = 0; i < contentsNode.getChildCount(); i++ )
            {
                IASNode literal_element = contentsNode.getChild(i);

                if (isNumericTypeOrBoolean)
                {
                    // check for loss of precision
                    if ( literal_element instanceof NumericLiteralNode )
View Full Code Here

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

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

        writeToken(ASEmitterTokens.IF);
        //write(SPACE);
        write(ASEmitterTokens.PAREN_OPEN);
        getWalker().walk(conditional.getChild(0)); // conditional expression
        write(ASEmitterTokens.PAREN_CLOSE);
        if (!isImplicit(xnode))
            write(ASEmitterTokens.SPACE);

        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)
                    writeNewline();
                else
                    write(ASEmitterTokens.SPACE);

                writeToken(ASEmitterTokens.ELSE);
                writeToken(ASEmitterTokens.IF);
                write(ASEmitterTokens.PAREN_OPEN);
                getWalker().walk(enode.getChild(0));
                write(ASEmitterTokens.PAREN_CLOSE);
                if (!isImplicit)
                    write(ASEmitterTokens.SPACE);

                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)
                writeNewline();
            else
View Full Code Here

    }

    @Override
    public void emitForEachLoop(IForLoopNode node)
    {
        IContainerNode xnode = (IContainerNode) node.getChild(1);
        writeToken(ASEmitterTokens.FOR);
        writeToken(ASEmitterTokens.EACH);
        write(ASEmitterTokens.PAREN_OPEN);

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

        write(ASEmitterTokens.PAREN_CLOSE);
        if (!isImplicit(xnode))
            write(ASEmitterTokens.SPACE);
View Full Code Here

    }

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

        writeToken(ASEmitterTokens.FOR);
        write(ASEmitterTokens.PAREN_OPEN);

        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 = ASNodeUtils.getDefaultNode(node);

        for (int i = 0; i < cnodes.length; i++)
        {
            IConditionalNode casen = cnodes[i];
            IContainerNode cnode = (IContainerNode) casen.getChild(1);
            writeToken(ASEmitterTokens.CASE);
            getWalker().walk(casen.getConditionalExpressionNode());
            write(ASEmitterTokens.COLON);
            if (!isImplicit(cnode))
                write(ASEmitterTokens.SPACE);
            getWalker().walk(casen.getStatementContentsNode());
            if (i == cnodes.length - 1 && dnode == null)
            {
                indentPop();
                writeNewline();
            }
            else
                writeNewline();
        }
        if (dnode != null)
        {
            IContainerNode cnode = (IContainerNode) dnode.getChild(0);
            write(ASEmitterTokens.DEFAULT);
            write(ASEmitterTokens.COLON);
            if (!isImplicit(cnode))
                write(ASEmitterTokens.SPACE);
            getWalker().walk(dnode);
View Full Code Here

    }

    @Override
    public void emitWhileLoop(IWhileLoopNode node)
    {
        IContainerNode cnode = (IContainerNode) node.getChild(1);
        writeToken(ASEmitterTokens.WHILE);
        write(ASEmitterTokens.PAREN_OPEN);
        getWalker().walk(node.getConditionalExpressionNode());
        write(ASEmitterTokens.PAREN_CLOSE);
        if (!isImplicit(cnode))
View Full Code Here

    }

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

    }

    @Override
    public void emitWith(IWithNode node)
    {
        IContainerNode cnode = (IContainerNode) node.getChild(1);
        writeToken(ASEmitterTokens.WITH);
        write(ASEmitterTokens.PAREN_OPEN);
        getWalker().walk(node.getTargetNode());
        write(ASEmitterTokens.PAREN_CLOSE);
        if (!isImplicit(cnode))
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.