|Iterator firstname.lastname@example.org (2002-05-23)|
|Re: Iterator email@example.com (2002-05-27)|
|Re: Iterator firstname.lastname@example.org (Randall Hyde) (2002-05-27)|
|Re: Iterator email@example.com (Joachim Durchholz) (2002-05-27)|
|Re: Iterator firstname.lastname@example.org (Hans Aberg) (2002-05-27)|
|Re: Iterator bobduff@shell01.TheWorld.com (Robert A Duff) (2002-05-31)|
|From:||"Randall Hyde" <email@example.com>|
|Date:||27 May 2002 01:16:36 -0400|
|Organization:||Prodigy Internet http://www.prodigy.com|
|Posted-Date:||27 May 2002 01:16:36 EDT|
Takuya Murata wrote
>Now, I'm making a compiler. I want to support a loop feature as
>iterators like Sather.
>The problem is as if two stacks exists concurrently. I couldn't find a
>compiler construction book about how to implement iterator mechanism.
I'm not familiar with iterators in Sather, but if they're like the
ones in CLU then you don't need two stacks, you can use "resume
frames" to accomplish this (see "Programming Language Concepts by
Ghezzi & Jazayeri). I've implemented iterators this way in the HLA
(High Level Assembler) compiler and it was quite efficient.
If your semantics really do require two stacks, then the language
construct you're describing is probably a "generator" and I'd look at
the implementation of generators in the Icon language for some
Return to the
Search the comp.compilers archives again.