Handling of loop statements

kasi@dtc.hp.com (Kasiraj Rengappa)
Wed, 28 Jun 1995 18:40:11 GMT

          From comp.compilers

Related articles
Handling of loop statements kasi@dtc.hp.com (1995-06-28)
| List of all articles for this month |

Newsgroups: comp.compilers
From: kasi@dtc.hp.com (Kasiraj Rengappa)
Keywords: optimize, question, comment
Organization: HP Integrated Circuit Business Division, Palo Alto, CA
Date: Wed, 28 Jun 1995 18:40:11 GMT


Could anyone tell me an efficient way to unwind loops
in the compiler / interpreter ?

I guess there might be two ways to do the unwinding:

1. Save the info till the end of the loops while
parsing and then unwind them. I guess this
will be extremely difficult if the language
allows nesting of looping statements.

2. Loop thru the statements physically and then
perform the unwinding. In this case how do you
make the lex and parser go back to the place
where the loop starts and how to match with
the exact rule set repeatedly ?

If anyone could gimme some suggestions or pointers
to papers/books, that would be highly appreciated.

Thanks in advance.

- kasi

    Kasiraj Rengappa
Design Technology Center
    Email: kasi@dtc.hp.com Hewlett-Packard Company
    Ph: (415)-857-7221 1501 Page Mill Rd
    Fax:(415)-852-8312 Palo Alto, CA 94303-0889
[I believe you'll find that compilers that do unwinding transformations have
already turned the whole routine, if not the whole program, into an internal
form that it can manipulate without going back to the source. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.