Table of Contents

Class Lexer

Namespace
Alternet.Syntax.Lexer
Assembly
Alternet.Syntax.v9.dll

Represents class that performs lexical analysis of the specified text.

public class Lexer : Component, IComponent, IDisposable, ILexer, INotify, IUpdate
Inheritance
Lexer
Implements
Derived

Remarks

Lexer class is designed to recognize source code syntax, such as reserved words, comments, numbers, strings and any other syntax structures. Use Scheme property to specify lexical analysis rules.

Constructors

Lexer()

Initializes a new instance of the Lexer class with default settings.

Lexer(IContainer)

Initializes a new instance of the Lexer class with specified container.

Properties

DefaultState

Gets or sets default state of the Lexer.

Scheme

Gets or sets a list of rules for lexical analysis.

SerializationInfo

Gets or sets an xml representation of this Lexer object.

UpdateCount

Keeps track of calls to BeginUpdate and EndUpdate so that they can be nested.

XmlScheme

Gets or sets an xml representation of Scheme property.

Methods

AddNotifier(INotifier)

Adds new handler to respond a notification.

Assign(ILexer)

Assigns most relevant properties from another ILexer object.

BeginUpdate()

Prevents object state updating until calling EndUpdate method.

CreateLexScheme()
DisableUpdate()

Prevents object state updating until calling EnableUpdate method.

Dispose(bool)

Releases the unmanaged resources used by the Component and optionally releases the managed resources.

EnableUpdate()

Re-enables object state updating, that was turn of by calling DisableUpdate method. Using DisableUpdate/EnableUpdate to prevent notifying about updating the object state.

EndUpdate()

Re-enables object state updating, that was turn of by calling BeginUpdate method.

Notify(EventArgs)

Notifies all notifiers about updating object state.

OnDefaultStateChanged()
OnSchemeChanged()
OnTextParsed(string, ref StringItemInfo[])
OnXmlSchemeChanged()
ParseText(int, int, string, ref StringItemInfo[])

Performs lexical analysis of given text.

ParseText(int, int, string, ref int, ref int, ref int)

Performs lexical analysis of given text.

RemoveNotifier(INotifier)

Exclude specified handler from notification handlers list.

RemovePlainText(string, StringItemInfo[])

Removes all plain (string constants or comments) parts of text from specified text.

ResetDefaultState()

Resets the DefaultState to the default value.

Update()

When implemented by a class, updates an object state.

Events

Parse

Occurs when text line is parsed, allowing to modify colors/styles information about the parsed line.