Package com.io7m.smfj.parser.api
Class SMFParseErrors
- java.lang.Object
-
- com.io7m.smfj.parser.api.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.
-
-
-
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 messageexpected
- The expected inputreceived
- The received inputposition
- 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 messageexpected
- The expected inputreceived
- The received inputposition
- The current positionexception
- An exception raised during parsing- Returns:
- A parse error
-
-