org.eclipse.jdt.internal.compiler.parser.Parser.problemReporter()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.8k)|赞(0)|评价(0)|浏览(204)

本文整理了Java中org.eclipse.jdt.internal.compiler.parser.Parser.problemReporter()方法的一些代码示例,展示了Parser.problemReporter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.problemReporter()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.parser.Parser
类名称:Parser
方法名:problemReporter

Parser.problemReporter介绍

[英]Returns this parser's problem reporter initialized with its reference context. Also it is assumed that a problem is going to be reported, so initializes the compilation result's line positions.
[中]返回使用其引用上下文初始化的此解析器的问题报告器。此外,假设将报告问题,因此初始化编译结果的行位置。

代码示例

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void ignoreExpressionAssignment() {
  2. // Assignment ::= InvalidArrayInitializerAssignement
  3. // encoded operator would be: this.intStack[this.intPtr]
  4. this.intPtr--;
  5. ArrayInitializer arrayInitializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--];
  6. this.expressionLengthPtr -- ;
  7. // report a syntax error and abort parsing
  8. if(!this.statementRecoveryActivated) problemReporter().arrayConstantsOnlyInArrayInitializers(arrayInitializer.sourceStart, arrayInitializer.sourceEnd);
  9. }
  10. public void initialize() {

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void refreshInlineTagPosition(int previousPosition) {
  2. // Signal tag missing description if necessary
  3. if (this.tagWaitingForDescription!= NO_TAG_VALUE) {
  4. this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
  5. this.tagWaitingForDescription = NO_TAG_VALUE;
  6. }
  7. }

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

  1. protected void ignoreExpressionAssignment() {
  2. // Assignment ::= InvalidArrayInitializerAssignement
  3. // encoded operator would be: this.intStack[this.intPtr]
  4. this.intPtr--;
  5. ArrayInitializer arrayInitializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--];
  6. this.expressionLengthPtr -- ;
  7. // report a syntax error and abort parsing
  8. if(!this.statementRecoveryActivated) problemReporter().arrayConstantsOnlyInArrayInitializers(arrayInitializer.sourceStart, arrayInitializer.sourceEnd);
  9. }
  10. public void initialize() {

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

  1. protected void refreshInlineTagPosition(int previousPosition) {
  2. // Signal tag missing description if necessary
  3. if (this.tagWaitingForDescription!= NO_TAG_VALUE) {
  4. this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
  5. this.tagWaitingForDescription = NO_TAG_VALUE;
  6. }
  7. }

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

  1. protected void consumeOnlyTypeArguments() {
  2. if(!this.statementRecoveryActivated &&
  3. this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
  4. this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
  5. int length = this.genericsLengthStack[this.genericsLengthPtr];
  6. problemReporter().invalidUsageOfTypeArguments(
  7. (TypeReference)this.genericsStack[this.genericsPtr - length + 1],
  8. (TypeReference)this.genericsStack[this.genericsPtr]);
  9. }
  10. }
  11. protected void consumeOnlyTypeArgumentsForCastExpression() {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

  1. protected void refreshInlineTagPosition(int previousPosition) {
  2. // Signal tag missing description if necessary
  3. if (this.tagWaitingForDescription!= NO_TAG_VALUE) {
  4. this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
  5. this.tagWaitingForDescription = NO_TAG_VALUE;
  6. }
  7. }

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void consumeOnlyTypeArguments() {
  2. if(!this.statementRecoveryActivated &&
  3. this.options.sourceLevel < ClassFileConstants.JDK1_5 &&
  4. this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
  5. int length = this.genericsLengthStack[this.genericsLengthPtr];
  6. problemReporter().invalidUsageOfTypeArguments(
  7. (TypeReference)this.genericsStack[this.genericsPtr - length + 1],
  8. (TypeReference)this.genericsStack[this.genericsPtr]);
  9. }
  10. }
  11. protected void consumeOnlyTypeArgumentsForCastExpression() {

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void rejectIllegalLeadingTypeAnnotations(TypeReference typeReference) {
  2. // Reject misplaced annotations prefixed to a type reference; Used when the grammar is permissive enough to allow them in the first place.
  3. Annotation [][] annotations = typeReference.annotations;
  4. if (annotations != null && annotations[0] != null) {
  5. problemReporter().misplacedTypeAnnotations(annotations[0][0], annotations[0][annotations[0].length - 1]);
  6. annotations[0] = null; // don't complain further.
  7. }
  8. }
  9. private void rejectIllegalTypeAnnotations(TypeReference typeReference) {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

  1. protected void refreshInlineTagPosition(int previousPosition) {
  2. // Signal tag missing description if necessary
  3. if (this.tagWaitingForDescription!= NO_TAG_VALUE) {
  4. this.sourceParser.problemReporter().javadocMissingTagDescription(TAG_NAMES[this.tagWaitingForDescription], this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
  5. this.tagWaitingForDescription = NO_TAG_VALUE;
  6. }
  7. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

  1. public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
  2. if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
  3. problemReporter().intersectionCastNotBelow18(typeReferences);
  4. }
  5. return new IntersectionCastTypeReference(typeReferences);
  6. }
  7. protected void consumeCastExpressionLL1WithBounds() {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

  1. public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
  2. if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
  3. problemReporter().intersectionCastNotBelow18(typeReferences);
  4. }
  5. return new IntersectionCastTypeReference(typeReferences);
  6. }
  7. protected void consumeCastExpressionLL1WithBounds() {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

  1. public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
  2. if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
  3. problemReporter().intersectionCastNotBelow18(typeReferences);
  4. }
  5. return new IntersectionCastTypeReference(typeReferences);
  6. }
  7. protected void consumeCastExpressionLL1WithBounds() {

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void consumeEmptyTypeDeclaration() {
  2. // ClassMemberDeclaration ::= ';'
  3. // InterfaceMemberDeclaration ::= ';'
  4. // TypeDeclaration ::= ';'
  5. pushOnAstLengthStack(0);
  6. if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition);
  7. flushCommentsDefinedPriorTo(this.endStatementPosition);
  8. }
  9. protected void consumeEnhancedForStatement() {

代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj

  1. protected void consumeInvalidEnumDeclaration() {
  2. // BlockStatement ::= EnumDeclaration
  3. TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
  4. if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
  5. // remove the ast node created in interface header
  6. this.astPtr--;
  7. pushOnAstLengthStack(-1);
  8. concatNodeLists();
  9. }
  10. protected void consumeInvalidInterfaceDeclaration() {

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

  1. protected boolean parseIdentifierTag(boolean report) {
  2. int token = readTokenSafely();
  3. switch (token) {
  4. case TerminalTokens.TokenNameIdentifier:
  5. pushIdentifier(true, false);
  6. return true;
  7. }
  8. if (report) {
  9. this.sourceParser.problemReporter().javadocMissingIdentifier(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
  10. }
  11. return false;
  12. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

  1. protected void consumeInvalidAnnotationTypeDeclaration() {
  2. // BlockStatement ::= AnnotationTypeDeclaration
  3. TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
  4. if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
  5. // remove the ast node created in interface header
  6. this.astPtr--;
  7. pushOnAstLengthStack(-1);
  8. concatNodeLists();
  9. }
  10. protected void consumeInvalidConstructorDeclaration() {

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

  1. protected void consumeEmptyTypeDeclaration() {
  2. // ClassMemberDeclaration ::= ';'
  3. // InterfaceMemberDeclaration ::= ';'
  4. // TypeDeclaration ::= ';'
  5. pushOnAstLengthStack(0);
  6. if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition);
  7. flushCommentsDefinedPriorTo(this.endStatementPosition);
  8. }
  9. protected void consumeEnhancedForStatement() {

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

  1. protected void consumeInvalidAnnotationTypeDeclaration() {
  2. // BlockStatement ::= AnnotationTypeDeclaration
  3. TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
  4. if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
  5. // remove the ast node created in interface header
  6. this.astPtr--;
  7. pushOnAstLengthStack(-1);
  8. concatNodeLists();
  9. }
  10. protected void consumeInvalidConstructorDeclaration() {

代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core

  1. protected void consumeInvalidEnumDeclaration() {
  2. // BlockStatement ::= EnumDeclaration
  3. TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
  4. if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
  5. // remove the ast node created in interface header
  6. this.astPtr--;
  7. pushOnAstLengthStack(-1);
  8. concatNodeLists();
  9. }
  10. protected void consumeInvalidInterfaceDeclaration() {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

  1. protected void consumeInvalidInterfaceDeclaration() {
  2. // BlockStatement ::= InvalidInterfaceDeclaration
  3. //InterfaceDeclaration ::= Modifiersopt 'interface' 'Identifier' ExtendsInterfacesopt InterfaceHeader InterfaceBody
  4. TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
  5. if(!this.statementRecoveryActivated) problemReporter().illegalLocalTypeDeclaration(typeDecl);
  6. // remove the ast node created in interface header
  7. this.astPtr--;
  8. pushOnAstLengthStack(-1);
  9. concatNodeLists();
  10. }
  11. protected void consumeInterfaceMethodDeclaration(boolean hasSemicolonBody) {

相关文章

Parser类方法