java.lang.Object
net.luis.utils.io.token.definition.WordTokenDefinition
- All Implemented Interfaces:
TokenDefinition,TokenRule
Token definition for a word.
This token definition matches a string that is not empty.
It should be used for tokens that cannot be defined by a single character or string.
An example would be identifiers in programming languages.
This token definition matches a string that is not empty.
It should be used for tokens that cannot be defined by a single character or string.
An example would be identifiers in programming languages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WordTokenDefinitionSingleton instance of the word token definition. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.luis.utils.io.token.definition.TokenDefinition
matchMethods inherited from interface net.luis.utils.io.token.rule.rules.TokenRule
optional, repeatAtLeast, repeatAtMost, repeatBetween, repeatExactly, repeatInfinitely
-
Field Details
-
INSTANCE
Singleton instance of the word token definition.
-
-
Constructor Details
-
WordTokenDefinition
private WordTokenDefinition()Private constructor to prevent instantiation.
-
-
Method Details
-
matches
Description copied from interface:TokenDefinitionChecks if the given word matches this token definition.- Specified by:
matchesin interfaceTokenDefinition- Parameters:
word- The word to check- Returns:
- True if the word matches this token definition, false otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-