本文整理汇总了Java中jdk.nashorn.internal.ir.LabelNode类的典型用法代码示例。如果您正苦于以下问题:Java LabelNode类的具体用法?Java LabelNode怎么用?Java LabelNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LabelNode类属于jdk.nashorn.internal.ir包,在下文中一共展示了LabelNode类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@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();
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:17,代码来源:JSONWriter.java
示例2: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@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();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:JSONWriter.java
示例3: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
indent -= TABWIDTH;
indent();
indent += TABWIDTH;
labeledNode.toString(sb, printTypes);
labeledNode.getBody().accept(this);
printLocalVariableConversion(labeledNode);
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:PrintVisitor.java
示例4: createJumpToInlinedFinally
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
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);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:Lower.java
示例5: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@Override
public boolean enterLabelNode(final LabelNode labeledNode) {
indent -= TABWIDTH;
indent();
indent += TABWIDTH;
labeledNode.toString(sb);
labeledNode.getBody().accept(this);
return false;
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:11,代码来源:PrintVisitor.java
示例6: continueStatement
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
/**
* 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));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:Parser.java
示例7: breakStatement
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
/**
* 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));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:49,代码来源:Parser.java
示例8: leaveLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@Override
public Node leaveLabelNode(final LabelNode labelNode) {
return addStatement(labelNode);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:Lower.java
示例9: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
labeledBlockBreakLiveLocals.push(lc.getUsedSlotCount());
return true;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:CodeGenerator.java
示例10: enterLabelNode
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
@Override
public boolean enterLabelNode(final LabelNode labelNode) {
curStat = new LabeledStatementTreeImpl(labelNode,
translateBlock(labelNode.getBody()));
return false;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:IRTranslator.java
示例11: LabeledStatementTreeImpl
import jdk.nashorn.internal.ir.LabelNode; //导入依赖的package包/类
LabeledStatementTreeImpl(final LabelNode node, final StatementTree stat) {
super(node);
this.name = node.getLabelName();
this.stat = stat;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:LabeledStatementTreeImpl.java
注:本文中的jdk.nashorn.internal.ir.LabelNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论