[IronPython] DLR/ToyScript: Parser generator?

Harry Pierson Harry.Pierson at microsoft.com
Fri Mar 14 01:07:22 CET 2008


There's a .NET version of Lex & Yacc from QUT, GPLex (http://plas.fit.qut.edu.au/gplex/) and GPPG (http://plas.fit.qut.edu.au/gppg/)

Microsoft licensed those tools and ship them as part of the VS SDK (announcement: http://blogs.msdn.com/somasegar/archive/2006/10/04/Next-step-in-VS-2005-SDK.aspx, VS SDK download available @ http://msdn2.microsoft.com/en-us/vsx/default.aspx)

As was mentioned in other responses on this thread, F# includes a version of lex and yacc (docs: http://research.microsoft.com/fsharp/manual/parsing.aspx)

If you like F#, but aren't a fan of Lex and Yacc, I highly recommend FParsec (http://www.quanttec.com/fparsec/) I've been playing with it but haven't had to a chance to write about it yet.

Other choices include ANTLR (http://www.antlr.org/), Irony (http://www.codeplex.com/irony) and Coco/R (http://www.ssw.uni-linz.ac.at/Coco/)

FYI, I recently wrote a series on my blog about parsing with F#. It doesn't use any of these libraries (I'm not a fan of lax/yacc & I hadn't discovered FParsec). It's just a parser (i.e. it doesn't generate any code) but it is a fairly complex grammar. http://devhawk.net/2007/12/10/Practical+Parsing+In+F.aspx

BTW, I'm the newest member of the Dynamic Languages team @ Microsoft (http://devhawk.net/2008/03/11/Joining+The+Dynamic+Languages+Team.aspx) and I'm currently in Chicago for PyCon. I'd love to get a chance to chat w/ anyone else attending from this list about Python and DLR,

Harry Pierson
http://devhawk.net





From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver
Sent: Thursday, March 13, 2008 11:39 AM
To: Discussion of IronPython
Subject: [IronPython] DLR/ToyScript: Parser generator?

Forgive the wide audience, there's not really a DLR mailing list...

I've been reading through Martin Maly's blog and I've enjoyed it, though I've noticed it glossed over one issue...how the ToyScript parser/lexer was created.  I've dug through the source of and they look hand written, as does the IronPython parser/lexer.  Are all of these hand written or is there some tool you use to write them?

Does anyone know of a good parser generator for .Net?  I've been wanting to play with the DLR some, but I don't want to pay the up-front price of writing a parser if I can help it.  I've seen MPLEX/MPPG, but they seem a bit under-documented.

Thanks,
-Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080313/e7581643/attachment.html>


More information about the Ironpython-users mailing list