Hi all,

I'm working on some syntax highlighting code. Well, the code is finished, I just need a list of all of the syntax to highlight.

I'm allowing the user to select the color and words per list of syntax, I just need to know what words to put in each list (category).

For instance, for HTML: Tag list with tags, Properties list with properties, etc.

I would like to get syntax for: Python, Java, HTML/XHTML, CSS, SQL/DDL Commands and Datatypes, C#, VB, C++, and any others you guys may be able to think of.

My question is this, does anyone know of a good resource that lists all of the possible syntax for any of the above mentioned languages?

Thank you all greatly,

Dave

yup, the language specification for each language will have it all.

But I have to disappoint you: the approach you've chosen is woefully naive!
Not only does syntax highlighting need to do a lot more than just identify keywords (it for example needs to be able to colour variables at different levels, method names, etc. etc. as well to name a few) but it also needs to be able to understand the code so that it can flag incorrect use of words as errors.
For example if you use a keyword as a variable name that keyword in that position should not be coloured as a keyword, but as an error.

Hi jwenting, thank you for the information.

These are certainly concerns I need to consider. The project I am working on is no small task, and the Syntax Highlighting code has been consuming much of my time (night and day).

I will reconsider how much control the user has. Thanks again jwenting :)

Dave

yup, the language specification for each language will have it all.

But I have to disappoint you: the approach you've chosen is woefully naive!
Not only does syntax highlighting need to do a lot more than just identify keywords (it for example needs to be able to colour variables at different levels, method names, etc. etc. as well to name a few) but it also needs to be able to understand the code so that it can flag incorrect use of words as errors.
For example if you use a keyword as a variable name that keyword in that position should not be coloured as a keyword, but as an error.

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.