Class TokenEPSILON


public class TokenEPSILON extends Token
A single character Token.
  • Field Details

  • Method Details

    • getValue

      public 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(Object obj)
      Test tokens for equality.

      Two tokens are equal if they represent the same character.

      Overrides:
      equals in class 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 Object
      Returns:
      the hash code.
    • toString

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