<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>Ve Parser : A .Net Combinatory Parser</title><link>http://veparser.codeplex.com/project/feeds/rss</link><description>Ve Parser is an implementation of Combinatory Parser concept in .Net environment using C&amp;#35; language. It allows to very easily write parsers for your language by writing its grammar using your favorite .Net language. Not only it does parse the input, but also it generates a decent output.</description><item><title>Source code checked in, #94877</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/94877</link><description>Upgrade&amp;#58; New Version of LabDefaultTemplate.xaml. To upgrade your build definitions, please visit the following link&amp;#58; http&amp;#58;&amp;#47;&amp;#47;go.microsoft.com&amp;#47;fwlink&amp;#47;&amp;#63;LinkId&amp;#61;254563</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 22:38:35 GMT</pubDate><guid isPermaLink="false">Source code checked in, #94877 20121001103835P</guid></item><item><title>Source code checked in, #94876</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/94876</link><description>Checked in by server upgrade</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 22:31:06 GMT</pubDate><guid isPermaLink="false">Source code checked in, #94876 20121001103106P</guid></item><item><title>Closed Task: Fix the problems in parallel implementation or drop the feature if is not useful [16734]</title><link>http://veparser.codeplex.com/workitem/16734</link><description>The parallel execution of some combinators and related structures are not working well, remove them from the main source codes, fix the problems and then brought them back to the main source codes.&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>MeysamNaseri</author><pubDate>Wed, 11 Jan 2012 01:42:15 GMT</pubDate><guid isPermaLink="false">Closed Task: Fix the problems in parallel implementation or drop the feature if is not useful [16734] 20120111014215A</guid></item><item><title>Closed Task: Improve parse monitoring and debugging [16735]</title><link>http://veparser.codeplex.com/workitem/16735</link><description>Lots of things can be done to improve the debugging experience&amp;#58;&lt;br /&gt;1- Implementing DebuggerDisplay for Parser and TokenChecker&lt;br /&gt;2- Implementing DebuggerVisualizer for Parser&lt;br /&gt;3- Providing virtual methods to be called on executation of each parser or token checker&lt;br /&gt;4- The ParserModel&amp;#160;should store a better&amp;#160;definition for the parser.&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>MeysamNaseri</author><pubDate>Wed, 11 Jan 2012 01:42:02 GMT</pubDate><guid isPermaLink="false">Closed Task: Improve parse monitoring and debugging [16735] 20120111014202A</guid></item><item><title>Closed Issue: Update code structures to comply with MSDN's library design guidelines [16737]</title><link>http://veparser.codeplex.com/workitem/16737</link><description>Consider a namespace for all types.&lt;br /&gt;Using public fields is not a good practice, most of fields should be converted into property.&lt;br /&gt;The library forces the AST types to expose fileds by not supporting the properties, change fill methods to support properties as well.&lt;br /&gt;Move&amp;#160;each code file into new seperate files inside directories.&lt;br /&gt;Comments: &lt;p&gt;&lt;/p&gt;</description><author>MeysamNaseri</author><pubDate>Wed, 11 Jan 2012 01:37:15 GMT</pubDate><guid isPermaLink="false">Closed Issue: Update code structures to comply with MSDN's library design guidelines [16737] 20120111013715A</guid></item><item><title>Updated Wiki: Home</title><link>http://veparser.codeplex.com/wikipage?version=12</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Ve Parser is an implementation of Combinatory Parser concept in .Net environment using C&amp;#35; language. It allows to very easily write parsers for your language by writing its grammar using your favorite .Net language. Not only it does parse the input, but also it generates a decent output.&lt;br /&gt;
&lt;h1&gt;Update&lt;/h1&gt;Just released the new version, in order to have some improvements I forced to change some names or functionalities that may affect your parsers(if you have written using version 1.0). Lets me know if you have any problem in migrating your existing parser to use this new version.&lt;br /&gt;
&lt;h1&gt;Nuget&lt;/h1&gt;To add a reference to Ve Parser in your project:&lt;br /&gt;PM&amp;gt; Install-Package veparser&lt;br /&gt;&lt;img src="http://img401.imageshack.us/img401/8923/nugetinstallpackage.png" /&gt;&lt;br /&gt;
&lt;h1&gt;Introuduction&lt;/h1&gt;Like other combinatory parsers, we used functional structures available in .Net and specially High Order Functions in order to design Ve Parser; however, the functions, which are used in the Ve parser, have a different structure in comparison with others; and consequently, a number of remarkable merits are provided. For instance, this parser is by far the simplest and easiest to understand among other combinatory parsers and it has the possibility of parallel processing for choice combinators. On the other hand, the usage of object-oriented approaches will lead to avoid of restrictions of pure functional programming. Moreover, Ve Parser has the ability of generating Abstract Syntax Tree in an integrated way and the output of parsing will be a concrete conceptual object.
&lt;h2&gt;&lt;del&gt;What is a Combinatory Parser&lt;/del&gt; How Ve Parser works?&lt;/h2&gt;The only jargon I used in the project and even in the source codes are &amp;#39;Combinator Parser&amp;#39; and &amp;#39;Lexer&amp;#39;. I dont want to make it more complex by explaining what a combinator parser is, but if you are curious you can see &lt;a href="http://en.wikipedia.org/wiki/Parser_combinator" class="externalLink"&gt;its page in wiki pedia&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You see, its a little complicated subject but Ve Parser is much simpler that the name &amp;#39;combinatory parser&amp;#39; suggests. So instead of describing what is a Combinatory Parser I will describe how Ve Parser works:&lt;br /&gt;Ve Parser is defined only a delegate type named &lt;b&gt;&lt;i&gt;Parser&lt;/i&gt;&lt;/b&gt; which has no input and has a boolean output. &lt;i&gt;Parser&lt;/i&gt; is a delegate type, so variables of type &lt;i&gt;Parser&lt;/i&gt; are functions that can be executed, when a &lt;i&gt;Parser&lt;/i&gt; executes it returns a boolean value. The result value from a &lt;i&gt;Parser&lt;/i&gt; specifies if it was successful for or not. &lt;br /&gt;Then there is &lt;b&gt;&lt;i&gt;ParserBase&lt;/i&gt;&lt;/b&gt; class which is an abstract class you have to derive from.  When you derive from it you have to implement the abstract method &lt;b&gt;-GetRootParser-&lt;/b&gt;. To implement this &lt;i&gt;GetRootParser&lt;/i&gt; the &lt;i&gt;BaseParser&lt;/i&gt; class provided you with a set of functions which all of them get inputs of type Parser and produce a Parser as result, as long as all of them have the output type of Parser and all of them have input of type Parser they can used &lt;b&gt;combined&lt;/b&gt; toghether to form a more mature parser from a more basic parser and finaly make a root parser. For example it would look like &amp;#39;&lt;i&gt;seq(oneOrMore(....),any(...),seq(any(zeroOrMore(...))))&lt;/i&gt;&amp;#39;. Here the &lt;i&gt;seq&lt;/i&gt; function is being called by passing the result of &lt;i&gt;oneOrMore&lt;/i&gt; parser, &lt;i&gt;any&lt;/i&gt; and &lt;i&gt;seq&lt;/i&gt;. Then &lt;i&gt;seq&lt;/i&gt; parser returns a parser as result.
&lt;h1&gt;Features&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Simple to use. Simple to learn. Although hard to understand how it works internally.&lt;/li&gt;
&lt;li&gt;No dependency on any grammar language, &lt;b&gt;only pure C# code can be used to design and implement a parser&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Rich grammar authoring preset. The ParserBase is shiped with a whole bunch of useful parser combinators like : &lt;b&gt;&lt;i&gt;seq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;any&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrOne&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOeMoreSeq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreSeq&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;deleimitedList&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;mixture&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Producing output result from the parsed content. (A.k.a Abstract Syntax Tree generation).&lt;/li&gt;
&lt;li&gt;Extensible. Although there are lots of useful combinators you can wrote your own combinators to the library. &lt;b&gt;I am looking to hearing from you about any new combinator that you may suggest.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Probably fast, if you wrote a neat grammar it should be fast. I need to evaluate performance more percisely to claim about it speed.&lt;/li&gt;
&lt;li&gt;Grammar debugging. Yes that&amp;#39;s it, you can monitor the executation of the parser, and also you can put breakpoints in your parser code to see how it is performing. (_Although this features require some improvements, so the next version would be even better).&lt;/li&gt;
&lt;li&gt;Shiped with a default Lexer.&lt;/li&gt;
&lt;li&gt;Lightweight library, with no dependency to any other library. Just you need .Net 4 to use it. And itself is only a couple of essential classes and some other helper classes.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Code&lt;/h1&gt;Probably a good way to describe the library is a sample code of how a Parser using Ve Parser would look like:&lt;br /&gt;Here is a small part of a sample CSV parser that parse a simple CSV content and result a list of rows which each row is list of values:&lt;br /&gt;Note: This code is based on the latest source codes (downloadable through Source Code tab) and it would not work with the current released version.&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;class&lt;/span&gt; CSVParser : BaseParser&amp;lt;&lt;span style="color:Blue;"&gt;char&lt;/span&gt;&amp;gt;
    {
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; comma = &lt;span style="color:#A31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; newline = &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;;

        &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; Parser GetRootParser()
        {
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; seperatorParser = toParser(ch =&amp;gt; ch == comma);
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineBreakParser = seq(toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\r&amp;#39;&lt;/span&gt;), toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; itemParser = createNewText(zeroOrMore(appendText(keep(toParser(ch =&amp;gt; ch != comma &amp;amp;&amp;amp; ch != &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color:Blue;"&gt;char&lt;/span&gt;.IsLetterOrDigit(ch))))));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineParser = createNewList(deleimitedList(seperatorParser, add(itemParser)));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; fileParser = createNewList(deleimitedList(lineBreakParser, add(lineParser)));
            &lt;span style="color:Blue;"&gt;return&lt;/span&gt; seq(fileParser, endOfFile());
        }
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And below is the code which describes how the above parser will be used:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
[TestMethod]
&lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; CSVParserTest()
{
    &lt;span style="color:Blue;"&gt;var&lt;/span&gt; csvContent = &lt;span style="color:#A31515;"&gt;@&amp;quot;column1,column2
19,20&amp;quot;&lt;/span&gt;;
    &lt;span style="color:Blue;"&gt;var&lt;/span&gt; csvParser = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; CSVParser();
    &lt;span style="color:Blue;"&gt;dynamic&lt;/span&gt; result = csvParser.Parse(csvContent.ToCharArray());
    Assert.IsNotNull(result);
    Assert.AreEqual(result.Count, 2);
    &lt;span style="color:Blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:Blue;"&gt;var&lt;/span&gt; row &lt;span style="color:Blue;"&gt;in&lt;/span&gt; result)
    {
        Assert.AreEqual(row.Count, 2);
    }
    Assert.AreEqual(result[0][0], &lt;span style="color:#A31515;"&gt;&amp;quot;column1&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[0][1], &lt;span style="color:#A31515;"&gt;&amp;quot;column2&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[1][0], &lt;span style="color:#A31515;"&gt;&amp;quot;19&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[1][1], &lt;span style="color:#A31515;"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;);
}
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>MeysamNaseri</author><pubDate>Thu, 01 Dec 2011 13:15:33 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111201011533P</guid></item><item><title>Created Release: Ve Parser 1.1 (Dec 01, 2011)</title><link>http://veparser.codeplex.com/releases?ReleaseId=77891</link><description>&lt;div class="wikidoc"&gt;In this release I added/improved output generation functionalities, most notably the ability to generate output dynamically(using DLR). Also there are lots of changes to some basic combinators which if you have used them your parser will not work/compile with this new version.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>meysamnaseri</author><pubDate>Thu, 01 Dec 2011 13:11:38 GMT</pubDate><guid isPermaLink="false">Created Release: Ve Parser 1.1 (Dec 01, 2011) 20111201011138P</guid></item><item><title>Released: Ve Parser 1.1 (Dec 01, 2011)</title><link>http://veparser.codeplex.com/releases/view/77891</link><description>
&lt;div class="wikidoc"&gt;In this release I added/improved output generation functionalities, most notably the ability to generate output dynamically(using DLR). Also there are lots of changes to some basic combinators which if you have used them your parser will
 not work/compile with this new version.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
</description><author></author><pubDate>Thu, 01 Dec 2011 13:11:38 GMT</pubDate><guid isPermaLink="false">Released: Ve Parser 1.1 (Dec 01, 2011) 20111201011138P</guid></item><item><title>Updated Wiki: Home</title><link>http://veparser.codeplex.com/wikipage?version=11</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Ve Parser is an implementation of Combinatory Parser concept in .Net environment using C&amp;#35; language. It allows to very easily write parsers for your language by writing its grammar using your favorite .Net language. Not only it does parse the input, but also it generates a decent output.&lt;br /&gt;
&lt;h1&gt;Nuget&lt;/h1&gt;To add a reference to Ve Parser in your project:&lt;br /&gt;PM&amp;gt; Install-Package veparser&lt;br /&gt;&lt;img src="http://img401.imageshack.us/img401/8923/nugetinstallpackage.png" /&gt;&lt;br /&gt;
&lt;h1&gt;Introuduction&lt;/h1&gt;Like other combinatory parsers, we used functional structures available in .Net and specially High Order Functions in order to design Ve Parser; however, the functions, which are used in the Ve parser, have a different structure in comparison with others; and consequently, a number of remarkable merits are provided. For instance, this parser is by far the simplest and easiest to understand among other combinatory parsers and it has the possibility of parallel processing for choice combinators. On the other hand, the usage of object-oriented approaches will lead to avoid of restrictions of pure functional programming. Moreover, Ve Parser has the ability of generating Abstract Syntax Tree in an integrated way and the output of parsing will be a concrete conceptual object.
&lt;h2&gt;&lt;del&gt;What is a Combinatory Parser&lt;/del&gt; How Ve Parser works?&lt;/h2&gt;The only jargon I used in the project and even in the source codes are &amp;#39;Combinator Parser&amp;#39; and &amp;#39;Lexer&amp;#39;. I dont want to make it more complex by explaining what a combinator parser is, but if you are curious you can see &lt;a href="http://en.wikipedia.org/wiki/Parser_combinator" class="externalLink"&gt;its page in wiki pedia&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You see, its a little complicated subject but Ve Parser is much simpler that the name &amp;#39;combinatory parser&amp;#39; suggests. So instead of describing what is a Combinatory Parser I will describe how Ve Parser works:&lt;br /&gt;Ve Parser is defined only a delegate type named &lt;b&gt;&lt;i&gt;Parser&lt;/i&gt;&lt;/b&gt; which has no input and has a boolean output. &lt;i&gt;Parser&lt;/i&gt; is a delegate type, so variables of type &lt;i&gt;Parser&lt;/i&gt; are functions that can be executed, when a &lt;i&gt;Parser&lt;/i&gt; executes it returns a boolean value. The result value from a &lt;i&gt;Parser&lt;/i&gt; specifies if it was successful for or not. &lt;br /&gt;Then there is &lt;b&gt;&lt;i&gt;ParserBase&lt;/i&gt;&lt;/b&gt; class which is an abstract class you have to derive from.  When you derive from it you have to implement the abstract method &lt;b&gt;-GetRootParser-&lt;/b&gt;. To implement this &lt;i&gt;GetRootParser&lt;/i&gt; the &lt;i&gt;BaseParser&lt;/i&gt; class provided you with a set of functions which all of them get inputs of type Parser and produce a Parser as result, as long as all of them have the output type of Parser and all of them have input of type Parser they can used &lt;b&gt;combined&lt;/b&gt; toghether to form a more mature parser from a more basic parser and finaly make a root parser. For example it would look like &amp;#39;&lt;i&gt;seq(oneOrMore(....),any(...),seq(any(zeroOrMore(...))))&lt;/i&gt;&amp;#39;. Here the &lt;i&gt;seq&lt;/i&gt; function is being called by passing the result of &lt;i&gt;oneOrMore&lt;/i&gt; parser, &lt;i&gt;any&lt;/i&gt; and &lt;i&gt;seq&lt;/i&gt;. Then &lt;i&gt;seq&lt;/i&gt; parser returns a parser as result.
&lt;h1&gt;Features&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Simple to use. Simple to learn. Although hard to understand how it works internally.&lt;/li&gt;
&lt;li&gt;No dependency on any grammar language, &lt;b&gt;only pure C# code can be used to design and implement a parser&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Rich grammar authoring preset. The ParserBase is shiped with a whole bunch of useful parser combinators like : &lt;b&gt;&lt;i&gt;seq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;any&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrOne&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOeMoreSeq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreSeq&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;deleimitedList&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;mixture&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Producing output result from the parsed content. (A.k.a Abstract Syntax Tree generation).&lt;/li&gt;
&lt;li&gt;Extensible. Although there are lots of useful combinators you can wrote your own combinators to the library. &lt;b&gt;I am looking to hearing from you about any new combinator that you may suggest.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Probably fast, if you wrote a neat grammar it should be fast. I need to evaluate performance more percisely to claim about it speed.&lt;/li&gt;
&lt;li&gt;Grammar debugging. Yes that&amp;#39;s it, you can monitor the executation of the parser, and also you can put breakpoints in your parser code to see how it is performing. (_Although this features require some improvements, so the next version would be even better).&lt;/li&gt;
&lt;li&gt;Shiped with a default Lexer.&lt;/li&gt;
&lt;li&gt;Lightweight library, with no dependency to any other library. Just you need .Net 4 to use it. And itself is only a couple of essential classes and some other helper classes.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Code&lt;/h1&gt;Probably a good way to describe the library is a sample code of how a Parser using Ve Parser would look like:&lt;br /&gt;Here is a small part of a sample CSV parser that parse a simple CSV content and result a list of rows which each row is list of values:&lt;br /&gt;Note: This code is based on the latest source codes (downloadable through Source Code tab) and it would not work with the current released version.&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;class&lt;/span&gt; CSVParser : BaseParser&amp;lt;&lt;span style="color:Blue;"&gt;char&lt;/span&gt;&amp;gt;
    {
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; comma = &lt;span style="color:#A31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; newline = &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;;

        &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; Parser GetRootParser()
        {
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; seperatorParser = toParser(ch =&amp;gt; ch == comma);
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineBreakParser = seq(toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\r&amp;#39;&lt;/span&gt;), toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; itemParser = createNewText(zeroOrMore(appendText(keep(toParser(ch =&amp;gt; ch != comma &amp;amp;&amp;amp; ch != &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color:Blue;"&gt;char&lt;/span&gt;.IsLetterOrDigit(ch))))));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineParser = createNewList(deleimitedList(seperatorParser, add(itemParser)));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; fileParser = createNewList(deleimitedList(lineBreakParser, add(lineParser)));
            &lt;span style="color:Blue;"&gt;return&lt;/span&gt; seq(fileParser, endOfFile());
        }
    }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;And below is the code which describes how the above parser will be used:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
[TestMethod]
&lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;void&lt;/span&gt; CSVParserTest()
{
    &lt;span style="color:Blue;"&gt;var&lt;/span&gt; csvContent = &lt;span style="color:#A31515;"&gt;@&amp;quot;column1,column2
19,20&amp;quot;&lt;/span&gt;;
    &lt;span style="color:Blue;"&gt;var&lt;/span&gt; csvParser = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; CSVParser();
    &lt;span style="color:Blue;"&gt;dynamic&lt;/span&gt; result = csvParser.Parse(csvContent.ToCharArray());
    Assert.IsNotNull(result);
    Assert.AreEqual(result.Count, 2);
    &lt;span style="color:Blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:Blue;"&gt;var&lt;/span&gt; row &lt;span style="color:Blue;"&gt;in&lt;/span&gt; result)
    {
        Assert.AreEqual(row.Count, 2);
    }
    Assert.AreEqual(result[0][0], &lt;span style="color:#A31515;"&gt;&amp;quot;column1&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[0][1], &lt;span style="color:#A31515;"&gt;&amp;quot;column2&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[1][0], &lt;span style="color:#A31515;"&gt;&amp;quot;19&amp;quot;&lt;/span&gt;);
    Assert.AreEqual(result[1][1], &lt;span style="color:#A31515;"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;);
}
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>MeysamNaseri</author><pubDate>Thu, 17 Nov 2011 04:46:48 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111117044648A</guid></item><item><title>Updated Wiki: Home</title><link>http://veparser.codeplex.com/wikipage?version=10</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Ve Parser is an implementation of Combinatory Parser concept in .Net environment using C&amp;#35; language. It allows to very easily write parsers for your language by writing its grammar using your favorite .Net language. Not only it does parse the input, but also it generates a decent output.&lt;br /&gt;
&lt;h1&gt;Nuget&lt;/h1&gt;To add a reference to Ve Parser in your project:&lt;br /&gt;PM&amp;gt; Install-Package veparser&lt;br /&gt;&lt;img src="http://img401.imageshack.us/img401/8923/nugetinstallpackage.png" /&gt;&lt;br /&gt;
&lt;h1&gt;Introuduction&lt;/h1&gt;Like other combinatory parsers, we used functional structures available in .Net and specially High Order Functions in order to design Ve Parser; however, the functions, which are used in the Ve parser, have a different structure in comparison with others; and consequently, a number of remarkable merits are provided. For instance, this parser is by far the simplest and easiest to understand among other combinatory parsers and it has the possibility of parallel processing for choice combinators. On the other hand, the usage of object-oriented approaches will lead to avoid of restrictions of pure functional programming. Moreover, Ve Parser has the ability of generating Abstract Syntax Tree in an integrated way and the output of parsing will be a concrete conceptual object.
&lt;h2&gt;&lt;del&gt;What is a Combinatory Parser&lt;/del&gt; How Ve Parser works?&lt;/h2&gt;The only jargon I used in the project and even in the source codes are &amp;#39;Combinator Parser&amp;#39; and &amp;#39;Lexer&amp;#39;. I dont want to make it more complex by explaining what a combinator parser is, but if you are curious you can see &lt;a href="http://en.wikipedia.org/wiki/Parser_combinator" class="externalLink"&gt;its page in wiki pedia&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You see, its a little complicated subject but Ve Parser is much simpler that the name &amp;#39;combinatory parser&amp;#39; suggests. So instead of describing what is a Combinatory Parser I will describe how Ve Parser works:&lt;br /&gt;Ve Parser is defined only a delegate type named &lt;b&gt;&lt;i&gt;Parser&lt;/i&gt;&lt;/b&gt; which has no input and has a boolean output. &lt;i&gt;Parser&lt;/i&gt; is a delegate type, so variables of type &lt;i&gt;Parser&lt;/i&gt; are functions that can be executed, when a &lt;i&gt;Parser&lt;/i&gt; executes it returns a boolean value. The result value from a &lt;i&gt;Parser&lt;/i&gt; specifies if it was successful for or not. &lt;br /&gt;Then there is &lt;b&gt;&lt;i&gt;ParserBase&lt;/i&gt;&lt;/b&gt; class which is an abstract class you have to derive from.  When you derive from it you have to implement the abstract method &lt;b&gt;-GetRootParser-&lt;/b&gt;. To implement this &lt;i&gt;GetRootParser&lt;/i&gt; the &lt;i&gt;BaseParser&lt;/i&gt; class provided you with a set of functions which all of them get inputs of type Parser and produce a Parser as result, as long as all of them have the output type of Parser and all of them have input of type Parser they can used &lt;b&gt;combined&lt;/b&gt; toghether to form a more mature parser from a more basic parser and finaly make a root parser. For example it would look like &amp;#39;&lt;i&gt;seq(oneOrMore(....),any(...),seq(any(zeroOrMore(...))))&lt;/i&gt;&amp;#39;. Here the &lt;i&gt;seq&lt;/i&gt; function is being called by passing the result of &lt;i&gt;oneOrMore&lt;/i&gt; parser, &lt;i&gt;any&lt;/i&gt; and &lt;i&gt;seq&lt;/i&gt;. Then &lt;i&gt;seq&lt;/i&gt; parser returns a parser as result.
&lt;h1&gt;Features&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Simple to use. Simple to learn. Although hard to understand how it works internally.&lt;/li&gt;
&lt;li&gt;No dependency on any grammar language, &lt;b&gt;only pure C# code can be used to design and implement a parser&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Rich grammar authoring preset. The ParserBase is shiped with a whole bunch of useful parser combinators like : &lt;b&gt;&lt;i&gt;seq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;any&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrOne&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOeMoreSeq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreSeq&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;deleimitedList&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;mixture&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Producing output result from the parsed content. (A.k.a Abstract Syntax Tree generation).&lt;/li&gt;
&lt;li&gt;Extensible. Although there are lots of useful combinators you can wrote your own combinators to the library. &lt;b&gt;I am looking to hearing from you about any new combinator that you may suggest.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Probably fast, if you wrote a neat grammar it should be fast. I need to evaluate performance more percisely to claim about it speed.&lt;/li&gt;
&lt;li&gt;Grammar debugging. Yes that&amp;#39;s it, you can monitor the executation of the parser, and also you can put breakpoints in your parser code to see how it is performing. (_Although this features require some improvements, so the next version would be even better).&lt;/li&gt;
&lt;li&gt;Shiped with a default Lexer.&lt;/li&gt;
&lt;li&gt;Lightweight library, with no dependency to any other library. Just you need .Net 4 to use it. And itself is only a couple of essential classes and some other helper classes.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Code&lt;/h1&gt;Probably a good way to describe the library is a sample code of how a Parser using Ve Parser would look like:&lt;br /&gt;Here is a small part of a sample parser for C# language (to make it more understandable and to make it smaller only a part of the whole parser is included):&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
    &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;class&lt;/span&gt; CSVParser : BaseParser&amp;lt;&lt;span style="color:Blue;"&gt;char&lt;/span&gt;&amp;gt;
    {
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; comma = &lt;span style="color:#A31515;"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;const&lt;/span&gt; &lt;span style="color:Blue;"&gt;char&lt;/span&gt; newline = &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;;

        &lt;span style="color:Blue;"&gt;protected&lt;/span&gt; &lt;span style="color:Blue;"&gt;override&lt;/span&gt; Parser GetRootParser()
        {
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; seperatorParser = toParser(ch =&amp;gt; ch == comma);
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineBreakParser = seq(toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\r&amp;#39;&lt;/span&gt;), toParser(ch =&amp;gt; ch == &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; itemParser = createNewText(zeroOrMore(appendText(keep(toParser(ch =&amp;gt; ch != comma &amp;amp;&amp;amp; ch != &lt;span style="color:#A31515;"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color:Blue;"&gt;char&lt;/span&gt;.IsLetterOrDigit(ch))))));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; lineParser = createNewList(deleimitedList(seperatorParser, add(itemParser)));
            &lt;span style="color:Blue;"&gt;var&lt;/span&gt; fileParser = createNewList(deleimitedList(lineBreakParser, add(lineParser)));
            &lt;span style="color:Blue;"&gt;return&lt;/span&gt; seq(fileParser, endOfFile());
        }
    }
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>MeysamNaseri</author><pubDate>Mon, 14 Nov 2011 01:06:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111114010644A</guid></item><item><title>Source code checked in, #82830</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/82830</link><description>Better output generatoin functionalities added, dynamic programming features, LOTS OF CHANGES INTO FUNCTION NAMES</description><author>MeysamNaseri</author><pubDate>Mon, 14 Nov 2011 01:02:30 GMT</pubDate><guid isPermaLink="false">Source code checked in, #82830 20111114010230A</guid></item><item><title>Source code checked in, #81837</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/81837</link><description>Solution structure refinements, some , a little xml documentation added.</description><author>MeysamNaseri</author><pubDate>Thu, 20 Oct 2011 14:27:49 GMT</pubDate><guid isPermaLink="false">Source code checked in, #81837 20111020022749P</guid></item><item><title>Updated Wiki: Documentation</title><link>http://veparser.codeplex.com/documentation?version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Geting Started&lt;/h1&gt;Although  the task of writing a parser is not so easy and requires you to know some parsing concepts, this parser is realy easy to use. We designed the library to be as simple as is possible and avoided using jargon.  So you only need to design your language or analyze how your data structure can be parsed using the available functionalities in veparser.&lt;br /&gt;
&lt;h2&gt;The steps to write a parser using Ve Parser&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Add Ve Parser to your project:
&lt;ol&gt;&lt;li&gt;&lt;a href="http://veparser.codeplex.com/wikipage?title=http%3a%2f%2fveparser.codeplex.com%2freleases&amp;referringTitle=Documentation"&gt;Download&lt;/a&gt; and reference the veparser.dll in your project.&lt;/li&gt;
&lt;li&gt;or simply using NuGet you only need to type &lt;b&gt;Install-Package veparser&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;Derive a class from TokenParser.&lt;/li&gt;
&lt;li&gt;Define your parser by implementing the abstract method GetRootParser.&lt;/li&gt;
&lt;li&gt;Tokenize your input text calling Lexer.Parse&lt;/li&gt;
&lt;li&gt;Call the Parse method of your parser calss.&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;How Tos&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;How to write a parser (comming soon..)&lt;/li&gt;
&lt;li&gt;How to write my own Lexer/Tokenizer (coming soon...)&lt;/li&gt;
&lt;li&gt;How to monitor parser execution (coming soon...)&lt;/li&gt;
&lt;li&gt;How to debug the parser I wrote (coming soon...)&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;FAQ&lt;/h1&gt;&lt;h2&gt;Is Ve Parser only for parsing programming languages?&lt;/h2&gt;Ve Parser is very tricky in its design and in its usage. You can use it for parsing a computer language, a data structure like CSV file, an xml data. So its up to you how to use it. In fact it consumes an IEnumerator of any arbitary data type(rather than char or string), so you can parse a list of data objects to see if they follow a special pattern or not.
&lt;h2&gt;What kind of grammar language do I have to wrote in order to utilise Ve Parser?&lt;/h2&gt;Ve Parser is a Combinatory Parser writen in C#, so the only thing you need is a .Net language. So you can write your grammar directly in your C# code and &lt;b&gt;actualy your grammar is your parser and your parser is your grammar.&lt;/b&gt; Thats it, the grammar and the parser are the same thing.
&lt;h2&gt;Whats are Ve Parser requirements?&lt;/h2&gt;Due to implementatoin dependencies it is available only for .Net 4.0.&lt;br /&gt;&lt;br /&gt;
&lt;h1&gt;Reference&lt;/h1&gt;For now I am writing a brief description of the major combinators, to start the process of documentation. So be aware that this reference documentation is incomplete and I am looking after generating a comprehensive documentation which includes the cod XML documentations.&lt;br /&gt;Lets start with some basic concepts:
&lt;h2&gt;Parser&lt;/h2&gt;Parser is a delegate defined as the very fundamental type for functions which will represent a parser or generator. This delegate signature is as follow:&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;"&gt;delegate&lt;/span&gt; &lt;span style="color:Blue;"&gt;bool&lt;/span&gt; Parser();
&lt;/pre&gt;&lt;/div&gt;The delegate simply says that a Parser is a function that has no argument and return a true or false value. If the return value is true it means that the parser did it job successfully and if the return value is false it means the Parser failed to do its job. &lt;br /&gt;I need to clarify here that the Parser finally will work on the input stream but for some reason which requires a separate page I did not set the input stream as the Parser&amp;#39;s arguments. The toParser function will create a Parser from a TokenChecker but I tried to hide this function by layers of abstraction so from the perspective of end user, only we have a Parser concept.
&lt;h2&gt;Combinator&lt;/h2&gt;Ve Parser is a combinatory parser, it works based on combination of parsers. You create more complex parsers by combining the more simpler parsers. You may begin with a simple parser that only expects the following input token(character or word) to be a special value and then create parsers which expect a sequence of some other things to appear in the input stream.&lt;br /&gt;&lt;br /&gt;Lets follow the documentation with combinators, I am going to put them in the order of importance.&lt;br /&gt;Parser 
&lt;h2&gt;any&lt;/h2&gt;&lt;b&gt;The input and output&lt;/b&gt; : This combinator receives a set of parsers in input and will returns a parser (Parser[] --&amp;gt; Parser). &lt;br /&gt;&lt;b&gt;When wins&lt;/b&gt; : The returned parser will success if it reaches a successful parser.&lt;br /&gt;&lt;b&gt;Purpose&lt;/b&gt; : To follow different options to parse the input, so it will allow the parser to find a expected input from a range of possibilities and follow the path for that kind of expected input. For example when parsing class members for C# language you may expect a field definition or you may expect a property definition, but in current position both are possible.
&lt;h2&gt;seq&lt;/h2&gt;&lt;b&gt;The input and output&lt;/b&gt; : This combinator receives a set of parsers in input and will returns a parser (Parser[] --&amp;gt; Parser). &lt;br /&gt;&lt;b&gt;When wins&lt;/b&gt; : The returned parser will success if all of the passed parsers run successfully one after one. &lt;br /&gt;&lt;b&gt;Purpose&lt;/b&gt;:  So it will check to see if a sequence of expectations are satisfied by input. &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>MeysamNaseri</author><pubDate>Thu, 20 Oct 2011 14:14:23 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20111020021423P</guid></item><item><title>Source code checked in, #81635</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/81635</link><description>Removed some extra irrelevant codes</description><author>MeysamNaseri</author><pubDate>Fri, 14 Oct 2011 23:58:43 GMT</pubDate><guid isPermaLink="false">Source code checked in, #81635 20111014115843P</guid></item><item><title>Created Release: Ve Parser 1.0 (Oct 14, 2011)</title><link>http://veparser.codeplex.com/releases?ReleaseId=75069</link><description>&lt;div class="wikidoc"&gt;This is the first stable version of the library available for use. Download and add reference to the library and follow the documentation to create your parser using Ve Parser.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>meysamnaseri</author><pubDate>Fri, 14 Oct 2011 16:38:52 GMT</pubDate><guid isPermaLink="false">Created Release: Ve Parser 1.0 (Oct 14, 2011) 20111014043852P</guid></item><item><title>Released: Ve Parser 1.0 (Oct 14, 2011)</title><link>http://veparser.codeplex.com/releases/view/75069</link><description>
&lt;div class="wikidoc"&gt;This is the first stable version of the library available for use. Download and add reference to the library and follow the documentation to create your parser using Ve Parser.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
</description><author></author><pubDate>Fri, 14 Oct 2011 16:38:52 GMT</pubDate><guid isPermaLink="false">Released: Ve Parser 1.0 (Oct 14, 2011) 20111014043852P</guid></item><item><title>Closed Feature: Add not/avoid parser [16736]</title><link>http://veparser.codeplex.com/workitem/16736</link><description>Add a new parser combinator which takes a parser and produces a parser which calls the original parser but revereses the result. so if the original parser returns true it will return false and if the original parser return true it returns false.&lt;br /&gt;Comments: Resolved with changeset 81612.</description><author>MeysamNaseri</author><pubDate>Fri, 14 Oct 2011 16:34:34 GMT</pubDate><guid isPermaLink="false">Closed Feature: Add not/avoid parser [16736] 20111014043434P</guid></item><item><title>Commented Task: Improve parse monitoring and debugging [16735]</title><link>http://veparser.codeplex.com/workitem/16735</link><description>Lots of things can be done to improve the debugging experience&amp;#58;&lt;br /&gt;1- Implementing DebuggerDisplay for Parser and TokenChecker&lt;br /&gt;2- Implementing DebuggerVisualizer for Parser&lt;br /&gt;3- Providing virtual methods to be called on executation of each parser or token checker&lt;br /&gt;4- The ParserModel&amp;#160;should store a better&amp;#160;definition for the parser.&lt;br /&gt;Comments: Associated with changeset 81612.</description><author>MeysamNaseri</author><pubDate>Fri, 14 Oct 2011 16:34:33 GMT</pubDate><guid isPermaLink="false">Commented Task: Improve parse monitoring and debugging [16735] 20111014043433P</guid></item><item><title>Source code checked in, #81612</title><link>http://veparser.codeplex.com/SourceControl/changeset/changes/81612</link><description>Project structure updated-Some other changes to make library more stable</description><author>MeysamNaseri</author><pubDate>Fri, 14 Oct 2011 16:34:29 GMT</pubDate><guid isPermaLink="false">Source code checked in, #81612 20111014043429P</guid></item><item><title>Updated Wiki: Home</title><link>http://veparser.codeplex.com/wikipage?version=9</link><description>&lt;div class="wikidoc"&gt;&lt;b&gt;Project Description&lt;/b&gt;&lt;br /&gt;Ve Parser is an implementation of Combinatory Parser concept in .Net environment using C&amp;#35; language. It allows to very easily write parsers for your language by writing its grammar using your favorite .Net language. Not only it does parse the input, but also it generates a decent output.&lt;br /&gt;
&lt;h1&gt;Nuget&lt;/h1&gt;To add a reference to Ve Parser in your project:&lt;br /&gt;PM&amp;gt; Install-Package veparser&lt;br /&gt;&lt;img src="http://img401.imageshack.us/img401/8923/nugetinstallpackage.png" /&gt;&lt;br /&gt;
&lt;h1&gt;Introuduction&lt;/h1&gt;Like other combinatory parsers, we used functional structures available in .Net and specially High Order Functions in order to design Ve Parser; however, the functions, which are used in the Ve parser, have a different structure in comparison with others; and consequently, a number of remarkable merits are provided. For instance, this parser is by far the simplest and easiest to understand among other combinatory parsers and it has the possibility of parallel processing for choice combinators. On the other hand, the usage of object-oriented approaches will lead to avoid of restrictions of pure functional programming. Moreover, Ve Parser has the ability of generating Abstract Syntax Tree in an integrated way and the output of parsing will be a concrete conceptual object.
&lt;h2&gt;&lt;del&gt;What is a Combinatory Parser&lt;/del&gt; How Ve Parser works?&lt;/h2&gt;The only jargon I used in the project and even in the source codes are &amp;#39;Combinator Parser&amp;#39; and &amp;#39;Lexer&amp;#39;. I dont want to make it more complex by explaining what a combinator parser is, but if you are curious you can see &lt;a href="http://en.wikipedia.org/wiki/Parser_combinator" class="externalLink"&gt;its page in wiki pedia&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You see, its a little complicated subject but Ve Parser is much simpler that the name &amp;#39;combinatory parser&amp;#39; suggests. So instead of describing what is a Combinatory Parser I will describe how Ve Parser works:&lt;br /&gt;Ve Parser is defined only a delegate type named &lt;b&gt;&lt;i&gt;Parser&lt;/i&gt;&lt;/b&gt; which has no input and has a boolean output. &lt;i&gt;Parser&lt;/i&gt; is a delegate type, so variables of type &lt;i&gt;Parser&lt;/i&gt; are functions that can be executed, when a &lt;i&gt;Parser&lt;/i&gt; executes it returns a boolean value. The result value from a &lt;i&gt;Parser&lt;/i&gt; specifies if it was successful for or not. &lt;br /&gt;Then there is &lt;b&gt;&lt;i&gt;ParserBase&lt;/i&gt;&lt;/b&gt; class which is an abstract class you have to derive from.  When you derive from it you have to implement the abstract method &lt;b&gt;-GetRootParser-&lt;/b&gt;. To implement this &lt;i&gt;GetRootParser&lt;/i&gt; the &lt;i&gt;BaseParser&lt;/i&gt; class provided you with a set of functions which all of them get inputs of type Parser and produce a Parser as result, as long as all of them have the output type of Parser and all of them have input of type Parser they can used &lt;b&gt;combined&lt;/b&gt; toghether to form a more mature parser from a more basic parser and finaly make a root parser. For example it would look like &amp;#39;&lt;i&gt;seq(oneOrMore(....),any(...),seq(any(zeroOrMore(...))))&lt;/i&gt;&amp;#39;. Here the &lt;i&gt;seq&lt;/i&gt; function is being called by passing the result of &lt;i&gt;oneOrMore&lt;/i&gt; parser, &lt;i&gt;any&lt;/i&gt; and &lt;i&gt;seq&lt;/i&gt;. Then &lt;i&gt;seq&lt;/i&gt; parser returns a parser as result.
&lt;h1&gt;Features&lt;/h1&gt;&lt;ul&gt;&lt;li&gt;Simple to use. Simple to learn. Although hard to understand how it works internally.&lt;/li&gt;
&lt;li&gt;No dependency on any grammar language, &lt;b&gt;only pure C# code can be used to design and implement a parser&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Rich grammar authoring preset. The ParserBase is shiped with a whole bunch of useful parser combinators like : &lt;b&gt;&lt;i&gt;seq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;any&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrOne&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMore&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;zeroOeMoreSeq&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreAny&lt;/i&gt;&lt;/b&gt;, &lt;b&gt;&lt;i&gt;oneOrMoreSeq&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;deleimitedList&lt;/i&gt;&lt;/b&gt; and &lt;b&gt;&lt;i&gt;mixture&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Producing output result from the parsed content. (A.k.a Abstract Syntax Tree generation).&lt;/li&gt;
&lt;li&gt;Extensible. Although there are lots of useful combinators you can wrote your own combinators to the library. &lt;b&gt;I am looking to hearing from you about any new combinator that you may suggest.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Probably fast, if you wrote a neat grammar it should be fast. I need to evaluate performance more percisely to claim about it speed.&lt;/li&gt;
&lt;li&gt;Grammar debugging. Yes that&amp;#39;s it, you can monitor the executation of the parser, and also you can put breakpoints in your parser code to see how it is performing. (_Although this features require some improvements, so the next version would be even better).&lt;/li&gt;
&lt;li&gt;Shiped with a default Lexer.&lt;/li&gt;
&lt;li&gt;Lightweight library, with no dependency to any other library. Just you need .Net 4 to use it. And itself is only a couple of essential classes and some other helper classes.&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Sample Code&lt;/h1&gt;Probably a good way to describe the library is a sample code of how a Parser using Ve Parser would look like:&lt;br /&gt;Here is a small part of a sample parser for C# language (to make it more understandable and to make it smaller only a part of the whole parser is included):&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Green;"&gt;// Define some keywords using the Keyword_of function and assign it to Parser deleagates&lt;/span&gt;
Parser @&lt;span style="color:Blue;"&gt;public&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;public&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;private&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;private&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;protected&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;protected&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;get&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;get&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;set&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;set&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;enum&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;enum&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;class&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;class&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;internal&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;internal&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;using&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;using&amp;quot;&lt;/span&gt;);
Parser @&lt;span style="color:Blue;"&gt;namespace&lt;/span&gt; = Keyword_of(&lt;span style="color:#A31515;"&gt;&amp;quot;namspace&amp;quot;&lt;/span&gt;);

&lt;span style="color:Green;"&gt;// Combine some basic parsers using any and zeroOrOne combinators and create a more high level parser&lt;/span&gt;
Parser member_access_level = zeroOrOne(any(
set_choice(&lt;span style="color:#A31515;"&gt;&amp;quot;access_level&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;public&amp;quot;&lt;/span&gt;, @&lt;span style="color:Blue;"&gt;public&lt;/span&gt;),
set_choice(&lt;span style="color:#A31515;"&gt;&amp;quot;access_level&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;private&amp;quot;&lt;/span&gt;, @&lt;span style="color:Blue;"&gt;private&lt;/span&gt;),
set_choice(&lt;span style="color:#A31515;"&gt;&amp;quot;access_level&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;protected&amp;quot;&lt;/span&gt;, @&lt;span style="color:Blue;"&gt;protected&lt;/span&gt;),
set_choice(&lt;span style="color:#A31515;"&gt;&amp;quot;access_level&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;internal&amp;quot;&lt;/span&gt;, @&lt;span style="color:Blue;"&gt;internal&lt;/span&gt;),
set_choice(&lt;span style="color:#A31515;"&gt;&amp;quot;access_level&amp;quot;&lt;/span&gt;, &lt;span style="color:#A31515;"&gt;&amp;quot;protectedinternal&amp;quot;&lt;/span&gt;, seq(@&lt;span style="color:Blue;"&gt;protected&lt;/span&gt;, @&lt;span style="color:Blue;"&gt;internal&lt;/span&gt;))));
&lt;span style="color:Green;"&gt;// Combine parsers using seq function&lt;/span&gt;
Parser property_get = seq(@&lt;span style="color:Blue;"&gt;get&lt;/span&gt;, Symbol_of(&lt;span style="color:#A31515;"&gt;&amp;quot;{&amp;quot;&lt;/span&gt;), zeroOrMore(statement), Symbol_of(&lt;span style="color:#A31515;"&gt;&amp;quot;}&amp;quot;&lt;/span&gt;));
Parser property_set = seq(@&lt;span style="color:Blue;"&gt;set&lt;/span&gt;, Symbol_of(&lt;span style="color:#A31515;"&gt;&amp;quot;{&amp;quot;&lt;/span&gt;), zeroOrMore(statement), Symbol_of(&lt;span style="color:#A31515;"&gt;&amp;quot;}&amp;quot;&lt;/span&gt;));
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>MeysamNaseri</author><pubDate>Fri, 14 Oct 2011 16:24:21 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111014042421P</guid></item></channel></rss>