Package li.selman.jpbe.dsl.token
Class TokenSequence
java.lang.Object
li.selman.jpbe.dsl.token.TokenSequence
- All Implemented Interfaces:
Iterable<Token>
,DslElement
Merges a list of tokens together to a new combined token.
The whole TokenSequence must match.
If no tokens are past, the sequence matches everything
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Note that the size of the DslElement and the size oftokens
can differ! Do not use this method to get the number of tokens in the sequence.int
int
hashCode()
boolean
isEmpty()
iterator()
static TokenSequence
static TokenSequence
int
toString()
union
(TokenSequence other) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
-
of
-
getTokens
-
getNumberOfTokens
public int getNumberOfTokens() -
isEmpty
public boolean isEmpty() -
getLastToken
- Returns:
- the last token or
null
if the sequence is empty
-
getMergedPattern
-
union
-
sequenceLength
public int sequenceLength()- Returns:
- the size of
tokens
-
getDslWeight
public int getDslWeight()Note that the size of the DslElement and the size oftokens
can differ! Do not use this method to get the number of tokens in the sequence.- Specified by:
getDslWeight
in interfaceDslElement
- Returns:
- the weight of the token TokenSequence
-
iterator
-
equals
-
hashCode
public int hashCode() -
toString
-