|
-
Jun 11th, 2010, 03:20 PM
#23
Frenzied Member
Re: Syntax highlighting in forum code
Actually you wouldn't need to have any of that, you simply need to understand the lexical structure of the language you are trying to highlight. I say simple but this in itself is a mammoth task, it is something I have posted code on before.
If you have a look at the Xaml highlighter in the WPF forum (which I made) it highlights with about 98% accuracy and does so without one list. As Xaml is a well defined language its lexical structure was pretty easy to figure out, it highlights custom types too!
VB wouldn't be too hard either since its well formed. C based languages are typically harder due to a very flexible lexical structure but it can be done! When I get the time I intend on releasing a .net lexical analysis engine that will deliver a list of "parts" that can be easily read by a parser, its just not on my top things to get done list
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|