Parser Combinators in C
Hi all, A while ago, I worked on a project where I was forced to write code in C. (Yuck!) One of the things that I wrote was a parser. I hate using yacc, so, in order to have some fun on my project, I decided to develop a parser combinator library in C! This would be a parser combinator library inspired by the monadic library described in Meijer's and Hutton's paper. Since then, I completely reimplemented the library, cleaning up the interface and adding new features to it. I started writing a little bit about it. A first draft can be found on: http://www.cs.chalmers.se/~koen/ParserComboC/parser-combo-c.html I thought it could be fun for Haskell programmers to see this. (One of the problems with this webpage is that I do not really know for who I am writing it...) So if you have any comments or suggestions, please tell me! Regards, Koen. PS. This is not a joke. Some people have looked at my code and thought nobody would ever be able to write code like that! Well, I wrote and used this code for real! :-) I guess we functional programmers are (considered to be) weird sometimes :-) :-) Or maybe it is just me... -- Koen Claessen http://www.cs.chalmers.se/~koen phone:+46-31-772 5424 mailto:koen@cs.chalmers.se ----------------------------------------------------- Chalmers University of Technology, Gothenburg, Sweden
On Wed, 22 Nov 2000, Koen Claessen wrote: [cut]
http://www.cs.chalmers.se/~koen/ParserComboC/parser-combo-c.html
I thought it could be fun for Haskell programmers to see this. (One of the problems with this webpage is that I do not really know for who I am writing it...)
So if you have any comments or suggestions, please tell me!
I can see its usefulness for development of a family of some compiler-independent, light-weight utilities for Haskell, operating on sources of Haskell modules: + Converter from literate to non-literate source code. If I am not mistaken, each Haskell compiler and Hugs has its own version of "unlit" program. However, each "unlit" is compiler specific and dependent on other *.c and *.h files. There is nothing platform or compiler specific in this problem that could not be handled by a generic utility, running ouside any Haskell system. + Code and comments extractor A code extractor ("give me a list of default methods for class XXX", etc.) from Haskell sources would be a useful addition to any kind of a high level GUI browser. Its logic could be much simpler if source modules were first prefiltered by "unlit". From my utilitarian perspective, it does not matter whether such utilities are developed in Haskell and then compiled to C or in your framework of a pure C - as long as they are generic, lightweight and C-compilable on any platform (Unix for start). I am brewing my own code for such tasks, but I would gladly use somebody's expertly designed utilities instead. Jan
participants (2)
-
Jan Skibinski -
Koen Claessen