Reputation: 583
Can some one recommend a simple working example(code) of using recursive descent parser on haskell? All the information I found are too difficult to understand. Thx!
Upvotes: 8
Views: 2178
Reputation: 12749
There's a chapter in, "Real World Haskell" devoted to Parsec
, the recursive descent parser combinator library that comes with the Haskell Platform. There's also a bunch of Parsec
links on the Haskell Wiki. Ultimately, once you get comfortable with the examples, you'll need the reference guide.
Upvotes: 6
Reputation: 36049
While not especially simple, Robert Giegerich's script for his lecture "Programmiersprachen und ihre Übersetzer" is a literate program featuring a recursive descent parser for (IIRC) a minimal Pascal with excellent documentation. In German, though, and not available on the net, but you can ask him directly.
Upvotes: 1