On 11/25/06, Quentin Mathé <[EMAIL PROTECTED]> wrote:
Hi Yen-Ju,

I think it's a really good idea to have a really good code editor
part of Étoilé. Thanks to take care of this.
But did you take a look at Project Manager code before starting? I
think PM code is very good and reusable.
It's could be better to reuse its editor view than writing a new one
from scratch (in PM editor view, I personally really like the
horizontal/vertical rulers and the guidelines support).
If you prefer to have your own editor view, you may at least reuse
the highlighting code which is available in a standalone framework
named HighlighterKit.


I did look at the ProjectManager and haven't made my mind yet. :)
ProjectManager and Smultron both use property list for syntax highlighting
while CodeEditor (old) use a bundle (highlighting programmingly).
While property list can be easily modified, bundles can take care every details.
A shortage of property list approach is that it basically search all
the possible
keyword exhaustedly.
As far as I understand, the HighlighterKit is basically written
a regular expression library from scratch.
It can easily be done with the use of OgreKit.

If we think this problem from another point of view,
syntax highlight is basically token parsing of a programming language.
Is it possible to parse a programming language based on a list of
keywords or regular expression ?
I am not an expert, but I can hardly think an example.

Another issue is the speed.
In the end, when user press a key,
CodeEditor has to re-highlight the syntax, indent, recalculate the line number,
find the other part of block symbol, probably try to do the
auto-completion, etc.
The property list approach seems to be slower than the bundle approach
because a bundle can be more smart.
For example, property list has to match all the keyword with NS-
prefix or use NS.* regular expression
while a bundle can just look at the first 2 characters and decide the
whole word is a NS- keyword.

Anyway, I just put up the skeleton for syntax highlighting
and haven't gone into the details.
I am leaning to use the bundle instead of property list
unless a bundle is not provided.

Another thing is that I tend to keep CodeEditor a text editor,
not strongly tied with programming.
It is called CodeEditor simply because I cannot think a good name.
Actually, Typewriter is a good name for plain-text editor.
But then we have to come out another name for the rich-text editor. :P


Yen-Ju

Here is the link: http://svn.gna.org/viewcvs/pmanager/

Cheers,
Quentin.

--
Quentin Mathé
[EMAIL PROTECTED]



_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to