public abstract class AbstractIndentationTokenSource extends AbstractSplittingTokenSource
Modifier and Type | Field and Description |
---|---|
protected int |
currentEnd |
protected int |
currentIndentation |
protected int |
currentOffset |
protected java.util.Stack<java.lang.Integer> |
indentationStack |
protected int |
nextOffset |
LEXER_RULE_PREFIX
Modifier | Constructor and Description |
---|---|
protected |
AbstractIndentationTokenSource(org.antlr.runtime.TokenSource delegate) |
Modifier and Type | Method and Description |
---|---|
protected int |
computeIndentation(java.lang.String text) |
protected org.antlr.runtime.Token |
createBeginToken(int offset) |
protected org.antlr.runtime.Token |
createEndToken(int offset) |
protected void |
doSplitToken(org.antlr.runtime.Token token,
ITokenAcceptor result) |
protected void |
doSplitTokenImpl(org.antlr.runtime.Token token,
ITokenAcceptor result)
The token was previously determined as potentially to-be-splitted.
|
protected abstract int |
getBeginTokenType() |
protected abstract int |
getEndTokenType() |
protected char |
getTabWidth() |
org.antlr.runtime.Token |
nextToken() |
protected boolean |
shouldEmitPendingEndTokens() |
protected boolean |
shouldSplitToken(org.antlr.runtime.Token token) |
protected abstract boolean |
shouldSplitTokenImpl(org.antlr.runtime.Token token)
Return
true if the given token is a whitespace token that should be splitted. |
createToken, getDelegate, getLexerRuleName, getRuleName, getSourceName, getTokenType, initializeTokenDefsFrom, setDelegate, splitToken
protected java.util.Stack<java.lang.Integer> indentationStack
protected int currentOffset
protected int currentIndentation
protected int currentEnd
protected int nextOffset
protected AbstractIndentationTokenSource(org.antlr.runtime.TokenSource delegate)
protected boolean shouldSplitToken(org.antlr.runtime.Token token)
shouldSplitToken
in class AbstractSplittingTokenSource
protected abstract boolean shouldSplitTokenImpl(org.antlr.runtime.Token token)
true
if the given token is a whitespace token that should be splitted.
Usually the token type will be compared to one of the int constants from the parser.protected void doSplitToken(org.antlr.runtime.Token token, ITokenAcceptor result)
doSplitToken
in class AbstractSplittingTokenSource
protected boolean shouldEmitPendingEndTokens()
public org.antlr.runtime.Token nextToken()
nextToken
in interface org.antlr.runtime.TokenSource
nextToken
in class AbstractSplittingTokenSource
protected void doSplitTokenImpl(org.antlr.runtime.Token token, ITokenAcceptor result)
protected org.antlr.runtime.Token createEndToken(int offset)
protected abstract int getEndTokenType()
protected abstract int getBeginTokenType()
protected org.antlr.runtime.Token createBeginToken(int offset)
protected int computeIndentation(java.lang.String text)
protected char getTabWidth()