LexicalStateBase Class
Provides the abstract base class for a lexical state.
public abstract class LexicalStateBase : ILexicalState, IKeyedObject- Inheritance:
- object object
- Implements:
- ILexicalState IKeyedObject
Constructors
LexicalStateBase(int, string)
Initializes a new instance of the LexicalStateBase 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
Gets the collection of child lexical states.
protected ILexicalStateCollection ChildLexicalStatesCore { get; }Property Value
- ILexicalStateCollection:
- A LexicalStateCollection containing the child lexical states. 
DefaultTokenId
Gets or sets the ID of the default token that this state assigns.
public int DefaultTokenId { get; set; }Property Value
- int:
- The ID of the default token that this state assigns. 
DefaultTokenKey
Gets or sets the key of the default token that this state assigns.
public string DefaultTokenKey { get; set; }Property Value
- string:
- The key of the default token that this state assigns. 
Id
Gets or sets the ID value that identifies the lexical state.
Key
Gets a string-based key that identifies the lexical state.
public string Key { get; }Property Value
- string:
- A string-based key that identifies the lexical state. 
LexerCore
Gets or sets the ILexer that contains the state.
LexicalScopesCore
Gets the collection of lexical scopes.
protected ILexicalScopeCollection LexicalScopesCore { get; }Property Value
- ILexicalScopeCollection:
- A LexicalScopeCollection containing the lexical scopes. 
Tag
Gets or sets the object that contains user-defined data about the object.
public object Tag { get; set; }Property Value
Remarks
Any type derived from the object class can be assigned to this property.
Transition
Gets or sets the ILexicalStateTransition that is performed immediately after a start scope match.
public ILexicalStateTransition Transition { get; set; }Property Value
- ILexicalStateTransition:
- The ILexicalStateTransition that is performed immediately after a start scope match. 
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:
- The ILexicalStateCollection that was created. 
CreateLexicalScopes()
Creates the ILexicalScopeCollection collection that is returned by LexicalScopesCore.
protected virtual ILexicalScopeCollection CreateLexicalScopes()Returns
- ILexicalScopeCollection:
- The ILexicalScopeCollection that was created.