Syntax Hilighting XPath Expressions

I love XPath. My first GotDotNet sample was an XPath expression tester. It is a very simple application. It can be quite helpful when working out expressions, but one thing that I always wanted to add (but never got around to) was syntax hilighting. After a while mucking around with the ROTOR XPath implementation I’m starting to be able to do the syntax hilighting.

As you can see from the screen shot I’m not actually hiligthing the text as it is typed, I’m doing that in a seperate text box for now. The eventual .plan is for it to all happen in a single text box, possibly with auto-completeion like Visual Studio Intellisense ™. One problem with the SSCLI XPath implementation (for the use I’m putting it to anyway) is that it doesn’t care about maintaining the exact text used to create the expression - it’s only concerned with building an abstract syntax tree of nodes so certain things are “thrown out” during the parse. I’m not actually sure if the current way I’m going about things is going to work, but hopefully I can have fun trying. When/If I get it working I will post an update on GotDotNet.



Speaking of syntax highlighting… what about using some of Dominic Cooney’s parsing code? I hear he is not the worst programmer in the family…

13/04/2004 10:43:00 AM
Yes, I’m racing to finish it before Dominic automates the whole process. On the bright side - If he keeps going the way he is I won’t have to wait until ROTOR 2 to get an XQuery implementation to do syntax hilighting for me.
13/04/2004 10:47:00 AM