use of org.mozilla.javascript.ast.WhileLoop in project st-js by st-js.
the class RhinoJavaScriptBuilder method whileLoop.
/**
* {@inheritDoc}
*/
@Override
public AstNode whileLoop(AstNode condition, AstNode body) {
WhileLoop w = new WhileLoop();
w.setCondition(condition);
w.setBody(body);
return w;
}
use of org.mozilla.javascript.ast.WhileLoop in project HL4A by HL4A.
the class Parser method whileLoop.
private WhileLoop whileLoop() throws IOException {
if (currentToken != Token.WHILE)
codeBug();
consumeToken();
int pos = ts.tokenBeg;
WhileLoop pn = new WhileLoop(pos);
pn.setLineno(ts.lineno);
enterLoop(pn);
try {
ConditionData data = condition();
pn.setCondition(data.condition);
pn.setParens(data.lp - pos, data.rp - pos);
AstNode body = statement();
pn.setLength(getNodeEnd(body) - pos);
pn.setBody(body);
} finally {
exitLoop();
}
return pn;
}