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 |
---|---|
static Language<? extends TokenId> |
Language.find(String mimeType)
Finds a language by its mime type.
|
Language<?> |
LanguagePath.innerLanguage()
Return the most inner language of this path.
|
Language<T> |
TokenSequence.language()
Get the language describing token ids
used by tokens in this token sequence.
|
Language<T> |
TokenChange.language()
Get the language describing token ids
used by tokens contained in this token change.
|
Language<?> |
LanguagePath.language(int index)
Get language of this language path at the given index.
|
Language<?> |
LanguagePath.topLanguage()
Return the top-level language of this language path.
|
Modifier and Type | Method and Description |
---|---|
static <I extends CharSequence,T extends TokenId> |
TokenHierarchy.create(I inputText,
boolean copyInputText,
Language<T> language,
Set<T> skipTokenIds,
InputAttributes inputAttributes)
Create token hierarchy for the given input text.
|
static <I extends CharSequence> |
TokenHierarchy.create(I inputText,
Language<?> language)
Create token hierarchy for the given non-mutating input text (for example
java.lang.String).
|
static <I extends Reader,T extends TokenId> |
TokenHierarchy.create(I inputReader,
Language<T> language,
Set<T> skipTokenIds,
InputAttributes inputAttributes)
Create token hierarchy for the given reader.
|
boolean |
TokenSequence.createEmbedding(Language<?> embeddedLanguage,
int startSkipLength,
int endSkipLength)
Create language embedding without joining of the embedded sections.
|
boolean |
TokenSequence.createEmbedding(Language<?> embeddedLanguage,
int startSkipLength,
int endSkipLength,
boolean joinSections)
Create language embedding described by the given parameters.
|
LanguagePath |
LanguagePath.embedded(Language<?> language)
Get embedded path of this language path.
|
<ET extends TokenId> |
TokenSequence.embedded(Language<ET> embeddedLanguage)
Get embedded token sequence if the token
to which this token sequence is currently positioned
has a language embedding.
|
<ET extends TokenId> |
TokenSequence.embeddedJoined(Language<ET> embeddedLanguage)
Get embedded token sequence if the token
to which this token sequence is currently positioned
has a language embedding.
|
static LanguagePath |
LanguagePath.get(Language<?> language)
Get language path that contains a single language.
|
static LanguagePath |
LanguagePath.get(LanguagePath prefix,
Language<?> language)
Get language path corresponding to the language embedded in the given context
language path.
|
boolean |
TokenSequence.removeEmbedding(Language<?> embeddedLanguage)
Remove previously created language embedding.
|
void |
InputAttributes.setValue(Language<?> language,
Object attributeKey,
Object attributeValue,
boolean global)
Assign a new value to a property for the language path constructed
from the given language.
|
<T extends TokenId> |
TokenHierarchyEvent.tokenChange(Language<T> language)
Get the token change if the top level of the token hierarchy
contains tokens of the given language.
|
<T extends TokenId> |
TokenHierarchy.tokenSequence(Language<T> language)
Get token sequence of the top level of the language hierarchy
only if it's of the given language.
|
Modifier and Type | Method and Description |
---|---|
abstract Language<?> |
LanguageProvider.findLanguage(String mimeType)
Finds
Language for a given mime type. |
Language<T> |
LanguageHierarchy.language()
Get language constructed for this language hierarchy
based on token ids and token categories provided.
|
Language<T> |
LanguageEmbedding.language()
Get the embedded language.
|
protected abstract Language<?> |
MutableTextInput.language()
Get the language suitable for lexing of this input.
|
Modifier and Type | Method and Description |
---|---|
static <T extends TokenId> |
LanguageEmbedding.create(Language<T> language,
int startSkipLength,
int endSkipLength)
Create language embedding that does not join embedded sections.
|
static <T extends TokenId> |
LanguageEmbedding.create(Language<T> language,
int startSkipLength,
int endSkipLength,
boolean joinSections)
Construct new language embedding for the given parameters
or get an existing cached one.
|