News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

QE_with_colours' evolution

Started by HSE, February 19, 2020, 03:51:37 AM

Previous topic - Next topic

hutch--

The way I did the words 20 years ago was to load them into a hash table that I had in PowerBASIC so that access time for getting the words was fast enough. I don't have one written for masm but I think you can make a IF based tree grouping words that start with the same character to reduce the number of branches that you would have in a linear word list. To get the different colours I grouped each class of words with a single number so for example, registers=1, directives=2 etc ....

I would be inclined to do all the words in a single case rather than having both upper, and lower case as well as mixed case as a case conversion is fast enough not to have to bother with all the options and it reduces by half that number of entries.

HSE

Quote from: hutch-- on March 18, 2020, 02:28:21 AM
The way I did the words 20 years ago was to load them into a hash table
You mention that recently. I taked note  :thumbsup:

Quote from: hutch-- on March 18, 2020, 02:28:21 AM
I would be inclined to do all the words in a single case...
Yes. It's the only way that syntax highlighting work like "typing error detection". Some words can be written in upper or lower case but, for example, I don't write registers in upper case, and so on.
Equations in Assembly: SmplMath

HSE

Just playing a little more  :biggrin:

Words are detected now. And that requiere also detect numbers!

Only CPU registers are detected, using some kind of tree. I found there is examples of hashtables in \masm32\examples\advanced to copy but that will be in some future  :cool:.

Files updated in first post.
Equations in Assembly: SmplMath

zedd151

As some here know, I like writing and using qeditor plugins. There are many useful features/fuctions that can be added with them. I am surprised I hadn't seen this thread already. I found this thread by looking at the 'Who's Online' list. (I like seeing what other users find interesting) A Guest was viewing the thread, so I followed and found it.
The closest thing I had done with a qeditor plugin was to have a plugin that searches the text for a string and highlights the occurrences of that string if found.
Nice little plugin HSE.  :thumbsup:

For this type of plugin I would probably use an external file with the words needed to be highlighted and their color. This way the user can change the words to be highlighted and their colors without having to rebuild the plugin (of course would be slower). Would be nice if a plugin could run automatically at the startup of qeditor, rather than having to select it from the menu. (Not a request hutch-- for any changes  :tongue: ) Would make using this type of plugin much easier.

HSE

Thanks :thumbsup:

Second plugin, Iczelion syntax method, use a file with several word categories.
Equations in Assembly: SmplMath

zedd151

Quote from: HSE on October 01, 2022, 06:13:54 AM
Second plugin, Iczelion syntax method, use a file with several word categories.
I totally missed that one (I didn't read through all the replies). Nice.  :biggrin: