Re: [Haskell-cafe] C++ Parser?

2012-02-01 Thread Yin Wang
I have written a C++ parser in Scheme, with a Parsec-style parser combinator library. It can parse a large portion of C++ and I use it to do structural comparison between ASTs. I made some macros so that the parser combinators look like the grammar itself. It's code is at:

Re: [Haskell-cafe] C++ Parser?

2012-02-01 Thread Jason Dagit
On Wed, Feb 1, 2012 at 12:42 PM, Yin Wang yinwa...@gmail.com wrote: I have written a C++ parser in Scheme, with a Parsec-style parser combinator library. It can parse a large portion of C++ and I use it to do structural comparison between ASTs. I made some macros so that the parser combinators

Re: [Haskell-cafe] C++ Parser?

2012-02-01 Thread Yin Wang
I haven't dealt explicitly with templates. I treat them as type parameters (element $type-parameter). I don't check that they have been declared at all. As explained, these are semantic checks and should be deferred until type checking stage ;-) Cheers,     Yin On Wed, Feb 1, 2012 at 4:07

[Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi, I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? Many thanks, Chris. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Antoine Latter
On Tue, Jan 24, 2012 at 4:06 AM, Christopher Brown cm...@st-andrews.ac.uk wrote: Hi, I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? I'm not aware of one. When it comes to parsing C++, I've always

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Hans Aberg
On 24 Jan 2012, at 11:06, Christopher Brown wrote: I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? There is a yaccable grammar

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 2:06 AM, Christopher Brown cm...@st-andrews.ac.uk wrote: Hi, I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? I don't think one exists. I've heard it's quite difficult to get

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi Everyone, Thanks for everyone's kind responses: very helpful so far! I fully appreciate and understand how difficult writing a C++ parser is. However I may need one for our new Paraphrase project, where I may be targeting C++ for writing a refactoring tool. Obviously I don't want to start

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 6:54 AM, Christopher Brown cm...@st-andrews.ac.uk wrote: Hi Everyone, Thanks for everyone's kind responses: very helpful so far! I fully appreciate and understand how difficult writing a C++ parser is. However I may need one for our new Paraphrase project, where I

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Christopher Brown
Hi Jason, Thanks very much for you thoughtful response. I am intrigued about the Happy route: as I have never really used Happy before, am I right in thinking I could take the .gr grammar, feed it into Happy to generate a parser, or a template for a parser, and then go from there? Chris.

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Jason Dagit
On Tue, Jan 24, 2012 at 8:40 AM, Christopher Brown cm...@st-andrews.ac.uk wrote: Hi Jason, Thanks very much for you thoughtful response. I am intrigued about the Happy route: as I have never really used Happy before, am I right in thinking I could take the .gr grammar, feed it into Happy

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Nathan Howell
On Tue, Jan 24, 2012 at 2:06 AM, Christopher Brown cm...@st-andrews.ac.ukwrote: I have stumbled across language-c on hackage and I was wondering if anyone is aware if there exists a full C++ parser written in Haskell? Check out clang: http://clang.llvm.org/ and

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread Stephen Tetley
There is also the DMS from Ira Baxter's company Semantic Design's. This is an industry proven refactoring framework that handles C++ as well as other languages. I think the Antlr C++ parser may have advanced since the article Antoine Latter link to, but personally I'd run a mile before trying to

Re: [Haskell-cafe] C++ Parser?

2012-01-24 Thread David Laing
Hi all, Just to add to the list - Qt Creator contains a pretty nice (and incremental) C++ parser. Cheers, Dave On Wed, Jan 25, 2012 at 5:06 AM, Stephen Tetley stephen.tet...@gmail.comwrote: There is also the DMS from Ira Baxter's company Semantic Design's. This is an industry proven

[Haskell-cafe] C# parser written in Haskell

2008-01-27 Thread Joel Reymont
Does anyone have a C# parser written in Haskell? Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-20 Thread Marc Weber
On Wed, Apr 19, 2006 at 11:01:03PM +0200, Christophe Poucet wrote: For the parsing and lexing I used happy and alex. Jake Luck wrote: I would be very interested in this as well. I have looked myself but haven't found anything else. I wrote one myself in Haskell but for a subset of C++

[Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Ravi Nanavati
It turns out we might find such a beast useful at Bluespec. If anyone has written a C++ parser in Haskell (or knows of one), we'd like to hear about it. Thanks, - Ravi Nanavati Bluespec, Inc. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Christophe Poucet
I would be very interested in this as well. I have looked myself but haven't found anything else. I wrote one myself in Haskell but for a subset of C++ (subset of C but with some extra things like methods). Christophe Poucet Ravi Nanavati wrote: It turns out we might find such a beast

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Jake Luck
I would be very interested in this as well. I have looked myself but haven't found anything else. I wrote one myself in Haskell but for a subset of C++ (subset of C but with some extra things like methods). Did you build it using parsec or happy? jake

Re: [Haskell-cafe] C++ parser in Haskell?

2006-04-19 Thread Christophe Poucet
For the parsing and lexing I used happy and alex. Jake Luck wrote: I would be very interested in this as well. I have looked myself but haven't found anything else. I wrote one myself in Haskell but for a subset of C++ (subset of C but with some extra things like methods). Did you build it