From d28ffde2997be8a01ed9cff79e1575ad22c4f6f5 Mon Sep 17 00:00:00 2001
From: nyamatongwe Last edited 26/June/2010 NH Last edited 16/July/2010 NH There is an overview of the internal design of
Scintilla. If you define the symbol Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export four
- functions: Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export three
+ functions: Scintilla Documentation
-
@@ -262,20 +303,20 @@
o Lexer
- o Notifications
+ o Lexer objects
+
o Notifications
+
o GTK+
o Deprecated messages
-
- o Edit messages never
- supported by Scintilla
-
+
@@ -5190,14 +5231,14 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
o Edit messages never
+ supported by Scintilla
o Building Scintilla
Lexer
SCI_LEXER when building Scintilla, (this is sometimes
- called the SciLexer version of Scintilla), lexing support for a wide range programming
+ called the SciLexer version of Scintilla), lexing support for a wide range of programming
languages is included and the messages in this section are supported. If you want to set
styling and fold points for an unsupported language you can either do this in the container or
better still, write your own lexer following the pattern of one of the existing ones.GetLexerCount, GetLexerName, Lex and
- Fold. See externalLexer.cxx for more.GetLexerCount, GetLexerName, and
+ GetLexerFactory. See externalLexer.cxx for more.
.
Lexers are programmed as objects that implement the ILexer interface and that interact + with the document they are lexing through the IDocument interface. + Previously lexers were defined by providing lexing and folding functions but creating an object + to handle the interaction of a lexer with a document allows the lexer to store state information that + can be used during lexing. For example a C++ lexer may store a set of preprocessor definitions + or variable declarations and style these depending on their role.
+ +A set of helper classes allows older lexers defined by functions to be used in Scintilla.
++The return values from PropertySet and WordListSet are used to indicate whether the change requires +performing lexing or folding over any of the document. It is the position at which to restart lexing and folding or -1 +if the change does not require any extra work on the document. +A simple approach is to return 0 if there is any possibility that a change requires lexing the document again while an +optimisation could be to remember where a setting first affects the document and return that position. +
+ +Release is called to destroy the lexer object.
PrivateCall allows for direct communication between the
+application and a lexer. An example would be where an application
+maintains a single large data structure containing symbolic information
+about system headers (like Windows.h) and provides this to the lexer
+where it can be applied to each document. This avoids the costs of
+constructing the system header information for each document. This is
+invoked with the SCI_PRIVATELEXERCALL API.
Scintilla tries to minimize the consequences of modifying text to
+only relex and redraw the line of the change where possible. Lexer
+objects contain their own private extra state which can affect later
+lines. For example, if the C++ lexer is greying out inactive code
+segments then changing the statement #define BEOS 0 to #define
+ BEOS 1 may require restyling and redisplaying later parts of the
+ document. The lexer can call ChangeLexerState to signal to
+ the document that it should relex and display more.
SetErrorStatus is used to notify the document of
+exceptions. Exceptions should not be thrown over build boundaries as the
+ two sides may be built with different compilers or incompatible
+exception options.
The ILexer and IDocument interfaces may be
+expanded in the future with extended versions (ILexer2...).
+ The Version method indicates which interface is
+implemented and thus which methods may be called.
Notifications are sent (fired) from the Scintilla control to its container when an event has -- cgit v1.2.3