Package | Description |
---|---|
org.netbeans.api.lexer |
The entrance point into Lexer API is
TokenHierarchy class with
its static methods that provide its instance for the given input source. |
org.netbeans.spi.lexer |
The main abstract class in the Lexer SPI that must be implemented
is
LanguageHierarchy that mainly defines
set of token ids and token categories for the new language
and its Lexer . |
Modifier and Type | Method and Description |
---|---|
Token<T> |
Token.joinToken()
Get a complete token that is joined from multiple parts (this token is one of those parts).
|
Token<T> |
TokenSequence.offsetToken()
Similar to
TokenSequence.token() but always returns a non-flyweight token
with the appropriate offset. |
Token<T> |
TokenSequence.token()
Get token to which this token sequence points to or null
if TS is positioned between tokens
(
TokenSequence.moveNext() or TokenSequence.movePrevious() were not called yet). |
Modifier and Type | Field and Description |
---|---|
static Token |
TokenFactory.SKIP_TOKEN
Deprecated.
Use
TokenFactory.isSkipToken(Token) instead. |
Modifier and Type | Method and Description |
---|---|
Token<T> |
TokenFactory.createCustomTextToken(T id,
CharSequence text,
int length,
PartType partType)
Deprecated.
This method is deprecated without replacement - see description
how a similar effect can be obtained.
|
Token<T> |
TokenFactory.createPropertyToken(T id,
int length,
TokenPropertyProvider<T> propertyProvider)
Create complete token with properties.
|
Token<T> |
TokenFactory.createPropertyToken(T id,
int length,
TokenPropertyProvider<T> propertyProvider,
PartType partType)
Create token with properties.
|
Token<T> |
TokenFactory.createToken(T id)
Create token with token length corresponding
to the number of characters read from the lexer input.
|
Token<T> |
TokenFactory.createToken(T id,
int length)
Create regular token instance with an explicit length.
|
Token<T> |
TokenFactory.createToken(T id,
int length,
PartType partType)
Create regular token instance with an explicit length and part type.
|
Token<T> |
TokenFactory.getFlyweightToken(T id,
String text)
Get flyweight token for the given arguments.
|
Token<T> |
Lexer.nextToken()
Return a token based on characters of the input
and possibly additional input properties.
|
Token<T> |
TokenValidator.validateToken(Token<T> token,
TokenFactory<T> factory,
CharSequence tokenText,
int modRelOffset,
int removedLength,
CharSequence removedText,
int insertedLength,
CharSequence insertedText)
This method is invoked in mutable environments prior lexer invocation
to check whether token in which the text modification occurred
was only slightly modified by the performed modification and the lexer's
invocation is not necessary.
|
Modifier and Type | Method and Description |
---|---|
protected LanguageEmbedding<?> |
LanguageHierarchy.embedding(Token<T> token,
LanguagePath languagePath,
InputAttributes inputAttributes)
Get language embedding (if exists) for a particular token
of the language at this level of language hierarchy.
|
abstract LanguageEmbedding<?> |
LanguageProvider.findLanguageEmbedding(Token<?> token,
LanguagePath languagePath,
InputAttributes inputAttributes)
Finds
LanguageEmbedding that will define what language is
embedded in a given token. |
Object |
TokenPropertyProvider.getValue(Token<T> token,
Object key)
Get value of a token property.
|
boolean |
TokenFactory.isSkipToken(Token<T> token)
Check whether a token (produced by one of the token creation methods)
is a special flyweight token used in cases
when there is an active filtering of certain token ids (e.g.
|
Token<T> |
TokenValidator.validateToken(Token<T> token,
TokenFactory<T> factory,
CharSequence tokenText,
int modRelOffset,
int removedLength,
CharSequence removedText,
int insertedLength,
CharSequence insertedText)
This method is invoked in mutable environments prior lexer invocation
to check whether token in which the text modification occurred
was only slightly modified by the performed modification and the lexer's
invocation is not necessary.
|