Class Lexer
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
Lexerclass with default settings.
- Lexer(IContainer)
Initializes a new instance of the
Lexerclass 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
Lexerobject.
- UpdateCount
Keeps track of calls to
BeginUpdateandEndUpdateso that they can be nested.
- XmlScheme
Gets or sets an xml representation of
Schemeproperty.
Methods
- AddNotifier(INotifier)
Adds new handler to respond a notification.
- Assign(ILexer)
Assigns most relevant properties from another
ILexerobject.
- BeginUpdate()
Prevents object state updating until calling
EndUpdatemethod.
- DisableUpdate()
Prevents object state updating until calling
EnableUpdatemethod.
- EnableUpdate()
Re-enables object state updating, that was turn of by calling
DisableUpdatemethod. Using DisableUpdate/EnableUpdate to prevent notifying about updating the object state.
- EndUpdate()
Re-enables object state updating, that was turn of by calling
BeginUpdatemethod.
- Notify(EventArgs)
Notifies all notifiers about updating object state.
- 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
DefaultStateto 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.