Class ParserException

All Implemented Interfaces:
Serializable

public class ParserException extends IllegalArgumentException
Whenever any issue in Parser occurs. Usually thrown using ASSERT(boolean, String) and @ASSERT(boolean, Supplier, String).
See Also:
  • Constructor Details

    • ParserException

      public ParserException(String message)
      Construct a Parser Exception without a file pointer.
      Parameters:
      message - Error message.
    • ParserException

      public ParserException(String message, FilePointer ptr)
      Construct a Parser Exception with a file pointer.
      Parameters:
      message - Error message.
      ptr - Position in the file where Parser could not proceed.
  • Method Details

    • ASSERT

      public static void ASSERT(boolean check, String elseMessage) throws ParserException
      Make sure a condition is met, else throw an exception with a given message.
      Parameters:
      check - Condition to ensure.
      elseMessage - Error message.
      Throws:
      ParserException - When condition is not met.
    • ASSERT

      public static void ASSERT(boolean check, FilePointer ptr, String elseMessage) throws ParserException
      Make sure a condition is met, else throw an exception with a given message.
      Parameters:
      check - Condition to ensure.
      ptr - Position in the file where Parser could not proceed.
      elseMessage - Error message.
      Throws:
      ParserException - When condition is not met.
    • ASSERT

      public static void ASSERT(boolean check, Supplier<FilePointer> ptr, String elseMessage) throws ParserException
      Make sure a condition is met, else throw an exception with a given message.
      Parameters:
      check - Condition to ensure.
      ptr - Position in the file where Parser could not proceed.
      elseMessage - Error message.
      Throws:
      ParserException - When condition is not met.