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 | Class and Description |
---|---|
class |
Language<T extends TokenId>
Language describes a set of token ids
that comprise the given language.
|
class |
Token<T extends TokenId>
Token describes a lexical element of input text.
|
class |
TokenChange<T extends TokenId>
Token change describes modification on one level of a token hierarchy.
|
class |
TokenSequence<T extends TokenId>
Token sequence allows to iterate between tokens
of a token hierarchy.
|
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 Reader,T extends TokenId> |
TokenHierarchy.create(I inputReader,
Language<T> language,
Set<T> skipTokenIds,
InputAttributes inputAttributes)
Create token hierarchy for the given reader.
|
<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.
|
<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 |
---|---|
static Language<? extends TokenId> |
Language.find(String mimeType)
Finds a language by its mime type.
|
Modifier and Type | Class and Description |
---|---|
class |
LanguageEmbedding<T extends TokenId>
Description of a particular language embedding including
starting and ending skipped regions of a token containing this embedding
and a definition of an embedded language hierarchy.
|
class |
LanguageHierarchy<T extends TokenId>
Definition of a language, its lexer and its embedded languages.
|
interface |
Lexer<T extends TokenId>
Lexer reads input characters from
LexerInput and groups
them into tokens. |
class |
LexerRestartInfo<T extends TokenId>
Lexer restart info contains all the necessary information for restarting
of a lexer mainly the lexer input, state and token factory.
|
class |
TokenFactory<T extends TokenId>
Lexer should delegate all the token instances creation to this class.
|
interface |
TokenPropertyProvider<T extends TokenId>
Provides extra properties of a token.
|
interface |
TokenValidator<T extends TokenId>
Token validator checks whether an existing token was affected
by just performed input source modification so that it needs to be relexed.
|
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.
|
Modifier and Type | Method and Description |
---|---|
static TokenId |
LanguageHierarchy.newId(String name,
int ordinal)
Create a default token id instance in case the token ids
are generated (not created by enum class).
|
static TokenId |
LanguageHierarchy.newId(String name,
int ordinal,
String primaryCategory)
Create a default token id instance in case the token ids
are generated (not created by enum class).
|