Managed meets functional

Blog about programming and having fun with .Net

About me

 Venice, 2009

profile for Alexander Galkin on Stack Exchange, a network of free, community-driven Q&A sites

Project Euler

Greetings here in my blog!
My name is Alexander Galkin. I was born 1979 in Kazan, Russia, where I graduated in child medicine.
Since 2001 I live in Hamburg, Germany and work as a freelancer software and database architect and trainer for Microsoft technologies.

 Microsoft Certified Trainer
Microsoft Certified Professional Developer
MCTS Logo
MCITP Logo

Calendar

<<  May 2012  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

Using LINQPad as scrapbook for FParsec

FPrasec is a smart implementation of the famous Parsec library from Haskell. 

FParsec belongs to the class of parser combinators, meaning that you don't have any IDE or formal definition of your grammar (as in case of ANTLR/ANTLRWorks). Rather you deal with some primitive parsers which can consume strings, digits and combine them in a clever way to implement your parser. The main advantage here is that you have the full control over what you are designing and can use the full strength of the underlying language (in this case that of F#).

Since I have got problems with F# in my main Visual Studio installation which I couldn't not repair (here is the respective StackOverflow question) I decided to use my favorite tool LINQPad for learning and designing parsers and it worked perfectly.

So, if you want to use LINQPad with FParasec the only thing you have to do is to add the references to FParsec DLL. This is done by going to the application menu:

and then add both FParsec.dll and FparsecCS.dll to the "additional references". You will find these DLLs after the first compilation of the FParsec source code. 

For your convinience I am attaching an achive with pre-compiled DLLs to this post.

From now on you can use FParsec freely, just don't forget to open the FParsec namespace in your code.

I also adapted the examples from the FParsec tutorial to run in LINQPad. Those samples expect the DLLs to be stored under the follownig path: D:\Dev\FParsec\DLL\

You can download the complete tutorial scripts and the samples provided with the FParsec using the link below.

FParsec.dll and FParsecCS.dll (.zip, 176 kb) 

LINQ queries for tutorial and samples (.zip, 13 kb)


Categories: F# | parser
Permalink | Comments (0) | Post RSSRSS comment feed
Comments are closed