Example usage for org.eclipse.jdt.internal.compiler.util Messages parser_syntaxRecovery

List of usage examples for org.eclipse.jdt.internal.compiler.util Messages parser_syntaxRecovery

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.util Messages parser_syntaxRecovery.

Prototype

String parser_syntaxRecovery

To view the source code for org.eclipse.jdt.internal.compiler.util Messages parser_syntaxRecovery.

Click Source Link

Usage

From source file:org.eclipse.jdt.internal.compiler.parser.Parser.java

License:Open Source License

protected CompilationUnitDeclaration endParse(int act) {

    this.lastAct = act;

    if (this.statementRecoveryActivated) {
        RecoveredElement recoveredElement = buildInitialRecoveryState();

        if (recoveredElement != null) {
            recoveredElement.topElement().updateParseTree();
        }//  w  ww .ja  v  a2 s  .  co m

        if (this.hasError)
            resetStacks();
    } else if (this.currentElement != null) {
        if (VERBOSE_RECOVERY) {
            System.out.print(Messages.parser_syntaxRecovery);
            System.out.println("--------------------------"); //$NON-NLS-1$
            System.out.println(this.compilationUnit);
            System.out.println("----------------------------------"); //$NON-NLS-1$
        }
        this.currentElement.topElement().updateParseTree();
    } else {
        if (this.diet & VERBOSE_RECOVERY) {
            System.out.print(Messages.parser_regularParse);
            System.out.println("--------------------------"); //$NON-NLS-1$
            System.out.println(this.compilationUnit);
            System.out.println("----------------------------------"); //$NON-NLS-1$
        }
    }
    persistLineSeparatorPositions();
    for (int i = 0; i < this.scanner.foundTaskCount; i++) {
        if (!this.statementRecoveryActivated)
            problemReporter().task(new String(this.scanner.foundTaskTags[i]),
                    new String(this.scanner.foundTaskMessages[i]),
                    this.scanner.foundTaskPriorities[i] == null ? null
                            : new String(this.scanner.foundTaskPriorities[i]),
                    this.scanner.foundTaskPositions[i][0], this.scanner.foundTaskPositions[i][1]);
    }
    return this.compilationUnit;
}