jdk.nashorn.internal.ir.BreakableNode Java Examples
The following examples show how to use
jdk.nashorn.internal.ir.BreakableNode.
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: CodeGenerator.java From nashorn with GNU General Public License v2.0 | 5 votes |
@Override public boolean enterBreakNode(final BreakNode breakNode) { lineNumber(breakNode); final BreakableNode breakFrom = lc.getBreakable(breakNode.getLabel()); for (int i = 0; i < lc.getScopeNestingLevelTo(breakFrom); i++) { closeWith(); } method.splitAwareGoto(lc, breakFrom.getBreakLabel()); return false; }
Example #2
Source File: CodeGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Override public boolean enterBreakNode(final BreakNode breakNode) { lineNumber(breakNode); final BreakableNode breakFrom = lc.getBreakable(breakNode.getLabel()); for (int i = 0; i < lc.getScopeNestingLevelTo(breakFrom); i++) { closeWith(); } method.splitAwareGoto(lc, breakFrom.getBreakLabel()); return false; }
Example #3
Source File: CodeGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override public boolean enterBreakNode(final BreakNode breakNode) { lineNumber(breakNode); final BreakableNode breakFrom = lc.getBreakable(breakNode.getLabel()); for (int i = 0; i < lc.getScopeNestingLevelTo(breakFrom); i++) { closeWith(); } method.splitAwareGoto(lc, breakFrom.getBreakLabel()); return false; }
Example #4
Source File: Parser.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #5
Source File: Parser.java From nashorn with GNU General Public License v2.0 | 4 votes |
/** * 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 IdentNode label = labelNode == null ? null : labelNode.getLabel(); final BreakableNode targetNode = lc.getBreakable(label); if (targetNode == null) { throw error(AbstractParser.message("illegal.break.stmt"), breakToken); } endOfLine(); // Construct and add BREAK node. appendStatement(new BreakNode(breakLine, breakToken, finish, label == null ? null : new IdentNode(label))); }
Example #6
Source File: Parser.java From jdk8u_nashorn with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #7
Source File: Parser.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * 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 IdentNode label = labelNode == null ? null : labelNode.getLabel(); final BreakableNode targetNode = lc.getBreakable(label); if (targetNode == null) { throw error(AbstractParser.message("illegal.break.stmt"), breakToken); } endOfLine(); // Construct and add BREAK node. appendStatement(new BreakNode(breakLine, breakToken, finish, label == null ? null : new IdentNode(label))); }
Example #8
Source File: Parser.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * 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 IdentNode label = labelNode == null ? null : labelNode.getLabel(); final BreakableNode targetNode = lc.getBreakable(label); if (targetNode == null) { throw error(AbstractParser.message("illegal.break.stmt"), breakToken); } endOfLine(); // Construct and add BREAK node. appendStatement(new BreakNode(breakLine, breakToken, finish, label == null ? null : new IdentNode(label))); }
Example #9
Source File: Parser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #10
Source File: Parser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #11
Source File: Parser.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #12
Source File: Parser.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * 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)); }
Example #13
Source File: LocalVariableTypesCalculator.java From openjdk-jdk9 with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #14
Source File: LocalVariableTypesCalculator.java From hottub with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #15
Source File: LocalVariableTypesCalculator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #16
Source File: LocalVariableTypesCalculator.java From openjdk-jdk8u with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #17
Source File: LocalVariableTypesCalculator.java From jdk8u60 with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #18
Source File: LocalVariableTypesCalculator.java From jdk8u_nashorn with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }
Example #19
Source File: LocalVariableTypesCalculator.java From TencentKona-8 with GNU General Public License v2.0 | 2 votes |
/** * Leave a breakable node. If there's a join point associated with its break label (meaning there was at least one * break statement to the end of the node), insert the join point into the flow. * @param breakable the breakable node being left. */ private void leaveBreakable(final BreakableNode breakable) { joinOnLabel(breakable.getBreakLabel()); assertTypeStackIsEmpty(); }