[Haskell-beginners] A Pascal-like Language Compiler

Joel Björnson joel.bjornson at gmail.com
Thu Oct 23 04:23:29 EDT 2008


On Thu, Oct 23, 2008 at 12:18 AM, Pranesh Srinivasan <spranesh at gmail.com> wrote:
>
> That seems like a very nice scheme to follow. I had a similar method in
> mind. Step 3 is what I am really worried about. How easy/difficult will
> it be in a pure func language, to "transform" the sytnax tree.

I think the pureness is actually an advantage here, since the
transformation is a function from one syntax tree to another. If
however, you feel the need of keeping a state and you don't wanna pass
around this explicitly, you may consider using a state monad.

> I have to take a deeper look at BNFC. But from an initial look, it seems
> way too powerful for me to use? At least as powerful as yacc. And that
> with Haskell, should give me a very good toolset-advantage?

If the project is about writing parsers then using BNFC would probably
be considered cheating. But for practical purposes I think it's a
great tool that would save you a lot of work.

- Joel


More information about the Beginners mailing list