I need to parse an MDX with my .Net application. Initially, I used regular expression to do this but the expressions are getting complicated and a regex expert suggested that it will be better if I use parser.
Is there any parser specifically for MDX? I tried Ranet but for some unknown reason it does not install in my machine (does not show any error message).
I need to split the several parts of the MDX into strings. For example, the where clause in one string, from clause in another etc.
The best solution would be to find a parser, but it is always very hard to find a parser for your specific needs. So if you end up with writing a parser Ve Parser is a better tool comparing to regex, because it provides more parsing functionalities, you can generate better output and since you are calling .net methods it implicitly have intellisence for writing your parser.
The downside is that it still is not well-documented, so you may find it difficult for some special scenarios.
Project Link : http://veparser.codeplex.com
NuGet identifier : veparser
If you need to get text for different parts of an MDX here is a partial sample code:
This code is not complete, I just wanted to demonstrate how to use Ve Parser to write your own parser for MDX. If you liked the library and wanted to use it, I would be happy to provide you with the all descriptions and techniques you need.