Class SMFParseErrors


  • public final class SMFParseErrors
    extends java.lang.Object
    Convenient functions for constructing parse errors.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SMFParseError errorException​(java.lang.Exception e)
      Construct a parse error for the given exception.
      static SMFParseError errorExpectedGot​(java.lang.String message, java.lang.String expected, java.lang.String received, com.io7m.jlexing.core.LexicalPosition<java.net.URI> position)
      Construct a parse error that indicates the expected and actual input.
      static SMFParseError errorExpectedGotWithException​(java.lang.String message, java.lang.String expected, java.lang.String received, com.io7m.jlexing.core.LexicalPosition<java.net.URI> position, java.lang.Exception exception)
      Construct a parse error that indicates the expected and actual input.
      static SMFParseError errorWithMessage​(java.lang.String message)
      Construct a parse error for the given exception.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • errorException

        public static SMFParseError errorException​(java.lang.Exception e)
        Construct a parse error for the given exception.
        Parameters:
        e - The exception
        Returns:
        A parse error
      • errorWithMessage

        public static SMFParseError errorWithMessage​(java.lang.String message)
        Construct a parse error for the given exception.
        Parameters:
        message - The error message
        Returns:
        A parse error
      • errorExpectedGot

        public static SMFParseError errorExpectedGot​(java.lang.String message,
                                                     java.lang.String expected,
                                                     java.lang.String received,
                                                     com.io7m.jlexing.core.LexicalPosition<java.net.URI> position)
        Construct a parse error that indicates the expected and actual input.
        Parameters:
        message - An error message
        expected - The expected input
        received - The received input
        position - The current position
        Returns:
        A parse error
      • errorExpectedGotWithException

        public static SMFParseError errorExpectedGotWithException​(java.lang.String message,
                                                                  java.lang.String expected,
                                                                  java.lang.String received,
                                                                  com.io7m.jlexing.core.LexicalPosition<java.net.URI> position,
                                                                  java.lang.Exception exception)
        Construct a parse error that indicates the expected and actual input.
        Parameters:
        message - An error message
        expected - The expected input
        received - The received input
        position - The current position
        exception - An exception raised during parsing
        Returns:
        A parse error