[Haskell-cafe] ghc-api Static Semantics?
cmb21 at st-andrews.ac.uk
Thu Jan 26 10:24:06 CET 2012
By static semantics I mean use and bind locations for every name in the AST.
f x = let x = x + 1 in x
Should parse as something like
HsMatch ("f" (HsPat "x" (1,2) (1,2)) (HsBody (HsExp (HsLet (HsMatch ("x" (8,1) (8,1)) (HsExp (HsInfix (+) (1) ("x") (12,1) (8,1)) ("x" (16,1) (8,1))))
I'm steering towards haskell-src-exts right now as the sheer complexity of the ghc-api is putting me off. I need something simple, as I can't be spending all my time learning the ghc-api and hacking it together to do what I want. It does look a bit of a mess. Just trying to do simple things like parsing a file and showing its output proved to be much more complicated than it really needed to be.
> Let me know if you decide to take on this project.
We have decided to take it on. :)
> On 24 January 2012 10:35, Christopher Brown <cmb21 at st-andrews.ac.uk> wrote:
>>> Have you looked at ghc-syb-utils, which gives a neat way to print an AST?
>> Yes I found that yesterday!
>>> JP Moresmau
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
> Push the envelope. Watch it bend.
More information about the Haskell-Cafe