Class NestedBaseTokens
- java.lang.Object
-
- com.tangosol.coherence.dsltools.base.BaseToken
-
- com.tangosol.coherence.dsltools.base.CompoundBaseToken
-
- com.tangosol.coherence.dsltools.base.NestedBaseTokens
-
public class NestedBaseTokens extends CompoundBaseToken
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
Constructors Constructor Description NestedBaseTokens(char chStart, char chEnd, BaseToken[] aTokens)Construct a new NestedBaseTokens with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description chargetNestEnd()Obtain the character that ends the nesting.chargetNestStart()Obtain the character that begins the nesting.BaseToken[]getTokens()Return an array of BaseTokens making up the receiver.booleanisNest()Answer whether this token represents a nested collection of tokens.StringtoString()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 Detail
-
NestedBaseTokens
public NestedBaseTokens(char chStart, char chEnd, BaseToken[] aTokens)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 Detail
-
getTokens
public BaseToken[] getTokens()
Return an array of BaseTokens making up the receiver.- Specified by:
getTokensin 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
public String toString()
Return a human-readable description for this token.- Overrides:
toStringin classCompoundBaseToken- Returns:
- a String description of the token
-
-