In This Article

MergeableLexerCoordinator Class

Coordinates lexer and state shifting for one or more mergeable lexers.

public class MergeableLexerCoordinator
Inheritance:
object object

Remarks

Features include:

Methods

Create(ITextBufferReader, IMergeableLexer)

Creates an instance of a coordinator for the specified ITextBufferReader and IMergeableLexer.

public static MergeableLexerCoordinator Create(ITextBufferReader reader, IMergeableLexer rootLexer)
Parameter Type Description
reader ITextBufferReader

The ITextBufferReader to use.

rootLexer IMergeableLexer

The root IMergeableLexer.

Returns

MergeableLexerCoordinator:

The MergeableLexerCoordinator that was created.

GetNextToken()

Returns the next IMergeableToken.

public IMergeableToken? GetNextToken()

Returns

IMergeableToken

Parse(TextSnapshotRange, ILexerTarget)

Lexically parses the specified TextRange of the ITextSnapshot.

public static TextRange Parse(TextSnapshotRange snapshotRange, ILexerTarget lexerTarget)
Parameter Type Description
snapshotRange TextSnapshotRange

A TextSnapshotRange indicating the offset range to parse.

lexerTarget ILexerTarget

The ILexerTarget to update.

Returns

TextRange:

A TextRange that was parsed.

Pop()

Pops the top coordinator state from the stack and restores the coordinator to that state.

public bool Pop()

Returns

bool:

true if a pop occurred; otherwise, false.

Push()

Pushes the coordinator state onto a stack for later restoration, generally to begin a multiple token look-ahead operation.

public void Push()

Remarks

Any call to this method must have a corresponding Pop() call.

Inherited Members

Extension Methods