Class TokenEPSILON


  • public class TokenEPSILON
    extends Token
    A single character Token.
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Return the string value of this token.
        Specified by:
        getValue in class Token
        Returns:
        The string value of the token ("<EOF>").
      • matches

        public boolean matches​(Token input)
        Does this token match the input?

        This token matches other token characters that have the same character as well as TokenStrings that are one character long and contain the same character.

        Specified by:
        matches in class Token
        Parameters:
        input - The input.
        Returns:
        true if they match.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test tokens for equality.

        Two tokens are equal if they represent the same character.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - An object.
        Returns:
        true if obj is equal to this terminal character.
      • hashCode

        public int hashCode()
        Assure that equal tokens return the same hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code.
      • toString

        public java.lang.String toString()
        Pretty print a token.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the object.