本文整理了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
[英]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
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() {
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
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;
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
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() {
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
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;
}
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
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() {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
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;
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
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() {
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
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) {
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
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;
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
problemReporter().intersectionCastNotBelow18(typeReferences);
}
return new IntersectionCastTypeReference(typeReferences);
}
protected void consumeCastExpressionLL1WithBounds() {
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
problemReporter().intersectionCastNotBelow18(typeReferences);
}
return new IntersectionCastTypeReference(typeReferences);
}
protected void consumeCastExpressionLL1WithBounds() {
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public IntersectionCastTypeReference createIntersectionCastTypeReference(TypeReference[] typeReferences) {
if (this.options.sourceLevel < ClassFileConstants.JDK1_8) {
problemReporter().intersectionCastNotBelow18(typeReferences);
}
return new IntersectionCastTypeReference(typeReferences);
}
protected void consumeCastExpressionLL1WithBounds() {
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
protected void consumeEmptyTypeDeclaration() {
// ClassMemberDeclaration ::= ';'
// InterfaceMemberDeclaration ::= ';'
// TypeDeclaration ::= ';'
pushOnAstLengthStack(0);
if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition);
flushCommentsDefinedPriorTo(this.endStatementPosition);
}
protected void consumeEnhancedForStatement() {
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
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() {
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
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;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
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() {
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
protected void consumeEmptyTypeDeclaration() {
// ClassMemberDeclaration ::= ';'
// InterfaceMemberDeclaration ::= ';'
// TypeDeclaration ::= ';'
pushOnAstLengthStack(0);
if(!this.statementRecoveryActivated) problemReporter().superfluousSemicolon(this.endPosition+1, this.endStatementPosition);
flushCommentsDefinedPriorTo(this.endStatementPosition);
}
protected void consumeEnhancedForStatement() {
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
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() {
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
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() {
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
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) {
内容来源于网络,如有侵权,请联系作者删除!