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

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

Introduction

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

Prototype

public ContinueStatement(char[] label, int sourceStart, int sourceEnd) 

Source Link

Usage

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

License:Open Source License

@Override
public ASTNode visitContinue(final lombok.ast.Continue node, final Void p) {
    final ContinueStatement continueStatement = new ContinueStatement(
            node.getLabel() == null ? null : node.getLabel().toCharArray(), 0, 0);
    setGeneratedByAndCopyPos(continueStatement, source, posHintOf(node));
    return continueStatement;
}

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

License:Open Source License

protected void consumeStatementContinue() {
    // ContinueStatement ::= 'continue' ';'
    // continue pushs a position on this.intStack in case there is no label

    pushOnAstStack(new ContinueStatement(null, this.intStack[this.intPtr--], this.endStatementPosition));
}

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

License:Open Source License

protected void consumeStatementContinueWithLabel() {
    // ContinueStatement ::= 'continue' Identifier ';'
    // continue pushs a position on this.intStack in case there is no label

    pushOnAstStack(new ContinueStatement(this.identifierStack[this.identifierPtr--],
            this.intStack[this.intPtr--], this.endStatementPosition));
    this.identifierLengthPtr--;
}

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.lifting.ArrayTranslations.java

License:Open Source License

/**
 * generate code for prevent null-pointer exceptions
 * if(r1 == null)return null;/*from w  w w  . j a  v  a 2 s.c  om*/
 * if(r1[i0][i1] == null)continue;
 * @param currentDimension
 * @param arrayDimensions
 * @return an if statement
 */
private IfStatement generateIfStatement(int currentDimension, int arrayDimensions) {

    SingleNameReference condLeft = new SingleNameReference(ROLE_ARRAY_ARG, 0);
    decapsulationInput(condLeft);

    Expression lastArrayReference = condLeft;

    for (int idx = 0; idx < currentDimension; idx++) {
        SingleNameReference pos = new SingleNameReference(generateArrayIndexName(idx), 0);
        ArrayReference nextArray = new ArrayReference(lastArrayReference, pos);
        lastArrayReference = nextArray;
    }

    Expression condRight = new NullLiteral(0, 0);
    Expression condition = new EqualExpression(lastArrayReference, condRight, OperatorIds.EQUAL_EQUAL);

    Statement thenStatement = null;
    if (currentDimension == 0) {
        thenStatement = new ReturnStatement(new NullLiteral(0, 0), 0, 0);
    } else {
        thenStatement = new ContinueStatement(null, 0, 0);
    }
    IfStatement ifStatement = new IfStatement(condition, thenStatement, 0, 0);
    return ifStatement;
}

From source file:org.nabucco.framework.mda.model.java.ast.produce.JavaAstModelProducer.java

License:Open Source License

/**
 * Create a <code>continue</b> statement.
 * //from   w w  w .  ja v  a 2 s  .  c o m
 * @return the break statement
 * 
 * @throws JavaModelException
 */
public ContinueStatement createContinueStatement() throws JavaModelException {
    return new ContinueStatement(null, 0, 0);
}

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

License:Open Source License

@Override
public boolean visit(ContinueStatement continueStatement, BlockScope scope) {

    ContinueStatement continueCopy = new ContinueStatement(continueStatement.label.clone(),
            continueStatement.sourceStart, continueStatement.sourceEnd);

    continueCopy.subroutines = copy(continueStatement.subroutines, scope);
    this.statement = continueCopy;

    return false;
}