use of com.github.javaparser.ast.stmt.WhileStmt in project drools by kiegroup.
the class WhileStmtT method toJavaExpression.
@Override
public Node toJavaExpression() {
WhileStmt stmt = new WhileStmt();
stmt.setCondition((Expression) condition.toJavaExpression());
stmt.setBody((Statement) body.toJavaExpression());
return stmt;
}
use of com.github.javaparser.ast.stmt.WhileStmt in project checker-framework by typetools.
the class JointJavacJavaParserVisitor method visitWhileLoop.
@Override
public Void visitWhileLoop(WhileLoopTree javacTree, Node javaParserNode) {
WhileStmt node = castNode(WhileStmt.class, javaParserNode, javacTree);
processWhileLoop(javacTree, node);
// While loop conditions are always parenthesized in javac but never in JavaParser.
assert javacTree.getCondition().getKind() == Tree.Kind.PARENTHESIZED;
ExpressionTree condition = ((ParenthesizedTree) javacTree.getCondition()).getExpression();
condition.accept(this, node.getCondition());
javacTree.getStatement().accept(this, node.getBody());
return null;
}
use of com.github.javaparser.ast.stmt.WhileStmt in project checker-framework by typetools.
the class DoubleJavaParserVisitor method visit.
@Override
public void visit(final WhileStmt node1, final Node other) {
WhileStmt node2 = (WhileStmt) other;
defaultAction(node1, node2);
node1.getBody().accept(this, node2.getBody());
node1.getCondition().accept(this, node2.getCondition());
}
Aggregations