本文整理汇总了Java中jdk.nashorn.internal.codegen.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于jdk.nashorn.internal.codegen包,在下文中一共展示了Label类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Block
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
/**
* Constructor
*
* @param token token
* @param finish finish
* @param statements statements
*/
public Block(final long token, final int finish, final Statement... statements) {
super(token, finish);
this.statements = Arrays.asList(statements);
this.symbols = new LinkedHashMap<>();
this.entryLabel = new Label("block_entry");
this.breakLabel = new Label("block_break");
final int len = statements.length;
this.flags = len > 0 && statements[len - 1].hasTerminalFlags() ? IS_TERMINAL : 0;
this.conversion = null;
}
示例2: CaseNode
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
/**
* Constructors
*
* @param token token
* @param finish finish
* @param test case test node, can be any node in JavaScript
* @param body case body
*/
public CaseNode(final long token, final int finish, final Expression test, final Block body) {
super(token, finish);
this.test = test;
this.body = body;
this.entry = new Label("entry");
this.conversion = null;
}
示例3: Block
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
/**
* Constructor
*
* @param token The first token of the block
* @param finish The index of the last character
* @param flags The flags of the block
* @param statements All statements in the block
*/
public Block(final long token, final int finish, final int flags, final Statement... statements) {
super(token, finish);
this.statements = Arrays.asList(statements);
this.symbols = new LinkedHashMap<>();
this.entryLabel = new Label("block_entry");
this.breakLabel = new Label("block_break");
final int len = statements.length;
final int terminalFlags = len > 0 && statements[len - 1].hasTerminalFlags() ? IS_TERMINAL : 0;
this.flags = terminalFlags | flags;
this.conversion = null;
}
示例4: getBreakLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public Label getBreakLabel() {
return breakLabel;
}
示例5: getLabels
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public List<Label> getLabels() {
return Collections.unmodifiableList(Arrays.asList(entryLabel, breakLabel));
}
示例6: getBreakLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
/**
* Return the break label, i.e. the location to go to on break.
* @return the break label
*/
@Override
public Label getBreakLabel() {
return breakLabel;
}
示例7: getLabels
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public List<Label> getLabels() {
return Collections.unmodifiableList(Arrays.asList(breakLabel, continueLabel));
}
示例8: getTargetLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public Label getTargetLabel(final BreakableNode target) {
return target.getBreakLabel();
}
示例9: getTargetLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public Label getTargetLabel(final BreakableNode target) {
return ((LoopNode)target).getContinueLabel();
}
示例10: getLabels
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
public List<Label> getLabels() {
return Collections.unmodifiableList(Collections.singletonList(entry));
}
示例11: getTargetLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
Label getTargetLabel(final BreakableNode target) {
return target.getBreakLabel();
}
示例12: getTargetLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
Label getTargetLabel(final BreakableNode target) {
return ((LoopNode)target).getContinueLabel();
}
示例13: getTargetLabel
import jdk.nashorn.internal.codegen.Label; //导入依赖的package包/类
@Override
Label getTargetLabel(final BreakableNode target) {
assert target != null;
// We're jumping to the entry of the inlined finally block
return ((Block)target).getEntryLabel();
}