On Mon, Jul 19, 2010 at 01:51:52PM -0300, José Romildo Malaquias wrote:
> data Exp
> = IntExp Integer
> | VarExp Symbol
> | AssignExp Symbol Exp
> | IfExp Exp Exp (Maybe Exp)
> | CallExp Symbol [Exp]
> | LetExp [Dec] Exp
>
> data Dec
> = TypeDec Symbol Ty
> | F
Hi Romildo,
2010/7/23 José Romildo Malaquias
> On Tue, Jul 20, 2010 at 09:17:15AM +0200, José Pedro Magalhães wrote:
> >
> > 2010/7/19 José Romildo Malaquias
> >
> > >
> > > I am writing here to ask suggestions on how to annotate an ast with
> > > types (or any other information that would be r
On Tue, Jul 20, 2010 at 09:17:15AM +0200, José Pedro Magalhães wrote:
>
> 2010/7/19 José Romildo Malaquias
>
> >
> > I am writing here to ask suggestions on how to annotate an ast with
> > types (or any other information that would be relevant in a compiler
> > phase) in Haskell.
>
> Indeed I w
Despite the interesting discussing which has followed this question I think
that in orde to approach this specific problem the use of a specific
compiler-writers toolset such as the uuagc
(http://hackage.haskell.org/package/uuagc-0.9.29)) system is to be preferred;
it provides aneffiicent and m
Hi José,
2010/7/19 José Romildo Malaquias
>
> I am writing here to ask suggestions on how to annotate an ast with
> types (or any other information that would be relevant in a compiler
> phase) in Haskell.
>
> As an example, consider the simplified ast types:
>
> data Exp
>= IntExp Integer
G'day all.
Quoting José Romildo Malaquias :
I am writing here to ask suggestions on how to annotate an ast with
types (or any other information that would be relevant in a compiler
phase) in Haskell.
This might help:
http://www.haskell.org/haskellwiki/Indirect_composite
Andrew Bromage
_
Ah, I found the attachment on your other email.
I would recommend using the Fix and Ann types, instead of the AnnFix type.
I modified your code a bit (and fixed the Show instances etc...) and put it
here:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=27823#a27823
Let me know if you have question
Forgot the attachment.
Romildo
--- Begin Message ---
On Mon, Jul 19, 2010 at 01:51:57PM -0400, Job Vranish wrote:
> Martijn van Steenbergen has a good blog post that describes the method I
> generally use:
> http://martijn.van.steenbergen.nl/journal/2010/06/24/generically-adding-position-informati
I would be inclined to add type annotations as an extra constructor of
the expression representation type.
data Exp
= IntExp Integer
| VarExp Symbol
| AssignExp Symbol Exp
| IfExp Exp Exp (Maybe Exp)
| CallExp Symbol [Exp]
| LetExp [Dec] Exp
| Exp `HasType` Ty
This i
Martijn van Steenbergen has a good blog post that describes the method I
generally use:
http://martijn.van.steenbergen.nl/journal/2010/06/24/generically-adding-position-information-to-a-datatype/
In his example he annotates the expression tree with position information,
but you can use the same me
Hello.
In his book "Modern Compilder Implementation in ML", Appel presents a
compiler project for the Tiger programming language where type checking
and intermediate code generation are intrinsically coupled.
There is a function
transExp :: Absyn.Exp -> (Tree.Exp,Types.Type)
that do semantic
11 matches
Mail list logo