Provides the base requirements for a lexer (lexical analyzer) for a language that supports merging with other languages.
Properties
DefaultLexicalState
Gets or sets the root ILexical
Property Value
- ILexical
State : The root ILexical
State for when the language is entered.
LexicalStateIdProvider
Gets the ILexical
Property Value
- ILexical
State :Id Provider The ILexical
State that provides access to all the lexical state IDs and keys used by this lexer.Id Provider
Methods
CreateChangeBatch()
Creates an IDisposable object such that while the object is not disposed, the lexer can be modified without any change events being fired, thereby allowing batch updates to occur.
Returns
- IDisposable:
An IDisposable object. Once disposed, the batch is ended.
CreateDocumentEndToken(int, TextPosition, ILexicalState)
Creates an IMergable
Parameter | Type | Description |
---|---|---|
startOffset | int | The start offset of the IToken. |
startPosition | Text |
The start Text |
lexicalState | ILexical |
The ILexical |
Returns
- IMergable
Token : An IMergable
Token that represents the end of a document.
CreateToken(int, int, TextPosition, TextPosition, MergableLexerFlags, ILexicalState, IMergableTokenLexerData)
Creates an IMergable
Parameter | Type | Description |
---|---|---|
startOffset | int | The start offset of the token. |
length | int | The length of the token. |
startPosition | Text |
The Text |
endPosition | Text |
The Text |
lexerFlags | Mergable |
The Mergable |
lexicalState | ILexical |
The ILexical |
lexerData | IMergable |
The IMergable |
Returns
- IMergable
Token : An IMergable
Token that represents the range of text with the specified lexer data.
GetAllLexicalStateTransitions()
Returns a collection containing all ILexical
Returns
- IEnumerable<ILexical
State >:Transition A collection containing all ILexical
State objects within the lexer.Transition
Remarks
This method allows consumers to see which language transitions can be made within the lexer.
GetDefaultToken(ITextBufferReader, ILexicalState)
Returns a single-character Mergable
Parameter | Type | Description |
---|---|---|
reader | IText |
An IText |
lexicalState | ILexical |
The ILexical |
Returns
- Mergable
Lexer :Result A Mergable
Lexer indicating the lexer result.Result
GetNextToken(ITextBufferReader, ILexicalState)
Performs a lex to return the next Mergable
Parameter | Type | Description |
---|---|---|
reader | IText |
An IText |
lexicalState | ILexical |
The ILexical |
Returns
- Mergable
Lexer :Result A Mergable
Lexer indicating the lexer result.Result
Events
Changed
Occurs after the lexer is changed via a block of code surrounded by Create