MergeableToken Class
Represents the default implementation of an IToken that can be used with an IMergeableLexer.
public class MergeableToken : TokenBase, IMergeableToken, IToken
- Implements:
- IMergeableToken IToken
Constructors
MergeableToken(int, int, TextPosition, TextPosition, MergeableLexerFlags, ILexicalState, IMergeableTokenLexerData?)
Represents the default implementation of an IToken that can be used with an IMergeableLexer.
public MergeableToken(int startOffset, int length, TextPosition startPosition, TextPosition endPosition, MergeableLexerFlags lexerFlags, ILexicalState lexicalState, IMergeableTokenLexerData? lexerData)
| Parameter | Type | Description |
|---|---|---|
| startOffset | int | The start offset of the token. |
| length | int | The length of the token. |
| startPosition | TextPosition | The TextPosition of the first character in the token. |
| endPosition | TextPosition | The TextPosition after the last character in the token. |
| lexerFlags | MergeableLexerFlags | The MergeableLexerFlags for the token. |
| lexicalState | ILexicalState | The ILexicalState that contains the token. |
| lexerData | IMergeableTokenLexerData | The IMergeableTokenLexerData that contains the lexer information about the token. |
Properties
AutoCaseCorrectText
The text that should be used for this IToken when performing an auto case correction operation on it.
public virtual string? AutoCaseCorrectText { get; }
Property Value
Remarks
Return a null value to indicate that there is no auto case correction text available.
ClassificationType
The IClassificationType assigned to the token.
DeclaringLexicalState
The ILexicalState that declares the pattern that matched the token.
Id
The ID assigned to the token.
Key
The key assigned to the token.
Lexer
The IMergeableLexer that created the token.
LexerData
An IMergeableTokenLexerData that contains lexer information for the token.
LexerFlags
A MergeableLexerFlags indicating lexer flags for the token.
LexicalScope
The ILexicalScope, if any, that defines the token.
public virtual ILexicalScope? LexicalScope { get; }
Property Value
Remarks
If this value is null, the token was not defined by a lexical scope.
LexicalState
The ILexicalState that contains the token.
LexicalStateId
The ID assigned to the lexical state that contains the token.
Methods
HasFlag(MergeableLexerFlags)
Returns whether the parse data has the specified MergeableLexerFlags flag.
public virtual bool HasFlag(MergeableLexerFlags flag)
| Parameter | Type | Description |
|---|---|---|
| flag | MergeableLexerFlags | The MergeableLexerFlags to check for. |
Returns
- bool:
trueif the parse data has the specified MergeableLexerFlags flag; otherwise,false.
SetFlag(MergeableLexerFlags, bool)
Sets or clears the specified MergeableLexerFlags flag.
public virtual void SetFlag(MergeableLexerFlags flag, bool setBit)
| Parameter | Type | Description |
|---|---|---|
| flag | MergeableLexerFlags | The MergeableLexerFlags to set or clear. |
| setBit | bool | Whether to set the flag; otherwise, the flag is cleared. |
Remarks
This method should only be called by lexers.
Inherited Members
- TokenBase.Contains(int)
- TokenBase.Contains(TextPosition)
- TokenBase.Equals(object)
- TokenBase.GetHashCode()
- TokenBase.ToString()
- TokenBase.ToString(string)
- TokenBase.EndOffset
- TokenBase.EndPosition
- TokenBase.Length
- TokenBase.PositionRange
- TokenBase.StartOffset
- TokenBase.StartPosition
- TokenBase.TextRange
- object.GetType()
- object.MemberwiseClone()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)