@Override public RecoveredElement addAnnotationName(int identPtr, int identLengthPtr, int annotationStart, int bracketBalanceValue) { RecoveredAnnotation element = new RecoveredAnnotation(identPtr, identLengthPtr, annotationStart, this, bracketBalanceValue); return element; }
@Override public int sourceEnd() { if (this.annotation == null) { Parser parser = parser(); if (this.identifierPtr < parser.identifierPositionStack.length) { return (int) parser.identifierPositionStack[this.identifierPtr]; } else { return this.sourceStart; } } return this.annotation.declarationSourceEnd; }
protected void consumeSingleMemberAnnotationMemberValue() { // this rule is used for syntax recovery only if (this.currentElement != null && this.currentElement instanceof RecoveredAnnotation) { RecoveredAnnotation recoveredAnnotation = (RecoveredAnnotation) this.currentElement; recoveredAnnotation.setKind(RecoveredAnnotation.SINGLE_MEMBER); } } protected void consumeSingleResource() {
public void updateFromParserState() { Parser parser = parser(); parser.currentElement = addAnnotation(annot, this.identifierPtr); parser.annotationRecoveryCheckPoint(annot.sourceStart, annot.declarationSourceEnd); if (this.parent != null) {
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered initializer:\n"); //$NON-NLS-1$ this.fieldDeclaration.print(tab + 1, result); if (this.annotations != null) { for (int i = 0; i < this.annotationCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.annotations[i].toString(tab + 1)); } } if (this.initializerBody != null) { result.append("\n"); //$NON-NLS-1$ result.append(this.initializerBody.toString(tab + 1)); } return result.toString(); } public FieldDeclaration updatedFieldDeclaration(int depth, Set<TypeDeclaration> knownTypes){
protected void consumeMarkerAnnotation() { // MarkerAnnotation ::= '@' Name MarkerAnnotation markerAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); markerAnnotation = new MarkerAnnotation(typeReference, this.intStack[this.intPtr--]); markerAnnotation.declarationSourceEnd = markerAnnotation.sourceEnd; pushOnExpressionStack(markerAnnotation); if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(markerAnnotation); } this.recordStringLiterals = true; if (this.currentElement != null && this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(markerAnnotation, oldIndex); } } protected void consumeMemberValueArrayInitializer() {
@Override public void updateParseTree() { updatedAnnotationReference(); } }
@Override public String toString(int tab) { if (this.annotation != null) { return tabString(tab) + "Recovered annotation:\n" + this.annotation.print(tab + 1, new StringBuffer(10)); //$NON-NLS-1$ } else { return tabString(tab) + "Recovered annotation: identiferPtr=" + this.identifierPtr + " identiferlengthPtr=" + this.identifierLengthPtr + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
public void updateFromParserState() { Parser parser = parser(); parser.currentElement = addAnnotation(annot, this.identifierPtr); parser.annotationRecoveryCheckPoint(annot.sourceStart, annot.declarationSourceEnd); if (this.parent != null) {
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered initializer:\n"); //$NON-NLS-1$ this.fieldDeclaration.print(tab + 1, result); if (this.annotations != null) { for (int i = 0; i < this.annotationCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.annotations[i].toString(tab + 1)); } } if (this.initializerBody != null) { result.append("\n"); //$NON-NLS-1$ result.append(this.initializerBody.toString(tab + 1)); } return result.toString(); } public FieldDeclaration updatedFieldDeclaration(int depth, Set knownTypes){
protected void consumeMarkerAnnotation() { // MarkerAnnotation ::= '@' Name MarkerAnnotation markerAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); markerAnnotation = new MarkerAnnotation(typeReference, this.intStack[this.intPtr--]); markerAnnotation.declarationSourceEnd = markerAnnotation.sourceEnd; pushOnExpressionStack(markerAnnotation); if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(markerAnnotation); } this.recordStringLiterals = true; if (this.currentElement != null && this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(markerAnnotation, oldIndex); } } protected void consumeMemberValueArrayInitializer() {
public void updateParseTree() { updatedAnnotationReference(); } }
public String toString(int tab) { if (this.annotation != null) { return tabString(tab) + "Recovered annotation:\n" + this.annotation.print(tab + 1, new StringBuffer(10)); //$NON-NLS-1$ } else { return tabString(tab) + "Recovered annotation: identiferPtr=" + this.identifierPtr + " identiferlengthPtr=" + this.identifierLengthPtr + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
public void updateFromParserState() { Parser parser = parser(); parser.currentElement = addAnnotation(annot, this.identifierPtr); parser.annotationRecoveryCheckPoint(annot.sourceStart, annot.declarationSourceEnd); if (this.parent != null) {
protected void consumeSingleMemberAnnotationMemberValue() { // this rule is used for syntax recovery only if (this.currentElement != null && this.currentElement instanceof RecoveredAnnotation) { RecoveredAnnotation recoveredAnnotation = (RecoveredAnnotation) this.currentElement; recoveredAnnotation.setKind(RecoveredAnnotation.SINGLE_MEMBER); } } protected void consumeSingleResource() {
public RecoveredElement addAnnotationName(int identPtr, int identLengthPtr, int annotationStart, int bracketBalanceValue) { RecoveredAnnotation element = new RecoveredAnnotation(identPtr, identLengthPtr, annotationStart, this, bracketBalanceValue); return element; }
public String toString(int tab) { StringBuffer result = new StringBuffer(tabString(tab)); result.append("Recovered initializer:\n"); //$NON-NLS-1$ this.fieldDeclaration.print(tab + 1, result); if (this.annotations != null) { for (int i = 0; i < this.annotationCount; i++) { result.append("\n"); //$NON-NLS-1$ result.append(this.annotations[i].toString(tab + 1)); } } if (this.initializerBody != null) { result.append("\n"); //$NON-NLS-1$ result.append(this.initializerBody.toString(tab + 1)); } return result.toString(); } public FieldDeclaration updatedFieldDeclaration(int depth, Set knownTypes){
protected void consumeMarkerAnnotation() { // MarkerAnnotation ::= '@' Name MarkerAnnotation markerAnnotation = null; int oldIndex = this.identifierPtr; TypeReference typeReference = getAnnotationType(); markerAnnotation = new MarkerAnnotation(typeReference, this.intStack[this.intPtr--]); markerAnnotation.declarationSourceEnd = markerAnnotation.sourceEnd; pushOnExpressionStack(markerAnnotation); if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { problemReporter().invalidUsageOfAnnotation(markerAnnotation); } this.recordStringLiterals = true; if (this.currentElement != null && this.currentElement instanceof RecoveredAnnotation) { this.currentElement = ((RecoveredAnnotation)this.currentElement).addAnnotation(markerAnnotation, oldIndex); } } protected void consumeMemberValueArrayInitializer() {
public void updateParseTree() { updatedAnnotationReference(); } }
public int sourceEnd() { if (this.annotation == null) { Parser parser = parser(); if (this.identifierPtr < parser.identifierPositionStack.length) { return (int) parser.identifierPositionStack[this.identifierPtr]; } else { return this.sourceStart; } } return this.annotation.declarationSourceEnd; }