Class BaseToken
java.lang.Object
com.tangosol.coherence.dsltools.base.BaseToken
- Direct Known Subclasses:
CompoundBaseToken
,LeafBaseToken
BaseToken is the abstract base class for all tokens processed by the low
level BaseTokenScanner. The resulting hierarchy represents very simple
syntactic elements.
- Author:
- djl 2009.03.14
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the simple class name for this instance.abstract boolean
Answer whether this token is a compound token.boolean
Answer whether this token represents an identifier.abstract boolean
isLeaf()
Answer whether this token is a leaf token.boolean
Answer whether this token represents a literal.boolean
isNest()
Answer whether this token represents a nested collection of tokens.boolean
Answer whether this token represents a know operator.boolean
Answer whether this token represents a punctuation character.boolean
Answer whether this token matches the given string.abstract boolean
Answer whether this token matches the given string.
-
Constructor Details
-
BaseToken
public BaseToken()
-
-
Method Details
-
isLeaf
public abstract boolean isLeaf()Answer whether this token is a leaf token.- Returns:
- the answer to the question "is this token a leaf?"
-
isCompound
public abstract boolean isCompound()Answer whether this token is a compound token.- Returns:
- the answer to the question "is this token compound?"
-
isLiteral
public boolean isLiteral()Answer whether this token represents a literal.- Returns:
- the answer to the question "is this token a literal?"
-
isOperator
public boolean isOperator()Answer whether this token represents a know operator.- Returns:
- the answer to the question "is this token an operator?"
-
isIdentifier
public boolean isIdentifier()Answer whether this token represents an identifier.- Returns:
- the answer to the question "is this token an identifier?"
-
isNest
public boolean isNest()Answer whether this token represents a nested collection of tokens.- Returns:
- the answer to the question "is this token a nesting of tokens?"
-
isPunctuation
public boolean isPunctuation()Answer whether this token represents a punctuation character.- Returns:
- the answer to the question "is this token a punctuation character?"
-
match
Answer whether this token matches the given string. By default case matters.- Parameters:
s
- the String to match agains- Returns:
- the answer to the question "does this token match a given string?
-
match
Answer whether this token matches the given string.- Parameters:
s
- the String to match againsfIgnoreCaseFlag
- the flag that controls if case matters- Returns:
- the answer to the question "does this token match a given string?
-
getSimpleName
Return the simple class name for this instance.- Returns:
- the class name without the package path
-