Request about the documentation

7 views
Skip to first unread message

projetmbc

unread,
Jun 29, 2009, 7:30:45 AM6/29/09
to scintilla-interest
H'ello,
it is too hard to understand what it must be done such as to build a
custom lexer. It could be very usefull to add to the documentation a
simple lexer wich can be an instructive example for the C++ newbies.
This lexer would for example ....

1. ... put in red all line which begins with a #
2. ... put in blue only the word blue
3. ... make a folding with something starting with /* and ending
with */

By doing this I'm sure that more people will use QScintilla because it
would be easy to custom it. It seams that the users of Qscintilla are
always the same and they don't seem to understand that the task for a
newbie is very hard because all the examples are real ones and then
there are a litlle bit complex to understand.

Christophe.

Christophe

unread,
Jun 29, 2009, 7:49:26 AM6/29/09
to scintilla...@googlegroups.com
I mean Scintilla rather than QScintilla even if I am more interested by
QScintilla.

Christophe.

Randy Kramer

unread,
Jun 29, 2009, 9:27:21 AM6/29/09
to scintilla...@googlegroups.com
On Monday 29 June 2009 07:30:45 am projetmbc wrote:
> H'ello,
> it is too hard to understand what it must be done such as to build a
> custom lexer. It could be very usefull to add to the documentation a
> simple lexer wich can be an instructive example for the C++ newbies.
> This lexer would for example ....
>
> 1. ... put in red all line which begins with a #
> 2. ... put in blue only the word blue
> 3. ... make a folding with something starting with /* and ending
> with */

+1

I've actually seen a simple example somewhere--and when I have time,
hopefully later today, I'll dig it out and send you the link. (There
is a chance that the example is old enough that it no longer works--I
haven't got as far as trying it so far.)

Actually including such a simple example in the documentation would be
nice.

Before someone jumps to create the example, I'd like to take a little
time to decide if there is an additional example that might
particularly help me in my quest to make a lexer for the TWiki markup
language.

In the other programs (nedit and kate) that I've added a highlighting
file for TWiki markup, I was able to use regular expressions, and think
that would be a help if I could do that in scite (as that is my
target). Of course, I guess that adds some amount of additional
overhead.

One thing that I have to learn to deal with is distinguishing the level
of headers from very similar markup at the beginning of a line--for
example, a level 1 header is marked up as \n---+ <heading text>\n, a
level 2 header is marked up as \n---++ <heading text>\n, and so on up
to level 6.

Similarly, a bullet or numbered list item at the first level is preceded
by 3 spaces, a bullet or numbered list item at the second level is
preceded by 6 spaces, so I have to be able to treat spaces as
significant.

> By doing this I'm sure that more people will use QScintilla because
> it would be easy to custom it. It seams that the users of Qscintilla
> are always the same and they don't seem to understand that the task
> for a newbie is very hard because all the examples are real ones and
> then there are a litlle bit complex to understand.

+1

Randy Kramer
--
I didn't have time to write a short letter, so I created a video
instead.--with apologies to Cicero, et.al.

Christophe

unread,
Jun 29, 2009, 12:13:15 PM6/29/09
to scintilla...@googlegroups.com
Randy Kramer a écrit :

> I've actually seen a simple example somewhere--and when I have time,
> hopefully later today, I'll dig it out and send you the link. (There
> is a chance that the example is old enough that it no longer works--I
> haven't got as far as trying it so far.)
>
That would be great to have a complet but simple example. I'm impatient
to see your link....

> One thing that I have to learn to deal with is distinguishing the level
> of headers from very similar markup at the beginning of a line--for
> example, a level 1 header is marked up as \n---+ <heading text>\n, a
> level 2 header is marked up as \n---++ <heading text>\n, and so on up
> to level 6.
>
> Similarly, a bullet or numbered list item at the first level is preceded
> by 3 spaces, a bullet or numbered list item at the second level is
> preceded by 6 spaces, so I have to be able to treat spaces as
> significant.

I'm also interested by that kind of feature.

Thanks for your answer.
Christophe.

Randy Kramer

unread,
Jun 29, 2009, 1:19:17 PM6/29/09
to scintilla...@googlegroups.com, Christophe
On Monday 29 June 2009 12:13:15 pm Christophe wrote:
> Randy Kramer a écrit :
> > I've actually seen a simple example somewhere--and when I have
> > time, hopefully later today, I'll dig it out and send you the link.
> > (There is a chance that the example is old enough that it no
> > longer works--I haven't got as far as trying it so far.)
>
> That would be great to have a complet but simple example. I'm
> impatient to see your link....

Ok, here is the link:

Writing a self-contained lexer for scintilla:
http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html

I should give some disclaimers:

* As I mentioned earlier, I haven't tried this code so don't know if
it works (and, there is some fleshing out required--it is not like it
tells you exactly what to put in each named file). I presume it worked
at one time, but that may have been in a (much?) older version of
scite / scintilla

* The writer's email address is mentioned in the link--I was
anticipating writing to him at some point, but, iirc, I haven't tried
so far

* I am not a scite developer, nor affiliated with scite in any
way--I'm just a user interested in getting the lexer I need. I have
spent some time looking into this, but I'm neither a C or C++
programmer, so I started spending some time looking at some aspects of
C++. I did manage to sort of compile scite one time by downloading the
Debian source package, and then compiling that. I'm assuming that I
can make modifications for my purposes, and then compile the new code
the same way, though, if I create any new files, maybe I have to add
them to a make command or similar (I'm very much a novice in those
areas--compiling Pascal code in dos/Windows was more my speed ;-)

Randy Kramer

> > One thing that I have to learn to deal with is distinguishing the
> > level of headers from very similar markup at the beginning of a
> > line--for example, a level 1 header is marked up as \n---+ <heading
> > text>\n, a level 2 header is marked up as \n---++ <heading
> > text>\n, and so on up to level 6.
> >
> > Similarly, a bullet or numbered list item at the first level is
> > preceded by 3 spaces, a bullet or numbered list item at the second
> > level is preceded by 6 spaces, so I have to be able to treat spaces
> > as significant.
>
> I'm also interested by that kind of feature.

--

Randy Kramer

unread,
Jul 1, 2009, 9:08:20 AM7/1/09
to scintilla...@googlegroups.com, Christophe
Christophe (and all),

(Intentionally top posting, and leaving old information below in case
you need to refer to it.)

Just wondered if you had a chance to look at the link, maybe even try
it, and your reaction?

As I mentioned, it doesn't seem to be the "put this line of code here in
this file, this line of code there in that file", kind of clear
instructions that would help me, and I guess that's what hung me up. I
suspect it may be the same for you?

Maybe there is somebody out there who could carry the example a little
further by going that far? (And confirming that the example still
works?)

Randy Kramer

Reply all
Reply to author
Forward
0 new messages