Links
EControl Syntax Editor SDK
TSyntAnalyzer Class

TSyntAnalyzer is component that contains rules, styles and other properties required for syntactical analysis.

TSyntAnalyzer = class(TLoadableComponent);

ecSyntAnal

TSyntAnalyzer containes Lexer Rules, Styles and Code Templates. All these objects are organized in collections, so there are no limits of lexer rules and styles number. Single TSyntAnalyzer may be connected to any number of TSyntaxMemo. 

TSyntAnalyzer does not immediately perform syntactical analysis. It only creates TClientSyntAnalyzer objects for each client . TClientSyntAnalyzer uses information from TSyntAnalyzer to perform syntactical analysis. 

 

To connect to TSyntAnalyzer call AddClient function that returns TClientSyntAnalyzer object. To disconnect from TSyntAnalyzer destroy previously taken TClientSyntAnalyzer object. 

 

There is no need to create lexer configuration by programming.It may be defined in "Syntax lexer" dialog. 

To customize TSyntAnalyzer at design time use corresponded component editor by double clicking left mouse button on the component. To customize at runtime call CustomizeLexer method. 

 

You may load and save lexer configuration by using LoadFromFile and SaveToFile. To copy configuration from one TSyntAnalyzer to another use Assign method. 

 

To define lexer configuration in code use these collections:

Rules for detecting tokens. 
Rules for detecting sequences of tokens. 
Rules for detecting regions where nested lexer will act. 
Styles. 
Code templates. 

 

Properties LexerName and Extentions are especially used by the TSyntaxManager.

Topic 
Description 
The methods of the TLoadableComponent class are listed here. 
The properties of the TLoadableComponent class are listed here. 
TSyntAnalyzer Class
Topic 
Description 
The methods of the TSyntAnalyzer class are listed here. 
The properties of the TSyntAnalyzer class are listed here. 
The events of the TSyntAnalyzer class are listed here. 
 
Method 
 
virtual 
 
protected 
 
Property 
 
read only 
 
Event 
TSyntAnalyzer Class
TSyntAnalyzer Class 
Description 
Occurs when properties of TSyntAnalyzer may have been changed. 
Occurs when text range is closed. Use this event to adjust bounds of the text range. 
Allows adjusting bounds of text range which will be used when collapsing this text range. 
Allows adjusting bounds of text range which will be used to locate block staple. 
Allows implement fully custom parsing. In this event you should detect token at specified position and return rule and token length. Parser rule in this case is used only to associate properties with token. 
TLoadableComponent Methods 
Description 
Loads component resource from file. 
Loads component from resource identified by ResID. 
Loads component from resource identified by ResName. 
Loads component resource from stream. 
Saves component resource to file. 
Saves component resource to stream. 
Allows to avoid name conflict when loading component resource. 
TSyntAnalyzer Class
TSyntAnalyzer Class 
Description 
Adds new client. 
Adds new mater lexer. 
Called when properties of TSyntAnalyzer may have been changed. 
Clears all formatting information in all clients. 
Creates and initializes a TSyntAnalyzer instance. 
Displays "Syntax Highlighting" dialog. 
Displays "Syntax Lexer" dialog. 
Destroys an instance of TSyntAnalyzer. 
Tests token rules on the text (Source) at particular position (APos). 
Tests only "tag detector" block rules on the text (Source) for the current tokens array. 
Removes master lexer. 
Tests block rules on the text (Source) for the current tokens array. 
Updates all clients. 
TLoadableComponent Properties 
Description 
Specifies last used file name in LoadFromFile and SaveToFile functions. 
TSyntAnalyzer Class
TSyntAnalyzer Class 
Description 
Enables background block analysis. 
Collection of block rules. 
Specifies character set which is used for ANSI<->UNICODE conversions and by regular expressions. 
Collection of code templates. 
Specifies style that is used to draw text icon of collapsed range. 
Specifies style that is used to draw text icon of collapsed range. 
Specifies style that is used to draw current line (line with the caret). 
Specifies style that is used to draw current line (line with the caret). 
Specifies style that is used to initialize Canvas. 
Specifies style that is used to initialize Canvas. 
File extensions associated with the Lexer. 
Collection of styles. 
Specifies threshold after which full refresh (when text is changed) of syntactical objects will not be performed. 
Specifies grammar compiler. 
Specifies delay of restarting text analysis after editing. 
Specifies delay of initial text analysis. 
Specifies whether lexer should not be skipped when making lexers menu or files filter. 
Lexer name. 
Specifies string which may be used to comment line. 
Specifies style that is used for rendering selected text. 
Specifies style that is used for rendering selected text. 
Specifies additional description of the syntax analyzer. 
Specifies whether line breaks should be parsed. 
Restarts analysis from line start. 
Specifies sample text. 
Specifies style that is used to mark out search results. 
Specifies style that is used to mark out search results. 
Specifies whether block analysis should be performed in idle after all tokens are defined. 
Specifies whether space characters must be skipped while parsing text. 
Collection of sub-lexer rules. 
Collection of token rules (parser's rules). 
Specifies strings that are associated with the token types. 
Copyright (c) 2004-2011. All rights reserved.
What do you think about this topic? Send feedback!