
I'm working on a project in which I am attempting to write a parser for Haskell within Haskell itself using Parsec. The parser itself only deals with a subset of the features of the full Haskell implementation but I'm having difficulty figuring out how to implement the grammar with precedence of operations for example boolean expression involving && over || and also 'if then else" statements in relation to other operations. I'm attempting to do this with the Text.Parsec.Expr module more specifically BuildExpressionParser combinator using table and term as used in a number of tutorials I have seen which deal with arithmetic expression. Is this the correct course of action? Or will it fail to meet my needs. Will it be necessary to create an AST for the grammar by creating new data types as outlined in the following tutorial? http://www.haskell.org/haskellwiki/Parsing_a_simple_imperative_language Also what's the difference between the modules: Text.Parsec.Expr Text.ParserCombinators.Parsec.Expr Thanks in advance, Seán

On Thu, 31 Jan 2013 17:40:49 +0100, Sean Cormican
I'm working on a project in which I am attempting to write a parser for Haskell within Haskell itself using Parsec.
Do you know about the haskell-src package[0]? As you didn't receive any answer to your questions yet, I suggest you ask them on Haskell cafe, as there are more experts there. Regards, Henk-Jan van Tuyl [0] http://hackage.haskell.org/package/haskell-src -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
participants (2)
-
Henk-Jan van Tuyl
-
Sean Cormican