Module net.luis.utils
Package net.luis.utils.io.token.rule.rules
package net.luis.utils.io.token.rule.rules
-
ClassDescriptionA token rule that always matches a single token if the start index is valid.
This rule is useful for testing or as a default case in a chain of token rules.
This class is implemented as a singleton and can be accessed viaTokenRules.alwaysMatch()
orAlwaysMatchTokenRule.INSTANCE
.A token rule that matches any of the provided token rules.
The first matching rule will be used to create theTokenRuleMatch
.
This rule is useful for creating complex matching logic by combining multiple rules.A token rule that matches a sequence of tokens with a start, between, and end token rule.
This rule is useful for matching patterns that have a specific structure, such as a start and end delimiter with optional content in between.
The start and end token rules are required, while the between token rule can match zero or infinite tokens.
The start and between token rule must not be or contain anEndTokenRule
or any other token rule class that is added toBoundaryTokenRule.INVALID_RULES
.A token rule that always matches the end of the token list.
This rule is useful to ensure that the end of the token list is reached.
The rule will only match if the start index is larger than or equal to the size of the token list.
This class is implemented as a singleton and can be accessed viaTokenRules.end()
orEndTokenRule.INSTANCE
.A token rule that matches optionally a single token rule.
This rule is useful for creating optional matching logic.
It will match the token rule if it is present, otherwise it will return an empty match.A token rule that matches the value of a single token against a regular expression pattern.
This rule is useful for creating complex matching logic by using regular expressions.
It will match the token if its value matches the pattern, otherwise it will return null.A token rule that matches a token rule a number of times.
This rule is useful for creating complex matching logic by repeating a rule.
It will match the token rule a number of times between the min and max occurrences.
If the min and max occurrences are the same, it will match exactly that number of times.A token rule that matches a sequence of token rules.
This rule is useful for creating complex matching logic by combining multiple rules.
It will match the token rules in the order they are provided, otherwise it will return null.A functional interface representing a rule for matching tokens in a list.
It defines a method to match tokens starting from a given index and returns aTokenRuleMatch
if successful.A utility class for creating token rules.