public class TokenStreamSplitter extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static IToken |
SENTINEL_TOKEN
The sentinel token to use when splitting nested structures.
|
| Constructor and Description |
|---|
TokenStreamSplitter(java.util.List<IToken> tokens)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.util.List<IToken>> |
getTokenStreams()
Returns the split streams.
|
void |
splitNested(ETokenType openToken,
ETokenType closeToken)
Splits all streams at the given open and close tokens, e.g.
|
public static final IToken SENTINEL_TOKEN
public TokenStreamSplitter(java.util.List<IToken> tokens)
public java.util.List<java.util.List<IToken>> getTokenStreams()
public void splitNested(ETokenType openToken, ETokenType closeToken)
SENTINEL_TOKEN token.
For example: a ( b ) c would be split into
a ( sentinel ) c and b.
Outer parts are guaranteed to be stored before inner parts in the
tokenStreams list.