In This Article

CSharpLexer Class

Represents a C# lexer (lexical analyzer) implementation.

public class CSharpLexer : DotNetLexerBase, IMergableLexer, ILexer, IKeyedObject
Inheritance:
object MergableLexerBase DotNetLexerBase object
Implements:
IMergableLexer ILexer IKeyedObject

Constructors

CSharpLexer()

Initializes a new instance of the CSharpLexer class.

public CSharpLexer()

Properties

LexicalStates

Gets the collection of lexical states used by this lexer.

public ILexicalStateCollection LexicalStates { get; }

Property Value

ILexicalStateCollection:

The collection of lexical states used by this lexer.

Methods

GetAllLexicalStateTransitions()

Returns a collection containing all ILexicalStateTransition objects within the lexer.

public override IEnumerable<ILexicalStateTransition> GetAllLexicalStateTransitions()

Returns

IEnumerable<ILexicalStateTransition>:

A collection containing all ILexicalStateTransition objects within the lexer.

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 MergableLexerResult from a ITextBufferReader and seeks past it if there is a match.

public override MergableLexerResult 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

MergableLexerResult:

A MergableLexerResult indicating the lexer result.

Inherited Members