Neil Hodgson wrote:
Eugene Wong has produced a generic lexer based on regular
expressions. I find the approach confusing but others may appreciate
it more. You can download from
http:/scintilla.sourceforge.net/scite166r.tar.bz2
The language description is contained in .properties files as
keyword lists. d950.properties is an example language definition and
SampleText/D950Assembly.S is some source code in this language. I'd
like to hear from anyone that likes this approach particularly if you
manage to make it handle a more common style of language like Pascal
or Java rather than the assembler like example.
I have been looking at Eugene's lexer. I've been comparing the results
from a c++ file being rendered using the test.properties lexer and the
c/c++ lexer.
I put two copies of the c++ file side by side and used the language menu
to specify c++ for the second. I know that the test lexer is being used
for the first because I changed two of the color values.
The results are remarkable similiar to the point where only one
discrepancy is visible. When the c++ lexer is rendering a #define
statement, the entire line is colored the same, but the regex lexer does
not. Oh, and folds are not present, in this example.
I will not post any images unless requested.
I know it would take me a long time to design the necessary regex for
any given need, but it is a wonderful tool, though folds would be a
significant enhancement.
April
--
I am willing to make the mistakes if someone else is willing to learn from them.
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest