Example usage for org.eclipse.jdt.internal.compiler.ast ASTNode IsArgument

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

Introduction

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

Prototype

int IsArgument

To view the source code for org.eclipse.jdt.internal.compiler.ast ASTNode IsArgument.

Click Source Link

Usage

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

License:Open Source License

protected void consumeCatchFormalParameter() {
    // CatchFormalParameter ::= Modifiersopt CatchType VariableDeclaratorId
    this.identifierLengthPtr--;
    char[] identifierName = this.identifierStack[this.identifierPtr];
    long namePositions = this.identifierPositionStack[this.identifierPtr--];
    int extendedDimensions = this.intStack[this.intPtr--]; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=348369
    TypeReference type = (TypeReference) this.astStack[this.astPtr--];
    if (extendedDimensions > 0) {
        type = type.copyDims(type.dimensions() + extendedDimensions);
        type.sourceEnd = this.endPosition;
    }//from w w w  . j a v  a  2s.c om
    this.astLengthPtr--;
    int modifierPositions = this.intStack[this.intPtr--];
    this.intPtr--;
    Argument arg = new Argument(identifierName, namePositions, type,
            this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
    arg.bits &= ~ASTNode.IsArgument;
    arg.declarationSourceStart = modifierPositions;
    // consume annotations
    int length;
    if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
        System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1,
                arg.annotations = new Annotation[length], 0, length);
    }
    pushOnAstStack(arg);
    /* if incomplete method header, this.listLength counter will not have been reset,
       indicating that some arguments are available on the stack */
    this.listLength++;
}