CSharpLexer Class
Represents a C# lexer (lexical analyzer) implementation.
public class CSharpLexer : DotNetLexerBase, IMergeableLexer, ILexer, IKeyedObject
- Inheritance:
- object MergeableLexerBase DotNetLexerBase object
- Implements:
- IMergeableLexer ILexer IKeyedObject
Constructors
CSharpLexer()
Initializes an instance of the class.
public CSharpLexer()
Properties
LexicalStates
The collection of lexical states used by this lexer.
OtherPreprocessorDirectives
The collection of other preprocessor directives that can be recognized, beyond those in the C# specification.
public static ISet<string> OtherPreprocessorDirectives { get; }
Property Value
Remarks
Do not include the '#' character in any added names.
For instance, if a custom preprocessor directive to support is #load, add "load" to this collection.
Methods
GetAllLexicalStateTransitions()
Returns a collection containing all ILexicalStateTransition objects within the lexer.
public override IEnumerable<ILexicalStateTransition> GetAllLexicalStateTransitions()
Returns
Remarks
This method allows consumers to see which language transitions can be made within the lexer.
GetNextToken(ITextBufferReader, ILexicalState)
Performs a lex to return the next MergeableLexerResult from a ITextBufferReader and seeks past it if there is a match.
public override MergeableLexerResult GetNextToken(ITextBufferReader reader, ILexicalState lexicalState)
| Parameter | Type | Description |
|---|---|---|
| reader | ITextBufferReader | An ITextBufferReader that is reading a text source. |
| lexicalState | ILexicalState | The ILexicalState that specifies the current state. |
Returns
Inherited Members
- MergeableLexerBase.CreateChangeBatch()
- MergeableLexerBase.CreateDocumentEndToken(int, TextPosition, ILexicalState)
- MergeableLexerBase.CreateToken(int, int, TextPosition, TextPosition, MergeableLexerFlags, ILexicalState, IMergeableTokenLexerData)
- MergeableLexerBase.GetDefaultToken(ITextBufferReader, ILexicalState)
- MergeableLexerBase.GetIncrementalParseRange(TextSnapshotRange)
- MergeableLexerBase.OnChanged(EventArgs)
- MergeableLexerBase.Parse(TextSnapshotRange, ILexerTarget)
- MergeableLexerBase.DefaultLexicalStateCore
- MergeableLexerBase.KeyCore
- MergeableLexerBase.LexicalStateIdProviderCore
- MergeableLexerBase.TokenIdProviderCore
- MergeableLexerBase.Changed
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()