Java源码示例:jdk.nashorn.internal.ir.ContinueNode

示例1
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例2
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例3
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例4
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例5
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例6
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例7
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final IdentNode label = continueNode.getLabel();
    property("label");
    if (label != null) {
        label.accept(this);
    } else {
        nullValue();
    }

    return leave();
}
 
示例8
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final IdentNode label = continueNode.getLabel();
    property("label");
    if (label != null) {
        label.accept(this);
    } else {
        nullValue();
    }

    return leave();
}
 
示例9
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    enterDefault(continueNode);

    type("ContinueStatement");
    comma();

    final String label = continueNode.getLabelName();
    if(label != null) {
        property("label", label);
    } else {
        property("label");
        nullValue();
    }

    return leave();
}
 
示例10
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    lineNumber(continueNode);

    final LoopNode continueTo = lc.getContinueTo(continueNode.getLabel());
    for (int i = 0; i < lc.getScopeNestingLevelTo(continueTo); i++) {
        closeWith();
    }
    method.splitAwareGoto(lc, continueTo.getContinueLabel());

    return false;
}
 
示例11
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    lineNumber(continueNode);

    final LoopNode continueTo = lc.getContinueTo(continueNode.getLabel());
    for (int i = 0; i < lc.getScopeNestingLevelTo(continueTo); i++) {
        closeWith();
    }
    method.splitAwareGoto(lc, continueTo.getContinueLabel());

    return false;
}
 
示例12
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    lineNumber(continueNode);

    final LoopNode continueTo = lc.getContinueTo(continueNode.getLabel());
    for (int i = 0; i < lc.getScopeNestingLevelTo(continueTo); i++) {
        closeWith();
    }
    method.splitAwareGoto(lc, continueTo.getContinueLabel());

    return false;
}
 
示例13
/**
 * ContinueStatement :
 *      continue Identifier? ; // [no LineTerminator here]
 *
 * See 12.7
 *
 * Parse CONTINUE statement.
 */
private void continueStatement() {
    // Capture CONTINUE token.
    final int  continueLine  = line;
    final long continueToken = token;
    // CONTINUE tested in caller.
    nextOrEOL();

    LabelNode labelNode = null;

    // SEMICOLON or label.
    switch (type) {
    case RBRACE:
    case SEMICOLON:
    case EOL:
    case EOF:
        break;

    default:
        final IdentNode ident = getIdent();
        labelNode = lc.findLabel(ident.getName());

        if (labelNode == null) {
            throw error(AbstractParser.message("undefined.label", ident.getName()), ident.getToken());
        }

        break;
    }

    final String labelName = labelNode == null ? null : labelNode.getLabelName();
    final LoopNode targetNode = lc.getContinueTo(labelName);

    if (targetNode == null) {
        throw error(AbstractParser.message("illegal.continue.stmt"), continueToken);
    }

    endOfLine();

    // Construct and add CONTINUE node.
    appendStatement(new ContinueNode(continueLine, continueToken, finish, labelName));
}
 
示例14
@Override
public boolean enterContinueNode(final ContinueNode node) {
    node.toString(sb, printTypes);
    printLocalVariableConversion(node);
    return false;
}
 
示例15
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    addStatement(continueNode);
    return false;
}
 
示例16
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    addStatement(continueNode);
    return false;
}
 
示例17
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
    return leaveJumpNode(continueNode);
}
 
示例18
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    return enterJumpStatement(continueNode);
}
 
示例19
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
    weight += CONTINUE_WEIGHT;
    return continueNode;
}
 
示例20
/**
 * ContinueStatement :
 *      continue Identifier? ; // [no LineTerminator here]
 *
 * See 12.7
 *
 * Parse CONTINUE statement.
 */
private void continueStatement() {
    // Capture CONTINUE token.
    final int  continueLine  = line;
    final long continueToken = token;
    // CONTINUE tested in caller.
    nextOrEOL();

    LabelNode labelNode = null;

    // SEMICOLON or label.
    switch (type) {
    case RBRACE:
    case SEMICOLON:
    case EOL:
    case EOF:
        break;

    default:
        final IdentNode ident = getIdent();
        labelNode = lc.findLabel(ident.getName());

        if (labelNode == null) {
            throw error(AbstractParser.message("undefined.label", ident.getName()), ident.getToken());
        }

        break;
    }

    final String labelName = labelNode == null ? null : labelNode.getLabelName();
    final LoopNode targetNode = lc.getContinueTo(labelName);

    if (targetNode == null) {
        throw error(AbstractParser.message("illegal.continue.stmt"), continueToken);
    }

    endOfLine();

    // Construct and add CONTINUE node.
    appendStatement(new ContinueNode(continueLine, continueToken, finish, labelName));
}
 
示例21
@Override
public boolean enterContinueNode(final ContinueNode node) {
    node.toString(sb, printTypes);
    printLocalVariableConversion(node);
    return false;
}
 
示例22
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    addStatement(continueNode);
    return false;
}
 
示例23
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
    return leaveJumpNode(continueNode);
}
 
示例24
/**
 * Constructor.
 */
Lower() {
    super(new BlockLexicalContext() {

        @Override
        public List<Statement> popStatements() {
            final List<Statement> newStatements = new ArrayList<>();
            boolean terminated = false;

            final List<Statement> statements = super.popStatements();
            for (final Statement statement : statements) {
                if (!terminated) {
                    newStatements.add(statement);
                    if (statement.isTerminal() || statement instanceof BreakNode || statement instanceof ContinueNode) { //TODO hasGoto? But some Loops are hasGoto too - why?
                        terminated = true;
                    }
                } else {
                    statement.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
                        @Override
                        public boolean enterVarNode(final VarNode varNode) {
                            newStatements.add(varNode.setInit(null));
                            return false;
                        }
                    });
                }
            }
            return newStatements;
        }

        @Override
        protected Block afterSetStatements(final Block block) {
            final List<Statement> stmts = block.getStatements();
            for(final ListIterator<Statement> li = stmts.listIterator(stmts.size()); li.hasPrevious();) {
                final Statement stmt = li.previous();
                // popStatements() guarantees that the only thing after a terminal statement are uninitialized
                // VarNodes. We skip past those, and set the terminal state of the block to the value of the
                // terminal state of the first statement that is not an uninitialized VarNode.
                if(!(stmt instanceof VarNode && ((VarNode)stmt).getInit() == null)) {
                    return block.setIsTerminal(this, stmt.isTerminal());
                }
            }
            return block.setIsTerminal(this, false);
        }
    });
}
 
示例25
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
    weight += CONTINUE_WEIGHT;
    return continueNode;
}
 
示例26
/**
 * ContinueStatement :
 *      continue Identifier? ; // [no LineTerminator here]
 *
 * See 12.7
 *
 * Parse CONTINUE statement.
 */
private void continueStatement() {
    // Capture CONTINUE token.
    final int  continueLine  = line;
    final long continueToken = token;
    // CONTINUE tested in caller.
    nextOrEOL();

    LabelNode labelNode = null;

    // SEMICOLON or label.
    switch (type) {
    case RBRACE:
    case SEMICOLON:
    case EOL:
    case EOF:
        break;

    default:
        final IdentNode ident = getIdent();
        labelNode = lc.findLabel(ident.getName());

        if (labelNode == null) {
            throw error(AbstractParser.message("undefined.label", ident.getName()), ident.getToken());
        }

        break;
    }

    final String labelName = labelNode == null ? null : labelNode.getLabelName();
    final LoopNode targetNode = lc.getContinueTo(labelName);

    if (targetNode == null) {
        throw error(AbstractParser.message("illegal.continue.stmt"), continueToken);
    }

    endOfLine();

    // Construct and add CONTINUE node.
    appendStatement(new ContinueNode(continueLine, continueToken, finish, labelName));
}
 
示例27
@Override
public boolean enterContinueNode(final ContinueNode node) {
    node.toString(sb, printTypes);
    printLocalVariableConversion(node);
    return false;
}
 
示例28
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
    weight += CONTINUE_WEIGHT;
    return continueNode;
}
 
示例29
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    addStatement(continueNode);
    return false;
}
 
示例30
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
    return enterJumpStatement(continueNode);
}