[Haskell-cafe] parsing c

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Sun Feb 24 21:06:07 EST 2008

Evan Martin wrote:
> So two questions: Is there an alternative C-parsing library?  Has
> anyone looked into librarifying c2hs's parser?

I have split c2hs into three packages once, the remains of CTK
that it uses, the C parser and pretty printer, and c2hs itself.
(I also tried to give the modules more sensible hierarchical names -
CTK would reside in CTK.* and the C stuff in Language.C.*)

However, I found the result fairly hard to use, partly due to CTK
and partly because some aspects of the C ADT that c2hs uses appears
to be designed for c2hs, not as a general purpose C AST. There's
also a lot of room for adding new utility functions for inspecting
the AST.

I'm reluctant to publish the split packages because they really don't
add much value over c2hs and I don't want to create a c2hs fork, or
duplicate effort that goes into improving that code.


More information about the Haskell-Cafe mailing list