Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:05:24+00:00 2026-05-26T07:05:24+00:00

I need to parse an MDX with my .Net application. Initially, I used regular

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:05:24+00:00Added an answer on May 26, 2026 at 7:05 am

    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:

    using VeParser;
    using System.Linq;
    using System.Collections.Generic;
    using System;
    
    
    public class MDXParser : TokenParser
    {
        protected override Parser GetRootParser()
        {
            // read the following line as : fill 'select' property of 'current object(which is a statement)' with the 'new value of selectStatement' after facing a sequence of a select statement and then the symbol of ( and then a delemitied list of identierfiers filling the 'fileds' property of 'current selectStatement object' delemitied by ',' and finally expect the sequence to be finished with a symbol of ')'
            var selectStatement = fill("select", create<selectStatment>( seq(expectKeyword_of("select"), expectSymbol_of("("), deleimitedList(expectSymbol_of(","), fill("fields",identifier) ), expectSymbol_of(")"))));
            // read the following line as : fill the from property of 'current object(which is a statement)' with an expected identifier that is after a 'from' keyword
            var fromStatement = seq(expectKeyword_of("from"), fill("from", identifier));
            // the following statement is incomplete, as I just wanted to show a sample bit, If you are interested I can help you complete the parser until the full documentation become available.
            var whereStatement = fill("where", create<whereStatement>(seq(expectKeyword_of("where"))));
            var statement = create<statement>(seq(selectStatement, fromStatement, whereStatement));
    
            return statement;
        }
    
        public statement Parse(string code)
        {
            var keywords = new[] { "select", "where", "from" };
            var symbols = new[] { "(",")", ".", "[", "]" };
            var tokenList = Lexer.Parser(code, keywords, symbols, ignoreWhireSpaces : true);
            // Now we have our string input converted into a list of tokens which actually is a list of words but with some additional information about any word, for example a "select" is marked as keyword
            var parseResult = base.Parse(tokenList.tokens);
            if (parseResult == null)
                throw new Exception("Invalid Code, at the moment Ve Parser does not support any error reporting feature.");
            else
                return (statement)parseResult;
        }
    }
    public class statement
    {
        public selectStatment select;
        public string where;
        public identifier from;
    }
    public class selectStatment
    {
        public List<identifier> fields;
    }
    public class whereStatement
    {
    
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse json object for this url I have used following code
I need to parse and replace text using gsub and a regular expression. A
Need to parse a Class declaration line in Java using regular expression e.g. String
Need to parse a file for lines of data that start with this pattern
I need to parse a file but the data is in a strange format
I need to parse potentially huge XML files, so I guess this rules out
I need to parse this string into three different components: Location: 1|#69.83623|#24.432223|#Cupertino, California The
I need to parse html emails that will be similar but not exactly the
I need to parse a bunch of incoming XML documents but it does not
I need to parse a textfile with about 10000 groupings like this group C_BatTemp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.