Class TokenEOF


  • public class TokenEOF
    extends Token
    A token that matches end of file.

    This token is used by the GLL parser.

    • Field Detail

      • EOF

        public static final TokenEOF EOF
        The EOF 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?

        The TokenEOF is a singleton. It matches itself, nothing else.

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

        public void export​(GrammarExporter exporter)
        Description copied from class: Token
        Export the token using the specified exporter.
        Specified by:
        export in class Token
        Parameters:
        exporter - the exporter.
      • 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.