[QScintilla] Lexer Issue
Phil Thompson
phil at riverbankcomputing.com
Mon Sep 4 10:12:25 BST 2006
On Monday 04 September 2006 12:35 am, Micha Bieber wrote:
> @list,
>
> let's suppose, someone out there plans to add a lexer to QScintilla - a
> complete new one, not related to the existing classes, with an option to
> access them from python. What has he todo, in order to be successful? At
> this very moment I'm trying to utilize a QScintilla based widget from
> PyQt.
> I have a large legacy project with accordingly dimensioned configure.ac
> et al in front of me. I'm not crazy enough to expect some complete M4
> parser, but at least my application should eventually be able to extract
> some kind of skeleton from this auto** stuff and assist in transforming
> the build process from autoconf to cmake.
> Seemingly I cannot use one of the predefined lexer classes as a base
> class for my customized variant. Some things are hardwired - the used
> enums in QextScintillaLexerXXX::description(), the return value of
> QextScintillaLexerXXX::lexer() and possibly more. I still haven't yet
> the whole picture, but advices given in
>
> http://scintilla.sourceforge.net/Lexer.txt
> http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html
>
> seem to indicate a chance to inject a new parser at C/C++ level. Also,
> QextScintillaBase contains an enum value SCLEX_CONTAINER, apparently
> related to the task but more or less undocumented. In spite of this, sip
> seemingly imposes some limitations (I'm not an expert in bindings).
> Could someone elaborate?
The QScintilla lexer classes are high level interfaces to the underlying
Scintilla lexers. They are not a method for writing new lexers.
You need to write the new lexer for Scintilla (ignoring QScintilla), then
write the QScintilla high level class (which is really just a way of avoiding
Scintilla's property system), then the corresponding SIP wrapper.
Phil
More information about the QScintilla
mailing list