Thank you for doing this.
I used this Parser in an XPath Visualizer tool, that you can find at
It parses an Xpath expression as it is typed in and highlights any problems in red, and also displays a tooltip with the error message produced by the parser.
In the future I may try to produce an autocomplete/intellisense for the xpath expression using this parser. That is a little more complicated.