public class TokenStreamSelector extends Object implements TokenStream, IASDebugStream
| Modifier and Type | Field and Description |
|---|---|
protected TokenStream |
input
The currently-selected token stream input
|
protected Hashtable |
inputStreamNames
The set of inputs to the MUX
|
protected Stack |
streamStack
Used to track stack of input streams
|
| Constructor and Description |
|---|
TokenStreamSelector() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInputStream(TokenStream stream,
String key) |
TokenStream |
getCurrentStream()
Return the stream from tokens are being pulled at
the moment.
|
String |
getEntireText()
Returns the entire text input to the lexer.
|
TokenOffsetInfo |
getOffsetInfo(Token token)
Returns the offset information for the token
|
TokenStream |
getStream(String sname) |
Token |
nextToken() |
TokenStream |
pop() |
void |
push(String sname) |
void |
push(TokenStream stream) |
void |
retry()
Abort recognition of current Token and try again.
|
void |
select(String sname) |
void |
select(TokenStream stream)
Set the stream without pushing old stream
|
protected Hashtable inputStreamNames
protected TokenStream input
protected Stack streamStack
public void addInputStream(TokenStream stream, String key)
public TokenStream getCurrentStream()
public TokenStream getStream(String sname)
public Token nextToken() throws TokenStreamException
nextToken in interface TokenStreamTokenStreamExceptionpublic TokenStream pop()
public void push(TokenStream stream)
public void push(String sname)
public void retry()
throws TokenStreamRetryException
TokenStreamRetryExceptionpublic void select(TokenStream stream)
public void select(String sname) throws IllegalArgumentException
IllegalArgumentExceptionpublic String getEntireText()
IASDebugStreamgetEntireText in interface IASDebugStreamnull, if error occured or System.in was used.public TokenOffsetInfo getOffsetInfo(Token token)
IASDebugStreamgetOffsetInfo in interface IASDebugStreamtoken - the token whose information need to be retrievednullCopyright © 2017–2019 Eclipse Foundation. All rights reserved.