if((method.bits & ASTNode.ErrorInSignature) != 0) { if(method.isAnnotationMethod()) { DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameQUESTION, method.declarationSourceStart, method.declarationSourceEnd, this.options); diagnoseParser.diagnoseParse(this.options.performStatementsRecovery); } else { DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameDIVIDE, method.declarationSourceStart, method.declarationSourceEnd, this.options); diagnoseParser.diagnoseParse(this.options.performStatementsRecovery); Initializer initializer = (Initializer)fields[j]; if((initializer.bits & ASTNode.ErrorInSignature) != 0){ DiagnoseParser diagnoseParser = new DiagnoseParser(this, TokenNameRIGHT_SHIFT, initializer.declarationSourceStart, initializer.declarationSourceEnd, this.options); diagnoseParser.diagnoseParse(this.options.performStatementsRecovery);
case BEFORE_CODE: { if (repair.symbol > NT_OFFSET) name_index = getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition); else name_index = getTermIndex(this.stack, this.stateStackTop, repair.symbol, reportError(repair.code, name_index, t, t); break; name_index = getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition + 1); reportError(repair.code, name_index, curtok, curtok); break; name_index = getTermIndex(this.stack, this.stateStackTop, repair.symbol, repair.bufferPosition + 1); reportError(repair.code, name_index, curtok, curtok); break; reportError(repair.code, Parser.terminal_index[repair.symbol], curtok,
case SCOPE_CODE: { if (repair.stackPosition < this.stateStackTop) { reportError(DELETION_CODE, Parser.terminal_index[ERROR_SYMBOL], this.locationStack[repair.stackPosition], reportError(SCOPE_CODE, -this.scopeIndex[i], this.locationStack[this.scopePosition[i]], reportError(SCOPE_CODE, -this.scopeIndex[this.scopeStackTop], this.locationStack[this.scopePosition[this.scopeStackTop]], this.buffer[1], getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition) reportError(repair.code, (repair.code == SECONDARY_CODE ? getNtermIndex(this.stack[repair.stackPosition], repair.symbol, repair.bufferPosition)
PrimaryRepairInfo scope_repair = scopeTrial(stck, stack_top, repair.copy()); if (scope_repair.distance > repair.distance) repair = scope_repair; symbol = mergeCandidate(stck[stack_top], repair.bufferPosition); if (symbol != 0) { j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+2); if ((j > repair.distance) || (j == repair.distance && repair.misspellIndex < 10)) { repair.misspellIndex = 10; j = parseCheck( stck, stack_top, j = parseCheck(stck, stack_top, symbol, repair.bufferPosition); if (j > repair.distance) { repair.misspellIndex = k; k = 10; } else { k = misspell(symbol, this.buffer[repair.bufferPosition]); j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = k; j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = 0;
this.locationStartStack[this.nextStackTop] = this.lexStream.start(this.buffer[2]); misplaced.numDeletions = this.nextStackTop; misplaced = misplacementRecovery(this.nextStack, this.nextStackTop, next_last_index, misplaced, true); repair = secondaryRecovery(this.nextStack, this.nextStackTop, next_last_index, repair, true); misplaced = misplacementRecovery(this.stack, this.stateStackTop, last_index, misplaced, false); repair = secondaryRecovery(this.stack, this.stateStackTop, last_index, repair, false); scope_repair.bufferPosition <= repair.bufferPosition && repair.code != SCOPE_CODE; scope_repair.bufferPosition++) { scope_repair = scopeTrial(this.stack, this.stateStackTop, scope_repair); j = (scope_repair.distance == MAX_DISTANCE ? last_index scope_repair = scopeTrial(this.stack, top, scope_repair); if (scope_repair.distance > 0) secondaryDiagnosis(repair);
repair = checkPrimaryDistance(this.nextStack, this.nextStackTop, repair); new_repair = checkPrimaryDistance(this.stack, this.stateStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; new_repair = repair.copy(); new_repair.bufferPosition = 1; new_repair = checkPrimaryDistance(this.prevStack,this.prevStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; if (secondaryCheck(this.nextStack,this.nextStackTop,3,repair.distance)) { return candidate; else if (secondaryCheck(this.stack, this.stateStackTop, 2, repair.distance)) { return candidate; return primaryDiagnosis(repair);
char[] errorTokenSource = this.lexStream.name(token); if (currentKind == TerminalTokens.TokenNameStringLiteral) { errorTokenSource = displayEscapeCharacters(errorTokenSource, 1, errorTokenSource.length - 1); this.recoveryScanner.insertToken(addedToken, -1, errorStart); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.insertTokens(template, -1, errorStart); if(this.reportProblem) problemReporter().parseErrorInsertBeforeToken( errorStart, errorEnd, this.recoveryScanner.insertToken(addedToken, -1, errorEnd); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.insertTokens(template, -1, errorEnd); if(this.reportProblem) problemReporter().parseErrorInsertAfterToken( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorDeleteToken( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorReplaceToken(
if(this.reportProblem) problemReporter().parseErrorMisplacedConstruct( errorStart, errorEnd); int[] template = getNTermTemplate(-tmpAddedToken); if(template != null) { for (int j = 0; j < template.length; j++) { if(this.reportProblem) problemReporter().parseErrorInsertToComplete( errorStart, errorEnd, Parser.readableName[scopeNameIndex]); } else { if(this.reportProblem) problemReporter().parseErrorInsertToCompletePhrase( errorStart, errorEnd, this.recoveryScanner.replaceTokens(addedToken, errorStart, errorEnd); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.replaceTokens(template, errorStart, errorEnd); if(this.reportProblem) problemReporter().parseErrorMergeTokens( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorDeleteTokens(
int act = START_STATE; reallocateStacks(); reallocateStacks(); pos = pos < this.tempStackTop ? pos : this.tempStackTop; this.tempStack[this.tempStackTop + 1] = act; reallocateStacks(); reallocateStacks(); RepairCandidate candidate = errorRecovery(this.currentToken, forceRecoveryAfterLBracketMissing);
PrimaryRepairInfo scope_repair = scopeTrial(stck, stack_top, repair.copy()); if (scope_repair.distance > repair.distance) repair = scope_repair; symbol = mergeCandidate(stck[stack_top], repair.bufferPosition); if (symbol != 0) { j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+2); if ((j > repair.distance) || (j == repair.distance && repair.misspellIndex < 10)) { repair.misspellIndex = 10; j = parseCheck( stck, stack_top, j = parseCheck(stck, stack_top, symbol, repair.bufferPosition); if (j > repair.distance) { repair.misspellIndex = k; k = 10; } else { k = misspell(symbol, this.buffer[repair.bufferPosition]); j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = k; j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = 0;
this.locationStartStack[this.nextStackTop] = this.lexStream.start(this.buffer[2]); misplaced.numDeletions = this.nextStackTop; misplaced = misplacementRecovery(this.nextStack, this.nextStackTop, next_last_index, misplaced, true); repair = secondaryRecovery(this.nextStack, this.nextStackTop, next_last_index, repair, true); misplaced = misplacementRecovery(this.stack, this.stateStackTop, last_index, misplaced, false); repair = secondaryRecovery(this.stack, this.stateStackTop, last_index, repair, false); scope_repair.bufferPosition <= repair.bufferPosition && repair.code != SCOPE_CODE; scope_repair.bufferPosition++) { scope_repair = scopeTrial(this.stack, this.stateStackTop, scope_repair); j = (scope_repair.distance == MAX_DISTANCE ? last_index scope_repair = scopeTrial(this.stack, top, scope_repair); if (scope_repair.distance > 0) secondaryDiagnosis(repair);
repair = checkPrimaryDistance(this.nextStack, this.nextStackTop, repair); new_repair = checkPrimaryDistance(this.stack, this.stateStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; new_repair = repair.copy(); new_repair.bufferPosition = 1; new_repair = checkPrimaryDistance(this.prevStack,this.prevStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; if (secondaryCheck(this.nextStack,this.nextStackTop,3,repair.distance)) { return candidate; else if (secondaryCheck(this.stack, this.stateStackTop, 2, repair.distance)) { return candidate; return primaryDiagnosis(repair);
char[] errorTokenSource = this.lexStream.name(token); if (currentKind == TerminalTokens.TokenNameStringLiteral) { errorTokenSource = displayEscapeCharacters(errorTokenSource, 1, errorTokenSource.length - 1); this.recoveryScanner.insertToken(addedToken, -1, errorStart); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.insertTokens(template, -1, errorStart); if(this.reportProblem) problemReporter().parseErrorInsertBeforeToken( errorStart, errorEnd, this.recoveryScanner.insertToken(addedToken, -1, errorEnd); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.insertTokens(template, -1, errorEnd); if(this.reportProblem) problemReporter().parseErrorInsertAfterToken( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorDeleteToken( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorReplaceToken(
case SCOPE_CODE: { if (repair.stackPosition < this.stateStackTop) { reportError(DELETION_CODE, Parser.terminal_index[ERROR_SYMBOL], this.locationStack[repair.stackPosition], reportError(SCOPE_CODE, -this.scopeIndex[i], this.locationStack[this.scopePosition[i]], reportError(SCOPE_CODE, -this.scopeIndex[this.scopeStackTop], this.locationStack[this.scopePosition[this.scopeStackTop]], this.buffer[1], getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition) reportError(repair.code, (repair.code == SECONDARY_CODE ? getNtermIndex(this.stack[repair.stackPosition], repair.symbol, repair.bufferPosition)
if(this.reportProblem) problemReporter().parseErrorMisplacedConstruct( errorStart, errorEnd); int[] template = getNTermTemplate(-tmpAddedToken); if(template != null) { for (int j = 0; j < template.length; j++) { if(this.reportProblem) problemReporter().parseErrorInsertToComplete( errorStart, errorEnd, Parser.readableName[scopeNameIndex]); } else { if(this.reportProblem) problemReporter().parseErrorInsertToCompletePhrase( errorStart, errorEnd, this.recoveryScanner.replaceTokens(addedToken, errorStart, errorEnd); } else { int[] template = getNTermTemplate(-addedToken); if(template != null) { this.recoveryScanner.replaceTokens(template, errorStart, errorEnd); if(this.reportProblem) problemReporter().parseErrorMergeTokens( errorStart, errorEnd, if(this.reportProblem) problemReporter().parseErrorDeleteTokens(
int act = START_STATE; reallocateStacks(); reallocateStacks(); pos = pos < this.tempStackTop ? pos : this.tempStackTop; this.tempStack[this.tempStackTop + 1] = act; reallocateStacks(); reallocateStacks(); RepairCandidate candidate = errorRecovery(this.currentToken, forceRecoveryAfterLBracketMissing);
PrimaryRepairInfo scope_repair = scopeTrial(stck, stack_top, repair.copy()); if (scope_repair.distance > repair.distance) repair = scope_repair; symbol = mergeCandidate(stck[stack_top], repair.bufferPosition); if (symbol != 0) { j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+2); if ((j > repair.distance) || (j == repair.distance && repair.misspellIndex < 10)) { repair.misspellIndex = 10; j = parseCheck( stck, stack_top, j = parseCheck(stck, stack_top, symbol, repair.bufferPosition); if (j > repair.distance) { repair.misspellIndex = k; k = 10; } else { k = misspell(symbol, this.buffer[repair.bufferPosition]); j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = k; j = parseCheck(stck, stack_top, symbol, repair.bufferPosition+1); if (j > repair.distance) { repair.misspellIndex = 0;
this.locationStartStack[this.nextStackTop] = this.lexStream.start(this.buffer[2]); misplaced.numDeletions = this.nextStackTop; misplaced = misplacementRecovery(this.nextStack, this.nextStackTop, next_last_index, misplaced, true); repair = secondaryRecovery(this.nextStack, this.nextStackTop, next_last_index, repair, true); misplaced = misplacementRecovery(this.stack, this.stateStackTop, last_index, misplaced, false); repair = secondaryRecovery(this.stack, this.stateStackTop, last_index, repair, false); scope_repair.bufferPosition <= repair.bufferPosition && repair.code != SCOPE_CODE; scope_repair.bufferPosition++) { scope_repair = scopeTrial(this.stack, this.stateStackTop, scope_repair); j = (scope_repair.distance == MAX_DISTANCE ? last_index scope_repair = scopeTrial(this.stack, top, scope_repair); if (scope_repair.distance > 0) secondaryDiagnosis(repair);
case BEFORE_CODE: { if (repair.symbol > NT_OFFSET) name_index = getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition); else name_index = getTermIndex(this.stack, this.stateStackTop, repair.symbol, reportError(repair.code, name_index, t, t); break; name_index = getNtermIndex(this.stack[this.stateStackTop], repair.symbol, repair.bufferPosition + 1); reportError(repair.code, name_index, curtok, curtok); break; name_index = getTermIndex(this.stack, this.stateStackTop, repair.symbol, repair.bufferPosition + 1); reportError(repair.code, name_index, curtok, curtok); break; reportError(repair.code, Parser.terminal_index[repair.symbol], curtok,
repair = checkPrimaryDistance(this.nextStack, this.nextStackTop, repair); new_repair = checkPrimaryDistance(this.stack, this.stateStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; new_repair = repair.copy(); new_repair.bufferPosition = 1; new_repair = checkPrimaryDistance(this.prevStack,this.prevStackTop, new_repair); if (new_repair.distance > repair.distance || new_repair.misspellIndex > repair.misspellIndex) { repair = new_repair; if (secondaryCheck(this.nextStack,this.nextStackTop,3,repair.distance)) { return candidate; else if (secondaryCheck(this.stack, this.stateStackTop, 2, repair.distance)) { return candidate; return primaryDiagnosis(repair);