Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » A few suggestions about CodeEditor
A few suggestions about CodeEditor [message #21819] Sun, 07 June 2009 00:47 Go to next message
NiNTENDU is currently offline  NiNTENDU
Messages: 1
Registered: June 2009
Junior Member
Hello everybody!

Playing with TheIDE source two ideas are bouncings in my mind:

* I REALLY like the idea to colorize the paper to identify code blocks like loop etc... but maybe drop off the macro line coloring because is hardly recognizable and add cluttering; but this is a very minor issue.

* I noticed that highlight code use various static arrays lookup
to search if a keyword is standard cpp or upp or whatever.

I think is not a bad idea to use a single big hash table of the type:

[KEYWORD] => [COLOR]

for example:

int => CPP_COLOR_INK
wchar => UPP_COLOR_INK
...
default => DEFAULT_INK

That will bring a (minor/mayor?) performance relief and simplify the code a bit: simply throw the word and you get the color!

[edit: lookup would result in a perfect hash function!]

What do you think? Maybe too much work for nothing?

NiNTENDU

ps: sorry for my bad english, it's not my primary language!

[Updated on: Sun, 07 June 2009 01:03]

Report message to a moderator

Re: A few suggestions about CodeEditor [message #21821 is a reply to message #21819] Sun, 07 June 2009 03:34 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
I think a trie is normally used for this but I don't know how it would compare with a perfect hash and like you said, might not be worth the trouble.

Graeme
Re: A few suggestions about CodeEditor [message #21824 is a reply to message #21819] Sun, 07 June 2009 15:30 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
NiNTENDU wrote on Sat, 06 June 2009 18:47

Hello everybody!

Playing with TheIDE source two ideas are bouncings in my mind:

* I REALLY like the idea to colorize the paper to identify code blocks like loop etc... but maybe drop off the macro line coloring because is hardly recognizable and add cluttering; but this is a very minor issue.

* I noticed that highlight code use various static arrays lookup
to search if a keyword is standard cpp or upp or whatever.

I think is not a bad idea to use a single big hash table of the type:

[KEYWORD] => [COLOR]

for example:

int => CPP_COLOR_INK
wchar => UPP_COLOR_INK
...
default => DEFAULT_INK

That will bring a (minor/mayor?) performance relief and simplify the code a bit: simply throw the word and you get the color!

[edit: lookup would result in a perfect hash function!]

What do you think? Maybe too much work for nothing?

NiNTENDU

ps: sorry for my bad english, it's not my primary language!


Do you experience any performance issues with highlighting?

FYI, in fact, lookup in keyword tables is done through hashing. I guess, in the sum of things highlighting has to process, this is the least expensive part...
Previous Topic: Navigator Bar Search results
Next Topic: Auto-completion for external headers
Goto Forum:
  


Current Time: Thu Mar 28 23:23:24 CET 2024

Total time taken to generate the page: 0.00815 seconds