Class ForestException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ForestException
    extends CoffeeGrinderException
    Exceptions that arise processing the shared packed parse forest (SPPF).

    These are generally caused by errors in how the API is used.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ForestException​(java.lang.String code, java.lang.String message)
      An SPPF exception with a message.
      ForestException​(java.lang.String code, java.lang.String message, java.lang.Throwable cause)
      An SPPF exception with an underlying cause.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ForestException cannotAddChild​(java.lang.String node)
      A cannot-add-child exception.
      static ForestException ioError​(java.lang.String filename, java.lang.Exception ex)
      An I/O exception.
      static ForestException noSuchNode​(java.lang.String node)
      A no-such-node exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ForestException

        public ForestException​(java.lang.String code,
                               java.lang.String message)
        An SPPF exception with a message.
        Parameters:
        code - the code
        message - the message
      • ForestException

        public ForestException​(java.lang.String code,
                               java.lang.String message,
                               java.lang.Throwable cause)
        An SPPF exception with an underlying cause.
        Parameters:
        code - the code
        message - the message
        cause - the cause
    • Method Detail

      • ioError

        public static ForestException ioError​(java.lang.String filename,
                                              java.lang.Exception ex)
        An I/O exception.
        Parameters:
        filename - filename being accessed at the time of error
        ex - the underlying exception
        Returns:
        a ForestException
      • noSuchNode

        public static ForestException noSuchNode​(java.lang.String node)
        A no-such-node exception.

        This is an internal error.

        Parameters:
        node - The node.
        Returns:
        A ForestException
      • cannotAddChild

        public static ForestException cannotAddChild​(java.lang.String node)
        A cannot-add-child exception.

        This is an internal error.

        Parameters:
        node - The node.
        Returns:
        A ForestException