Package io.deephaven.lang.generated
Class BaseToken
java.lang.Object
io.deephaven.lang.generated.BaseToken
- All Implemented Interfaces:
Comparable<BaseToken>
- Direct Known Subclasses:
Token
A supertype for our generated token class.
This is cleaner than us maintaining a complete copy of Token
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddBackLinks
(Token until) int
boolean
contains
(DocumentRangeOrBuilder replaceRange) boolean
containsIndex
(int desired) boolean
void
dump()
int
int
next()
Converts our 1-indexed javacc end token to a 0-indexed LSP Position.positionEnd
(boolean considerEof) Converts our 1-indexed javacc end token to a 0-indexed LSP Position.Converts our 1-indexed javacc start token to a 0-indexed LSP Positionprev()
special()
int
Returns an iterable which runs backwards from this token.
-
Field Details
-
startIndex
public int startIndex -
endIndex
public int endIndex -
tokenBegin
public int tokenBegin -
detached
public boolean detached
-
-
Constructor Details
-
BaseToken
public BaseToken()
-
-
Method Details
-
addBackLinks
-
addBackLinks
-
prev
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BaseToken>
-
containsIndex
public boolean containsIndex(int desired) -
getEndIndex
public int getEndIndex() -
getStartIndex
public int getStartIndex() -
specialTokenLength
public int specialTokenLength() -
copyToken
-
next
-
special
-
getNextNonWhitespace
-
dump
-
positionStart
Converts our 1-indexed javacc start token to a 0-indexed LSP Position -
positionEnd
Converts our 1-indexed javacc end token to a 0-indexed LSP Position. Does not consider javacc's weird EOF handling specially; the final end position will land outside the document's actual range, which is perfectly acceptable to Monaco when telling it what chars to replace (it's actually required when the cursor is at the end of the document; a common occurrence). -
positionEnd
Converts our 1-indexed javacc end token to a 0-indexed LSP Position.- Parameters:
considerEof
- Whether or not to normalize javacc's weird EOF token handling. Normally false, which allows the position to exceed the document's size. This is acceptable to Monaco. EOF is only considered during internal operations when we are looking up tokens from cursor positions (and can likely be refactored / deleted when we stop using absolute cursor positions).- Returns:
- A 0-indexed Position describing the end of this token.
-
toReverse
Returns an iterable which runs backwards from this token. If you specify an end token, the iterator will include that token and stop. If an end token is not specified, the iterable will run backwards until the start token.- Parameters:
end
- optional end token, if specified, will be the last token returned by iterator.
-
to
-
containsPosition
-
contains
-