Package hydra.parsing

Class ParseError

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ParseError>

    public class ParseError
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<ParseError>
    An error which occurred while parsing
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String message
      An error message
      static Name MESSAGE
      Name of the hydra.parsing.ParseError.message field.
      java.lang.String remainder
      The remaining input at the point of failure
      static Name REMAINDER
      Name of the hydra.parsing.ParseError.remainder field.
      static Name TYPE_
      Name of the hydra.parsing.ParseError type.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseError​(java.lang.String message, java.lang.String remainder)
      Constructs an immutable ParseError.
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.parsing.ParseError type.
      • MESSAGE

        public static final Name MESSAGE
        Name of the hydra.parsing.ParseError.message field.
      • REMAINDER

        public static final Name REMAINDER
        Name of the hydra.parsing.ParseError.remainder field.
      • message

        public final java.lang.String message
        An error message
      • remainder

        public final java.lang.String remainder
        The remaining input at the point of failure
    • Constructor Detail

      • ParseError

        public ParseError​(java.lang.String message,
                          java.lang.String remainder)
        Constructs an immutable ParseError.
        Parameters:
        message - An error message
        remainder - The remaining input at the point of failure
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(ParseError other)
        Specified by:
        compareTo in interface java.lang.Comparable<ParseError>
      • withMessage

        public ParseError withMessage​(java.lang.String message)
        Returns a copy of this ParseError with message replaced.
      • withRemainder

        public ParseError withRemainder​(java.lang.String remainder)
        Returns a copy of this ParseError with remainder replaced.