In This Article

LexicalStateBase Class

Provides the abstract base class for a lexical state.

public abstract class LexicalStateBase : ILexicalState, IKeyedObject
Inheritance:
object object
Derived:
DynamicLexicalState ProgrammaticLexicalState
Implements:
ILexicalState IKeyedObject

Constructors

LexicalStateBase(int, string)

Initializes an instance of the class.

protected LexicalStateBase(int id, string key)
Parameter Type Description
id int

The ID of the lexical state.

key string

The key of the lexical state.

Properties

ChildLexicalStatesCore

The collection of child lexical states.

protected ILexicalStateCollection ChildLexicalStatesCore { get; }

Property Value

ILexicalStateCollection

DefaultTokenId

The ID of the default token that this state assigns.

public int DefaultTokenId { get; set; }

Property Value

int

DefaultTokenKey

The key of the default token that this state assigns.

public string? DefaultTokenKey { get; set; }

Property Value

string

Id

The ID value that identifies the lexical state.

public int Id { get; set; }

Property Value

int

Key

A string-based key that identifies the lexical state.

public string? Key { get; }

Property Value

string

LexerCore

The ILexer that contains the state.

protected ILexer? LexerCore { get; set; }

Property Value

ILexer

LexicalScopesCore

The collection of lexical scopes.

protected ILexicalScopeCollection LexicalScopesCore { get; }

Property Value

ILexicalScopeCollection

Tag

The object that contains user-defined data about the object.

public object? Tag { get; set; }

Property Value

object

Transition

The ILexicalStateTransition that is performed immediately after a start scope match.

public ILexicalStateTransition? Transition { get; set; }

Property Value

ILexicalStateTransition

Remarks

This provides a mechanism to automatically transition to another language when this state's start scope is matched. This state's end scope may be used to exit the child language.

ASP-style tags are an example of when to use this transition.

Methods

CreateChildLexicalStates()

Creates the ILexicalStateCollection collection that is returned by ChildLexicalStatesCore.

protected virtual ILexicalStateCollection CreateChildLexicalStates()

Returns

ILexicalStateCollection

CreateLexicalScopes()

Creates the ILexicalScopeCollection collection that is returned by LexicalScopesCore.

protected virtual ILexicalScopeCollection CreateLexicalScopes()

Returns

ILexicalScopeCollection

Inherited Members

Extension Methods