Package org.nineml.coffeegrinder.tokens
Class TokenRegex
java.lang.Object
org.nineml.coffeegrinder.util.Decoratable
org.nineml.coffeegrinder.tokens.Token
org.nineml.coffeegrinder.tokens.TokenRegex
A regular expression token
Token.-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TokenRegexCreate a token for the specified regular expression.static TokenRegexget(String expr, Collection<ParserAttribute> attributes) Create a token for the specified regular expression (with attributes)static TokenRegexget(String expr, ParserAttribute attribute) Create a token for the specified regular expression (with an attribute)getValue()Get the regular expression.inthashCode()final Stringfinal booleanDoes this token match the input token?toString()Methods inherited from class org.nineml.coffeegrinder.util.Decoratable
addAttribute, addAttributes, getAttribute, getAttributes, getAttributesMap, getAttributeValue, hasAttribute
-
Method Details
-
get
Create a token for the specified regular expression.- Parameters:
expr- the expression- Returns:
- the token
-
get
Create a token for the specified regular expression (with an attribute)- Parameters:
expr- the expressionattribute- the attribute- Returns:
- the token
- Throws:
NullPointerException- if the attribute is null
-
get
Create a token for the specified regular expression (with attributes)- Parameters:
expr- the expressionattributes- the attributes- Returns:
- the token
-
getValue
Get the regular expression. -
matches
Does this token match the input token?A regular expression token matches a
TokenCharacterorTokenStringif the regular expression matches the value. Returns fals for all other kinds of tokens. -
matches
-
equals
-
hashCode
public int hashCode() -
toString
-