Class BaseToken
- java.lang.Object
-
- com.tangosol.coherence.dsltools.base.BaseToken
-
- Direct Known Subclasses:
CompoundBaseToken,LeafBaseToken
public abstract class BaseToken extends Object
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
Constructors Constructor Description BaseToken()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetSimpleName()Return the simple class name for this instance.abstract booleanisCompound()Answer whether this token is a compound token.booleanisIdentifier()Answer whether this token represents an identifier.abstract booleanisLeaf()Answer whether this token is a leaf token.booleanisLiteral()Answer whether this token represents a literal.booleanisNest()Answer whether this token represents a nested collection of tokens.booleanisOperator()Answer whether this token represents a know operator.booleanisPunctuation()Answer whether this token represents a punctuation character.booleanmatch(String s)Answer whether this token matches the given string.abstract booleanmatch(String s, boolean fIgnoreCaseFlag)Answer whether this token matches the given string.
-
-
-
Method Detail
-
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
public boolean match(String s)
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
public abstract boolean match(String s, boolean fIgnoreCaseFlag)
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
public String getSimpleName()
Return the simple class name for this instance.- Returns:
- the class name without the package path
-
-