Class NestedBaseTokens
java.lang.Object
com.tangosol.coherence.dsltools.base.BaseToken
com.tangosol.coherence.dsltools.base.CompoundBaseToken
com.tangosol.coherence.dsltools.base.NestedBaseTokens
NestedBaseTokens is a token that holds a sequence of tokens as well as the
two bracketing characters. This nesting of tokens makes many algorithms
easier in the higher levels of a parser.
- Author:
- djl 2009.03.14
-
Constructor Summary
ConstructorDescriptionNestedBaseTokens
(char chStart, char chEnd, BaseToken[] aTokens) Construct a new NestedBaseTokens with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionchar
Obtain the character that ends the nesting.char
Obtain the character that begins the nesting.Return an array of BaseTokens making up the receiver.boolean
isNest()
Answer whether this token represents a nested collection of tokens.toString()
Return a human-readable description for this token.Methods inherited from class com.tangosol.coherence.dsltools.base.CompoundBaseToken
get, isCompound, isLeaf, match, size
Methods inherited from class com.tangosol.coherence.dsltools.base.BaseToken
getSimpleName, isIdentifier, isLiteral, isOperator, isPunctuation, match
-
Constructor Details
-
NestedBaseTokens
Construct a new NestedBaseTokens with the given parameters.- Parameters:
chStart
- the character that starts the nestingchEnd
- the character that ends the nestingaTokens
- the right argument for the node
-
-
Method Details
-
getTokens
Return an array of BaseTokens making up the receiver.- Specified by:
getTokens
in classCompoundBaseToken
- Returns:
- the an array of BaseTokens making up the receiver.
-
isNest
public boolean isNest()Answer whether this token represents a nested collection of tokens. -
getNestStart
public char getNestStart()Obtain the character that begins the nesting.- Returns:
- the character that begings the nesting
-
getNestEnd
public char getNestEnd()Obtain the character that ends the nesting.- Returns:
- the character that ends the nesting
-
toString
Return a human-readable description for this token.- Overrides:
toString
in classCompoundBaseToken
- Returns:
- a String description of the token
-