|
-
Jul 9th, 2022, 03:25 PM
#1
Thread Starter
Member
I need help with scintilla!!
Hello. Could someone help me to integrate highlights in the editor? With personalized words and different colors.
I have tried to look at the documentation and I have found that they do it through *.hilighter files, I have found some of these files but as .bin in a repository "https://github.com/Planet-Source-Code/stewart-ceditxp -version-4-9-9__1-66207/tree/master/cx/highlighters" but they don't work for me. Any help is greatly appreciated.
also if there is any more complete tutorial, I'm interested. thanks!
-
Jul 9th, 2022, 04:45 PM
#2
Lively Member
Re: I need help with scintilla!!
-
Jul 10th, 2022, 08:05 AM
#3
Re: I need help with scintilla!!
You don’t necessarily need to use the highlighter files, you can code the settings directly in from vb which makes it easier to experiment with.
Whatever your highlighting though you need to set the proper lexer which is written in c++ and compiled into scintinilla. These can be optionally compiled in so not every dll will have all of them. The lexer is what understands the rules of the programming language like what is a comment etc.
Here is an example of manually applying the settings:
https://github.com/dzzie/YaraWorkBen...neral.bas#L354
Some typical lexers are
Code:
Enum sci_lexers
SCLEX_NONE = 0
SCLEX_CPP = 3
SCLEX_HTML = 4
SCLEX_XML = 5
SCLEX_SQL = 7
SCLEX_VB = 8
SCLEX_Asasm = 9
SCLEX_ASM = 34
SCLEX_CPPNOCASE = 35
SCLEX_PHPSCRIPT = 69
End Enum
Last edited by dz32; Jul 10th, 2022 at 08:10 AM.
-
Jul 10th, 2022, 09:30 AM
#4
Re: I need help with scintilla!!
 Originally Posted by dz32
The lexer is what understands the rules of the programming language like what is a comment etc.
Just want to point something out that may not be specific to scintilla as I know nothing about it, but as something to know in general.
A lexer's responsibility is typically to break up a body of text into tokens. You can do some language specific processing here but it's usually very minimal. The grammar of a programming language is actually the responsibility of the parser processing the tokens produced by the lexer. Left to right recursive descent parsers are the most popular types of parsers and the language rules are typically recognized by these algorithms. Now I don't know anything about scintilla as I've said so maybe they do a lot of language processing in the lexxing stage I don't know. But in general, a lexer should not be described as the part that recognizes the rules of a programming language. Just wanted to point that out.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|