public abstract class AbstractIndentationTokenSource extends AbstractSplittingTokenSource
shouldEmitPendingEndTokens() returns true.| 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 int |
computeIndentationRelevantCharCount(java.lang.String text) |
protected org.antlr.runtime.Token |
createBeginToken(int offset) |
protected org.antlr.runtime.Token |
createEndToken(int offset) |
protected void |
decreaseIndentation(int indentation,
ITokenAcceptor result) |
protected void |
doSplitEofToken(org.antlr.runtime.Token token,
ITokenAcceptor result) |
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 thus we
emit additional indentation or dedenting tokens.
|
protected abstract int |
getBeginTokenType() |
protected abstract int |
getEndTokenType() |
protected char |
getTabWidth() |
protected void |
handleRemainingText(org.antlr.runtime.Token token,
java.lang.String text,
int indentation,
ITokenAcceptor result) |
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. |
protected void |
splitWithText(org.antlr.runtime.Token token,
java.lang.String text,
ITokenAcceptor result) |
createToken, getDelegate, getLexerRuleName, getRuleName, getSourceName, getTokenType, initializeTokenDefsFrom, setDelegate, splitTokenprotected 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 AbstractSplittingTokenSourceprotected 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 doSplitEofToken(org.antlr.runtime.Token token,
ITokenAcceptor result)
protected void doSplitToken(org.antlr.runtime.Token token,
ITokenAcceptor result)
doSplitToken in class AbstractSplittingTokenSourceprotected boolean shouldEmitPendingEndTokens()
public org.antlr.runtime.Token nextToken()
nextToken in interface org.antlr.runtime.TokenSourcenextToken in class AbstractSplittingTokenSourceprotected void doSplitTokenImpl(org.antlr.runtime.Token token,
ITokenAcceptor result)
protected void handleRemainingText(org.antlr.runtime.Token token,
java.lang.String text,
int indentation,
ITokenAcceptor result)
protected void decreaseIndentation(int indentation,
ITokenAcceptor result)
protected void splitWithText(org.antlr.runtime.Token token,
java.lang.String text,
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 computeIndentationRelevantCharCount(java.lang.String text)
protected int computeIndentation(java.lang.String text)
protected char getTabWidth()