ErrorManager (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.syntax

## Class ErrorManager

- java.lang.Object
- - hlt.language.syntax.ErrorManager

- Direct Known Subclasses:
    DefaultErrorManager

      public abstract class ErrorManager
      extends java.lang.Object

  This the abstract class of objects for managing and reporting errors. The method `reportError(Error error)` must be provided by a concrete class deriving from this class. For common uses, this package also provides the concrete class `DefaultErrorManager` whose error reporting method amounts to printing the specified error on `System.err` (which is the default error stream and may be reset to another `PrintStream` if desired).
  Version:
    Last modified on Fri Apr 13 19:58:05 2012 by hak
  Author:
    Hassan Aït-Kaci
  See Also:
    `DefaultErrorManager`
  Copyright:
    © by the author

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `countDeprecated()` Increments the number of deprecation warning.
    `void` | `countError()` Increments the number of errors.
    `void` | `countWarning()` Increments the number of warnings.
    `int` | `deprecatedCount()` Returns the current count of deprecation warnings.
    `int` | `errorCount()` Returns the current count of (syntax???) errors.
    `java.io.PrintStream` | `errorStream()` Returns this error manager's error reporting stream.
    `boolean` | `hasDeprecateds()` Returns `true` iff this error manager has deprecated warnings.
    `boolean` | `hasErrors()` Returns `true` iff this error manager has errors.
    `boolean` | `hasWarnings()` Returns `true` iff this error manager has errors.
    `boolean` | `isRecoveringErrors()` Returns `true` iff this error manager is currently set to recover from errors.
    `boolean` | `isReportingErrors()` Returns `true` iff this error manager is currently set to report errors.
    `void` | `recoverFromErrors(boolean flag)` Enables (resp., disables) error recovery for this error manager iff the specified flag is `true` (resp., `false`).
    `abstract void` | `reportDeprecated(Error error)` Reports the specified error as a deprecation warning.
    `abstract void` | `reportError(Error error)` Reports the specified error as an error.
    `void` | `reportErrors(boolean flag)` Enables (resp., disables) error reporting for this error manager iff the specified flag is `true` (resp., `false`).
    `abstract void` | `reportWarning(Error error)` Reports the specified error as a warning.
    `void` | `reset()` Resets the error manager to a fresh state.
    `void` | `setErrorStream(java.io.PrintStream stream)` Sets the print stream for error reporting to the specified one.
    `abstract void` | `tallyDeprecateds()` Reports a recapitulation of all deprecation warnings.
    `abstract void` | `tallyErrors()` Reports a recapitulation of all errors.
    `abstract void` | `tallyWarnings()` Reports a recapitulation of all warnings.
    `int` | `warningCount()` Returns the current count of warnings.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ErrorManager

          public ErrorManager()

  - ### Method Detail

    - #### reportError

          public abstract void reportError(Error error)

      Reports the specified error as an error.

    - #### reportWarning

          public abstract void reportWarning(Error error)

      Reports the specified error as a warning.

    - #### reportDeprecated

          public abstract void reportDeprecated(Error error)

      Reports the specified error as a deprecation warning.

    - #### tallyErrors

          public abstract void tallyErrors()

      Reports a recapitulation of all errors.

    - #### tallyWarnings

          public abstract void tallyWarnings()

      Reports a recapitulation of all warnings.

    - #### tallyDeprecateds

          public abstract void tallyDeprecateds()

      Reports a recapitulation of all deprecation warnings.

    - #### setErrorStream

          public final void setErrorStream(java.io.PrintStream stream)

      Sets the print stream for error reporting to the specified one.

    - #### errorStream

          public final java.io.PrintStream errorStream()

      Returns this error manager's error reporting stream. The default is `System.err`.

    - #### reportErrors

          public final void reportErrors(boolean flag)

      Enables (resp., disables) error reporting for this error manager iff the specified flag is `true` (resp., `false`).

    - #### isReportingErrors

          public final boolean isReportingErrors()

      Returns `true` iff this error manager is currently set to report errors.

    - #### recoverFromErrors

          public final void recoverFromErrors(boolean flag)

      Enables (resp., disables) error recovery for this error manager iff the specified flag is `true` (resp., `false`).

    - #### isRecoveringErrors

          public final boolean isRecoveringErrors()

      Returns `true` iff this error manager is currently set to recover from errors.

    - #### hasErrors

          public final boolean hasErrors()

      Returns `true` iff this error manager has errors.

    - #### hasWarnings

          public final boolean hasWarnings()

      Returns `true` iff this error manager has errors.

    - #### hasDeprecateds

          public final boolean hasDeprecateds()

      Returns `true` iff this error manager has deprecated warnings.

    - #### reset

          public final void reset()

      Resets the error manager to a fresh state.

    - #### errorCount

          public final int errorCount()

      Returns the current count of (syntax???) errors.

    - #### countError

          public final void countError()

      Increments the number of errors.

    - #### warningCount

          public final int warningCount()

      Returns the current count of warnings.

    - #### countWarning

          public final void countWarning()

      Increments the number of warnings.

    - #### deprecatedCount

          public final int deprecatedCount()

      Returns the current count of deprecation warnings.

    - #### countDeprecated

          public final void countDeprecated()

      Increments the number of deprecation warning.