public final class StreamingTokenBuffer extends BaseRepairingTokenBuffer implements IRepairingTokenBuffer
eofToken, errors, insertSemis, nextIsSemicolon, position, SEMICOLON| Constructor and Description |
|---|
StreamingTokenBuffer(StreamingASTokenizer tokens) |
| Modifier and Type | Method and Description |
|---|---|
void |
consume()
Consumes the current token in the buffer
|
String |
getSourcePath() |
IASToken[] |
getTokens(boolean includeInserted) |
boolean |
insertSemicolon(boolean isNextToken)
Inserts a semicolon into the token stream
|
protected ASToken |
lookAheadSkipInsertedSemicolon(int i)
Look-ahead "i" tokens and ignore
BaseRepairingTokenBuffer.insertSemis flag. |
boolean |
matchOptionalSemicolon()
Match optional semicolon.
|
ASToken |
previous()
Returns the previous token the buffer was looking at
|
void |
rewind(int position)
Rewinds the token buffer to the given position.
|
addError, LA, lookAheadSkipInsertedSemicolon, LT, mark, onSemicolonInserted, setEnableSemicolonInsertionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddError, LA, lookAheadSkipInsertedSemicolon, LT, mark, setEnableSemicolonInsertionpublic StreamingTokenBuffer(StreamingASTokenizer tokens)
public String getSourcePath()
public final boolean insertSemicolon(boolean isNextToken)
IRepairingTokenBufferinsertSemicolon in interface IRepairingTokenBufferisNextToken - true if the semicolon should be the next tokenpublic void rewind(int position)
IRepairingTokenBufferrewind in interface IRepairingTokenBufferposition - the non-negative positionpublic final void consume()
IRepairingTokenBufferconsume in interface IRepairingTokenBufferprotected ASToken lookAheadSkipInsertedSemicolon(int i)
BaseRepairingTokenBufferBaseRepairingTokenBuffer.insertSemis flag. Subclasses
provide implementations specific to how they access the token buffer.public IASToken[] getTokens(boolean includeInserted)
public ASToken previous()
IRepairingTokenBufferprevious in interface IRepairingTokenBufferpublic boolean matchOptionalSemicolon()
This function implements the first 2 optional semicolon insertion rules in the ECMA specification.
matchOptionalSemicolon in interface IRepairingTokenBufferCopyright © 2016 The Apache Software Foundation. All rights reserved.