Java 类jdk.nashorn.internal.ir.LabelNode 实例源码

项目:OLD-OpenJDK8    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label");
    labelNode.getLabel().accept(this);
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:nashorn-backport    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label");
    labelNode.getLabel().accept(this);
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:nashorn    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label");
    labelNode.getLabel().accept(this);
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:OpenJSharp    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:OpenJSharp    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:openjdk-jdk10    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:openjdk-jdk10    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:openjdk-jdk10    文件:Lower.java   
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
项目:openjdk9    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:openjdk9    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:openjdk9    文件:Lower.java   
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
项目:kaziranga    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:kaziranga    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:kaziranga    文件:Lower.java   
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
项目:lookaside_java-1.8.0-openjdk    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:lookaside_java-1.8.0-openjdk    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:lookaside_java-1.8.0-openjdk    文件:Lower.java   
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
项目:jdk8u_nashorn    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:jdk8u_nashorn    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:jdk8u_nashorn    文件:Lower.java   
private static JumpToInlinedFinally createJumpToInlinedFinally(final FunctionNode fn, final List<Block> inlinedFinallies, final Block finallyBlock) {
    final String labelName = fn.uniqueName(":finally");
    final long token = finallyBlock.getToken();
    final int finish = finallyBlock.getFinish();
    inlinedFinallies.add(new Block(token, finish, new LabelNode(finallyBlock.getFirstStatementLineNumber(),
            token, finish, labelName, finallyBlock)));
    return new JumpToInlinedFinally(labelName);
}
项目:infobip-open-jdk-8    文件:JSONWriter.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    enterDefault(labelNode);

    type("LabeledStatement");
    comma();

    property("label", labelNode.getLabelName());
    comma();

    property("body");
    labelNode.getBody().accept(this);

    return leave();
}
项目:infobip-open-jdk-8    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
项目:OLD-OpenJDK8    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
项目:nashorn-backport    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
项目:nashorn    文件:PrintVisitor.java   
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
项目:OpenJSharp    文件:Parser.java   
/**
 * 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));
}
项目:OpenJSharp    文件:Parser.java   
/**
 * BreakStatement :
 *      break Identifier? ; // [no LineTerminator here]
 *
 * See 12.8
 *
 */
private void breakStatement() {
    // Capture BREAK token.
    final int  breakLine  = line;
    final long breakToken = token;
    // BREAK 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;
    }

    //either an explicit label - then get its node or just a "break" - get first breakable
    //targetNode is what we are breaking out from.
    final String labelName = labelNode == null ? null : labelNode.getLabelName();
    final BreakableNode targetNode = lc.getBreakable(labelName);
    if (targetNode == null) {
        throw error(AbstractParser.message("illegal.break.stmt"), breakToken);
    }

    endOfLine();

    // Construct and add BREAK node.
    appendStatement(new BreakNode(breakLine, breakToken, finish, labelName));
}
项目:OpenJSharp    文件:Lower.java   
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}
项目:OpenJSharp    文件:CodeGenerator.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    labeledBlockBreakLiveLocals.push(lc.getUsedSlotCount());
    return true;
}
项目:openjdk-jdk10    文件:IRTranslator.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    curStat = new LabeledStatementTreeImpl(labelNode,
            translateBlock(labelNode.getBody()));
    return false;
}
项目:openjdk-jdk10    文件:LabeledStatementTreeImpl.java   
LabeledStatementTreeImpl(final LabelNode node, final StatementTree stat) {
    super(node);
    this.name = node.getLabelName();
    this.stat = stat;
}
项目:openjdk-jdk10    文件:Lower.java   
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}
项目:openjdk-jdk10    文件:CodeGenerator.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    labeledBlockBreakLiveLocals.push(lc.getUsedSlotCount());
    return true;
}
项目:openjdk9    文件:IRTranslator.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    curStat = new LabeledStatementTreeImpl(labelNode,
            translateBlock(labelNode.getBody()));
    return false;
}
项目:openjdk9    文件:LabeledStatementTreeImpl.java   
LabeledStatementTreeImpl(final LabelNode node, final StatementTree stat) {
    super(node);
    this.name = node.getLabelName();
    this.stat = stat;
}
项目:openjdk9    文件:Lower.java   
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}
项目:openjdk9    文件:CodeGenerator.java   
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
    labeledBlockBreakLiveLocals.push(lc.getUsedSlotCount());
    return true;
}
项目:kaziranga    文件:Parser.java   
/**
 * 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));
}
项目:kaziranga    文件:Parser.java   
/**
 * BreakStatement :
 *      break Identifier? ; // [no LineTerminator here]
 *
 * See 12.8
 *
 */
private void breakStatement() {
    // Capture BREAK token.
    final int  breakLine  = line;
    final long breakToken = token;
    // BREAK 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;
    }

    //either an explicit label - then get its node or just a "break" - get first breakable
    //targetNode is what we are breaking out from.
    final String labelName = labelNode == null ? null : labelNode.getLabelName();
    final BreakableNode targetNode = lc.getBreakable(labelName);
    if (targetNode == null) {
        throw error(AbstractParser.message("illegal.break.stmt"), breakToken);
    }

    endOfLine();

    // Construct and add BREAK node.
    appendStatement(new BreakNode(breakLine, breakToken, finish, labelName));
}
项目:kaziranga    文件:Lower.java   
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}