本文整理了Java中org.mozilla.javascript.ast.WhileLoop.getBody()
方法的一些代码示例,展示了WhileLoop.getBody()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhileLoop.getBody()
方法的具体详情如下:
包路径:org.mozilla.javascript.ast.WhileLoop
类名称:WhileLoop
方法名:getBody
暂无
代码示例来源:origin: konsoletyper/teavm
private void print(WhileLoop node) throws IOException {
writer.append("while").ws().append('(');
print(node.getCondition());
writer.append(')').ws();
print(node.getBody());
}
代码示例来源:origin: com.fifesoft/languagesupport
/**
* Extract while loop from node and add new code block
*/
private void processWhileNode(Node child, CodeBlock block,
Set<Completion> set, String entered, int offset) {
WhileLoop loop = (WhileLoop) child;
if (canProcessNode(loop)) {
offset = loop.getAbsolutePosition() + loop.getLength();
addCodeBlock(loop.getBody(), set, entered, block, offset);
}
}
代码示例来源:origin: org.teavm/teavm-jso-impl
private void print(WhileLoop node) throws IOException {
writer.append("while").ws().append('(');
print(node.getCondition());
writer.append(')').ws();
print(node.getBody());
}
代码示例来源:origin: wala/WALA
@Override
public CAstNode visitWhileLoop(WhileLoop node, WalkContext arg) {
AstNode breakStmt = makeEmptyLabelStmt("breakLabel");
CAstNode breakLabel = visit(breakStmt, arg);
AstNode contStmt = makeEmptyLabelStmt("contLabel");
CAstNode contLabel = visit(contStmt, arg);
WalkContext loopContext = makeLoopContext(node, arg, breakStmt, contStmt);
CAstNode loop = Ast.makeNode(CAstNode.BLOCK_STMT,
contLabel,
Ast.makeNode(CAstNode.LOOP,
visit(node.getCondition(), arg),
visit(node.getBody(), loopContext)),
breakLabel);
arg.cfg().map(node, loop);
return loop;
}
代码示例来源:origin: io.apigee/rhino
private Node transformWhileLoop(WhileLoop loop) {
decompiler.addToken(Token.WHILE);
loop.setType(Token.LOOP);
pushScope(loop);
try {
decompiler.addToken(Token.LP);
Node cond = transform(loop.getCondition());
decompiler.addToken(Token.RP);
decompiler.addEOL(Token.LC);
Node body = transform(loop.getBody());
decompiler.addEOL(Token.RC);
return createLoop(loop, LOOP_WHILE, body, cond, null, null);
} finally {
popScope();
}
}
代码示例来源:origin: com.github.tntim96/rhino
private Node transformWhileLoop(WhileLoop loop) {
decompiler.addToken(Token.WHILE);
loop.setType(Token.LOOP);
pushScope(loop);
try {
decompiler.addToken(Token.LP);
Node cond = transform(loop.getCondition());
decompiler.addToken(Token.RP);
decompiler.addEOL(Token.LC);
Node body = transform(loop.getBody());
decompiler.addEOL(Token.RC);
return createLoop(loop, LOOP_WHILE, body, cond, null, null);
} finally {
popScope();
}
}
代码示例来源:origin: geogebra/geogebra
private Node transformWhileLoop(WhileLoop loop) {
decompiler.addToken(Token.WHILE);
loop.setType(Token.LOOP);
pushScope(loop);
try {
decompiler.addToken(Token.LP);
Node cond = transform(loop.getCondition());
decompiler.addToken(Token.RP);
decompiler.addEOL(Token.LC);
Node body = transform(loop.getBody());
decompiler.addEOL(Token.RC);
return createLoop(loop, LOOP_WHILE, body, cond, null, null);
} finally {
popScope();
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private Node transformWhileLoop(WhileLoop loop) {
decompiler.addToken(Token.WHILE);
loop.setType(Token.LOOP);
pushScope(loop);
try {
decompiler.addToken(Token.LP);
Node cond = transform(loop.getCondition());
decompiler.addToken(Token.RP);
decompiler.addEOL(Token.LC);
Node body = transform(loop.getBody());
decompiler.addEOL(Token.RC);
return createLoop(loop, LOOP_WHILE, body, cond, null, null);
} finally {
popScope();
}
}
内容来源于网络,如有侵权,请联系作者删除!