Package org.nineml.coffeegrinder.tokens
Class TokenEOF
- java.lang.Object
-
- org.nineml.coffeegrinder.util.Decoratable
-
- org.nineml.coffeegrinder.tokens.Token
-
- org.nineml.coffeegrinder.tokens.TokenEOF
-
public class TokenEOF extends Token
A token that matches end of file.This token is used by the GLL parser.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test tokens for equality.voidexport(GrammarExporter exporter)Export the token using the specified exporter.java.lang.StringgetValue()Return the string value of this token.inthashCode()Assure that equal tokens return the same hash code.booleanmatches(Token input)Does this token match the input?java.lang.StringtoString()Pretty print a token.-
Methods inherited from class org.nineml.coffeegrinder.util.Decoratable
addAttribute, addAttributes, getAttribute, getAttributes, getAttributesMap, getAttributeValue, hasAttribute
-
-
-
-
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.
-
matches
public boolean matches(Token input)
Does this token match the input?The
TokenEOFis a singleton. It matches itself, nothing else.
-
export
public void export(GrammarExporter exporter)
Description copied from class:TokenExport the token using the specified exporter.
-
equals
public boolean equals(java.lang.Object obj)
Test tokens for equality.Two tokens are equal if they represent the same character.
- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- An object.- Returns:
- true if
objis equal to this terminal character.
-
hashCode
public int hashCode()
Assure that equal tokens return the same hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code.
-
toString
public java.lang.String toString()
Pretty print a token.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of the object.
-
-