Package org.nineml.coffeegrinder.tokens
Class TokenUndefined
- java.lang.Object
-
- org.nineml.coffeegrinder.util.Decoratable
-
- org.nineml.coffeegrinder.tokens.Token
-
- org.nineml.coffeegrinder.tokens.TokenUndefined
-
public class TokenUndefined extends Token
A token that can match nothing.This is used to provide a "right hand side" for undefined tokens. They can't match anything.
-
-
Field Summary
Fields Modifier and Type Field Description static TokenUndefinedundefinedThe undefined token.
-
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
-
undefined
public static final TokenUndefined undefined
The undefined 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?No, it does not.
-
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.The singleton
TokenUndefinedis only equal to itself.- 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.
-
-