Search in sources :

Example 1 with DoStmt

use of com.github.javaparser.ast.stmt.DoStmt in project drools by kiegroup.

the class DoStmtT method toJavaExpression.

@Override
public Node toJavaExpression() {
    DoStmt stmt = new DoStmt();
    stmt.setCondition((Expression) condition.toJavaExpression());
    stmt.setBody((Statement) body.toJavaExpression());
    return stmt;
}
Also used : DoStmt(com.github.javaparser.ast.stmt.DoStmt)

Example 2 with DoStmt

use of com.github.javaparser.ast.stmt.DoStmt in project checker-framework by typetools.

the class JointJavacJavaParserVisitor method visitDoWhileLoop.

@Override
public Void visitDoWhileLoop(DoWhileLoopTree javacTree, Node javaParserNode) {
    DoStmt node = castNode(DoStmt.class, javaParserNode, javacTree);
    processDoWhileLoop(javacTree, node);
    // In javac the condition is parenthesized but not in JavaParser.
    ExpressionTree condition = ((ParenthesizedTree) javacTree.getCondition()).getExpression();
    condition.accept(this, node.getCondition());
    javacTree.getStatement().accept(this, node.getBody());
    return null;
}
Also used : ParenthesizedTree(com.sun.source.tree.ParenthesizedTree) LambdaExpressionTree(com.sun.source.tree.LambdaExpressionTree) ConditionalExpressionTree(com.sun.source.tree.ConditionalExpressionTree) ExpressionTree(com.sun.source.tree.ExpressionTree) DoStmt(com.github.javaparser.ast.stmt.DoStmt)

Example 3 with DoStmt

use of com.github.javaparser.ast.stmt.DoStmt in project checker-framework by typetools.

the class DoubleJavaParserVisitor method visit.

@Override
public void visit(final DoStmt node1, final Node other) {
    DoStmt node2 = (DoStmt) other;
    defaultAction(node1, node2);
    node1.getBody().accept(this, node2.getBody());
    node1.getCondition().accept(this, node2.getCondition());
}
Also used : DoStmt(com.github.javaparser.ast.stmt.DoStmt)

Aggregations

DoStmt (com.github.javaparser.ast.stmt.DoStmt)3 ConditionalExpressionTree (com.sun.source.tree.ConditionalExpressionTree)1 ExpressionTree (com.sun.source.tree.ExpressionTree)1 LambdaExpressionTree (com.sun.source.tree.LambdaExpressionTree)1 ParenthesizedTree (com.sun.source.tree.ParenthesizedTree)1