Example usage for org.eclipse.jdt.internal.compiler.ast WhileStatement WhileStatement

List of usage examples for org.eclipse.jdt.internal.compiler.ast WhileStatement WhileStatement

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast WhileStatement WhileStatement.

Prototype

public WhileStatement(Expression condition, Statement action, int s, int e) 

Source Link

Usage

From source file:lombok.eclipse.handlers.ast.EclipseASTMaker.java

License:Open Source License

@Override
public ASTNode visitWhile(final lombok.ast.While node, final Void p) {
    final WhileStatement whileStatement = new WhileStatement(build(node.getCondition(), Expression.class),
            build(node.getAction(), Statement.class), 0, 0);
    setGeneratedByAndCopyPos(whileStatement, source, posHintOf(node));
    return whileStatement;
}

From source file:org.eclipse.jdt.internal.compiler.parser.Parser.java

License:Open Source License

protected void consumeStatementWhile() {
    // WhileStatement ::= 'while' '(' Expression ')' Statement
    // WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf

    this.expressionLengthPtr--;
    Statement statement = (Statement) this.astStack[this.astPtr];
    this.astStack[this.astPtr] = new WhileStatement(this.expressionStack[this.expressionPtr--], statement,
            this.intStack[this.intPtr--], this.endStatementPosition);
}

From source file:org.nabucco.framework.mda.template.java.extract.statement.JavaAstStatementExtractorVisitor.java

License:Open Source License

@Override
public boolean visit(WhileStatement whileStatement, BlockScope scope) {

    Expression condition = copy(whileStatement.condition, scope);
    Statement action = copy(whileStatement.action, scope);

    WhileStatement statementCopy = new WhileStatement(condition, action, whileStatement.sourceStart,
            whileStatement.sourceEnd);//  www.j ava  2 s . co  m

    this.statement = statementCopy;

    return false;
}