protected void ignoreExpressionAssignment() { // Assignment ::= InvalidArrayInitializerAssignement // encoded operator would be: this.intStack[this.intPtr] this.intPtr--; ArrayInitializer arrayInitializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr -- ; // report a syntax error and abort parsing if(!this.statementRecoveryActivated) problemReporter().arrayConstantsOnlyInArrayInitializers(arrayInitializer.sourceStart, arrayInitializer.sourceEnd); } public void initialize() {
protected void refreshInlineTagPosition(int previousPosition) { // Signal tag missing description if necessary if (this.tagWaitingForDescription!= NO_TAG_VALUE) { this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); this.tagWaitingForDescription = NO_TAG_VALUE; } }
protected void ignoreExpressionAssignment() { // Assignment ::= InvalidArrayInitializerAssignement // encoded operator would be: this.intStack[this.intPtr] this.intPtr--; ArrayInitializer arrayInitializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--]; this.expressionLengthPtr -- ; // report a syntax error and abort parsing if(!this.statementRecoveryActivated) problemReporter().arrayConstantsOnlyInArrayInitializers(arrayInitializer.sourceStart, arrayInitializer.sourceEnd); } public void initialize() {
protected void refreshInlineTagPosition(int previousPosition) { // Signal tag missing description if necessary if (this.tagWaitingForDescription!= NO_TAG_VALUE) { this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); this.tagWaitingForDescription = NO_TAG_VALUE; } }
protected void consumeOnlyTypeArguments() { if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { int length = this.genericsLengthStack[this.genericsLengthPtr]; problemReporter().invalidUsageOfTypeArguments( (TypeReference)this.genericsStack[this.genericsPtr - length + 1], (TypeReference)this.genericsStack[this.genericsPtr]); } } protected void consumeOnlyTypeArgumentsForCastExpression() {
protected void refreshInlineTagPosition(int previousPosition) { // Signal tag missing description if necessary if (this.tagWaitingForDescription!= NO_TAG_VALUE) { this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); this.tagWaitingForDescription = NO_TAG_VALUE; } }
protected void consumeOnlyTypeArguments() { if(!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) { int length = this.genericsLengthStack[this.genericsLengthPtr]; problemReporter().invalidUsageOfTypeArguments( (TypeReference)this.genericsStack[this.genericsPtr - length + 1], (TypeReference)this.genericsStack[this.genericsPtr]); } } protected void consumeOnlyTypeArgumentsForCastExpression() {
protected void rejectIllegalLeadingTypeAnnotations(TypeReference typeReference) { // Reject misplaced annotations prefixed to a type reference; Used when the grammar is permissive enough to allow them in the first place. Annotation [][] annotations = typeReference.annotations; if (annotations != null && annotations[0] != null) { problemReporter().misplacedTypeAnnotations(annotations[0][0], annotations[0][annotations[0].length - 1]); annotations[0] = null; // don't complain further. } } private void rejectIllegalTypeAnnotations(TypeReference typeReference) {
protected void refreshInlineTagPosition(int previousPosition) { // Signal tag missing description if necessary if (this.tagWaitingForDescription!= NO_TAG_VALUE) { this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); this.tagWaitingForDescription = NO_TAG_VALUE; } }
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) { if (this.options.sourceLevel < ClassFileConstants.JDK1_8) { problemReporter().intersectionCastNotBelow18(typeReferences); } return new IntersectionCastTypeReference(typeReferences); } protected void consumeCastExpressionLL1WithBounds() {
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) { if (this.options.sourceLevel < ClassFileConstants.JDK1_8) { problemReporter().intersectionCastNotBelow18(typeReferences); } return new IntersectionCastTypeReference(typeReferences); } protected void consumeCastExpressionLL1WithBounds() {
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) { if (this.options.sourceLevel < ClassFileConstants.JDK1_8) { problemReporter().intersectionCastNotBelow18(typeReferences); } return new IntersectionCastTypeReference(typeReferences); } protected void consumeCastExpressionLL1WithBounds() {
protected void consumeEmptyTypeDeclaration() { // ClassMemberDeclaration ::= ';' // InterfaceMemberDeclaration ::= ';' // TypeDeclaration ::= ';' pushOnAstLengthStack(0); if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition); flushCommentsDefinedPriorTo(this.endStatementPosition); } protected void consumeEnhancedForStatement() {
protected void consumeInvalidEnumDeclaration() { // BlockStatement ::= EnumDeclaration TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl); // remove the ast node created in interface header this.astPtr--; pushOnAstLengthStack(-1); concatNodeLists(); } protected void consumeInvalidInterfaceDeclaration() {
protected boolean parseIdentifierTag(boolean report) { int token = readTokenSafely(); switch (token) { case TerminalTokens.TokenNameIdentifier: pushIdentifier(true, false); return true; } if (report) { this.sourceParser.problemReporter().javadocMissingIdentifier(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers); } return false; }
protected void consumeInvalidAnnotationTypeDeclaration() { // BlockStatement ::= AnnotationTypeDeclaration TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl); // remove the ast node created in interface header this.astPtr--; pushOnAstLengthStack(-1); concatNodeLists(); } protected void consumeInvalidConstructorDeclaration() {
protected void consumeEmptyTypeDeclaration() { // ClassMemberDeclaration ::= ';' // InterfaceMemberDeclaration ::= ';' // TypeDeclaration ::= ';' pushOnAstLengthStack(0); if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition); flushCommentsDefinedPriorTo(this.endStatementPosition); } protected void consumeEnhancedForStatement() {
protected void consumeInvalidAnnotationTypeDeclaration() { // BlockStatement ::= AnnotationTypeDeclaration TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl); // remove the ast node created in interface header this.astPtr--; pushOnAstLengthStack(-1); concatNodeLists(); } protected void consumeInvalidConstructorDeclaration() {
protected void consumeInvalidEnumDeclaration() { // BlockStatement ::= EnumDeclaration TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl); // remove the ast node created in interface header this.astPtr--; pushOnAstLengthStack(-1); concatNodeLists(); } protected void consumeInvalidInterfaceDeclaration() {
protected void consumeInvalidInterfaceDeclaration() { // BlockStatement ::= InvalidInterfaceDeclaration //InterfaceDeclaration ::= Modifiersopt 'interface' 'Identifier' ExtendsInterfacesopt InterfaceHeader InterfaceBody TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr]; if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl); // remove the ast node created in interface header this.astPtr--; pushOnAstLengthStack(-1); concatNodeLists(); } protected void consumeInterfaceMethodDeclaration(boolean hasSemicolonBody) {