Author Topic: QE_with_colours' evolution  (Read 893 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: QE_with_colours' evolution
« Reply #15 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 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

HSE

  • Member
  • *****
  • Posts: 1304
  • <AMD>< 7-32>
Re: QE_with_colours' evolution
« Reply #16 on: March 18, 2020, 03:39:00 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:

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.

HSE

  • Member
  • *****
  • Posts: 1304
  • <AMD>< 7-32>
Re: QE_with_colours' evolution
« Reply #17 on: March 20, 2020, 09:27:29 AM »
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.