I am currently working on a project that involves syntax highlighting.

Does anyone have/know any good algorithms in implementing syntax highlighting?

I originally thought that I would just do it by line, but some lines are continuations of others, etc.
I wouldn't know to go after reserved words, operators, strings, or the like first. Any direction would be appreciated.

Recommended Answers

All 2 Replies

How are you displaying your text? (Rich Edit? Something you made? Console?)

Member Avatar for handsome_94

Simply just search for the word first...then you can add tags in front of it and behind it to change its color (if in a web page).. tht's it you have highlighted it!! :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.