Related articles |
---|
Tiger's ESEQ bsingharora@gmail.com (2005-06-30) |
Re: Tiger's ESEQ torbenm@diku.dk (2005-07-02) |
Re: Tiger's ESEQ kenrose@tfb.com (Ken Rose) (2005-07-02) |
From: | Ken Rose <kenrose@tfb.com> |
Newsgroups: | comp.compilers |
Date: | 2 Jul 2005 20:26:13 -0400 |
Organization: | Posted via Supernews, http://www.supernews.com |
References: | 05-06-136 |
Keywords: | books |
Posted-Date: | 02 Jul 2005 20:26:13 EDT |
bsingharora@gmail.com wrote:
> I have been reading Andrew Appel's Modern Compiler Design in "C".
>
> I am afraid I do not understand the ESEQ completely.
>
> I have been looking at other literature like the Dragon book,
> Engineering a compiler, and many more. I have not found the usage of
> ESEQ kind of instructions anywhere in them. I understand the
> ide-effect part, but how do we know for sure that some instruction will
> have a side-effect. How do you define a side-effect?
It's not about the ultimate machine instruction, it's about the
operation being translated. Consider a C expression like:
a[i++] = <something>
Consider just the i++ part. One simple way to translate that into
Appel's tree notation is something along these lines:
ESEQ(temp <- i)
(ESEQ(i <- i+1)
(temp)
}
A comma expression as another natural application. It's really about
the structure of the tree, and representing it in a way that's actually
type-safe (and suitable for the ML version of the book), though if
you're writing in C you could yield to the temptation to use a SEQ instead.
- ken
Return to the
comp.compilers page.
Search the
comp.compilers archives again.