Re: GtkEtext final design



> > I will also be writing a new lexical scanner (called the gescanner
> > :) which will be more configurable than the current GScanner.

>     I do not understand why you plan to create a new
>     tokenizer. I mean : gscanner is very flexible and
>     it should be easy to embed it in any kind of 
>     project.

     Emmanuel,
	It has been several months since I did the research for this, so
I'm a bit rusty on all of the specific features.  I'll try to dig up my
notes, but I'll be posting detailed messages to this list when I get to 
that stage of development.

	In short, I saw some things in the "syntax definition" files of
the win32 program called "TextPad" (http://www.textpad.com/) that implied
a lexical scanner slightly superior to the GScanner.  I wanted those
features in my text editor application.

	For example, here are some things that are in the TextPad scanner
config options that are not (AFAIK) in the GScanner (please note I have
never used the GScanner, and this is only from my reading of the
documentation):

# Supports different grammers, such as markup languages:
# This turns on keyword recongition (< and > would be for HTML/SGML) 
SyntaxStart = <   
SyntaxEnd = >     

# GScanner has multi-line comments hardcoded to start with '/*' and end
# with '*/'.  In TextPad, it's configurable:

# For example, this is for C highlighting:
CommentStart = /*
CommentEnd = */

# ...and this is for HTML:
CommentStart = !--
CommentEnd = -->

# Not only that, but it supports more than one kind of comment:
CommentStartAlt = 
CommentEndAlt =

# There are other config options that are cool, too.  These are for HTML:
CharStart = &
CharEnd = ;

# ...but these are for C:
CharStart = '
CharEnd = '


# Here is more cool stuff (example settings used to highlight C):
BracketChars = {[()]}

StringStart = "
StringEnd = "
StringsSpanLines = Yes
StringEsc = \

# There are many other options which I have omitted...

	These features make it much, much easier to support syntax
highlighting of different languages, such as Java or Perl.  Furthermore,
if I implement a scanner which has all of the TextPad scanner's features,
I can examine their syntax definition files to immediately support
highlighting of many different languages in my text editor.

	If you need to use win32 for *anything*, you really need TextPad.  
Personally, I consider it to be the best text/hex editor on the planet
(but I don't come from an Emacs or vi background).

	I hope this answers your question.


Thanks,
Derek Simkowiak
dereks@kd-dev.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]