Example usage for org.eclipse.jdt.core.dom WhileStatement WhileStatement

List of usage examples for org.eclipse.jdt.core.dom WhileStatement WhileStatement

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom WhileStatement WhileStatement.

Prototype

WhileStatement(AST ast) 

Source Link

Document

Creates a new unparented while statement node owned by the given AST.

Usage

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public WhileStatement convert(org.eclipse.jdt.internal.compiler.ast.WhileStatement statement) {
    final WhileStatement whileStatement = new WhileStatement(this.ast);
    whileStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
    whileStatement.setExpression(convert(statement.condition));
    final Statement action = convert(statement.action);
    if (action == null)
        return null;
    whileStatement.setBody(action);//from   ww w.jav a  2s . c om
    return whileStatement;
}