jdk.nashorn.internal.ir.LabelNode Java Examples

The following examples show how to use jdk.nashorn.internal.ir.LabelNode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JSONWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@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();
}
 
Example #2
Source File: JSONWriter.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
@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();
}
 
Example #3
Source File: JSONWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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();
}
 
Example #4
Source File: Lower.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: Lower.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #6
Source File: PrintVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #7
Source File: PrintVisitor.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #8
Source File: JSONWriter.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #9
Source File: JSONWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #10
Source File: PrintVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #11
Source File: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #12
Source File: PrintVisitor.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
 
Example #13
Source File: PrintVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #14
Source File: JSONWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #15
Source File: JSONWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #16
Source File: Lower.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #17
Source File: Lower.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #18
Source File: PrintVisitor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #19
Source File: JSONWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #20
Source File: PrintVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #21
Source File: JSONWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #22
Source File: PrintVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
 
Example #23
Source File: Lower.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #24
Source File: JSONWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example #25
Source File: PrintVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb, printTypes);
    labeledNode.getBody().accept(this);
    printLocalVariableConversion(labeledNode);
    return false;
}
 
Example #26
Source File: Lower.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #27
Source File: PrintVisitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
    indent -= TABWIDTH;
    indent();
    indent += TABWIDTH;
    labeledNode.toString(sb);
    labeledNode.getBody().accept(this);

    return false;
}
 
Example #28
Source File: Lower.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}
 
Example #29
Source File: Lower.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
    return addStatement(labelNode);
}
 
Example #30
Source File: Parser.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 IdentNode label = labelNode == null ? null : labelNode.getLabel();
    final LoopNode targetNode = lc.getContinueTo(label);

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

    endOfLine();

    // Construct and add CONTINUE node.
    appendStatement(new ContinueNode(continueLine, continueToken, finish, label == null ? null : new IdentNode(label)));
}