Re: Difference between Push and Pull compilers?

Ray Dillinger <bear@sonic.net>
28 Feb 2002 00:08:11 -0500

          From comp.compilers

Related articles
Difference between Push and Pull compilers? marcel_katz@yahoo.com (2002-02-16)
Re: Difference between Push and Pull compilers? bear@sonic.net (Ray Dillinger) (2002-02-28)
| List of all articles for this month |

From: Ray Dillinger <bear@sonic.net>
Newsgroups: comp.compilers
Date: 28 Feb 2002 00:08:11 -0500
Organization: Compilers Central
References: 02-02-052
Keywords: design
Posted-Date: 28 Feb 2002 00:08:11 EST

Marcel Katz wrote:
>
> Can somebody point me to a text or book or article that talks in depth
> about the difference between Push and Pull compilers?
>
> Many thanks
> Marcel Katz
> marcel_katz@yahoo.com




As far as I know, this is simply a matter of coding style and
convention. The fundamental algorithms, I believe, are exactly the
same. I haven't heard "Push" and "Pull" used or discussed formally,
but here is how we used the terms informally when we were all students
writing compilers:


In Push compilers, you start by reading all the characters, then put
them in memory, and using them as an array you go through and pick out
all the tokens. Then with your array of tokens in memory, you go
through and pick out the expressions. Then with all the expressions
in memory you go through and pick out the subroutines. Then once you
know the subroutines, you can build your program.


In Pull compilers, you start by reading the program. The routine that
reads the program, starts by reading the first subroutine. The
expression that reads subroutines starts by reading the first
expression. The routine that reads expressions starts by reading a
token. The routine that reads tokens, starts by reading a
character....


Basically, in a Pull compiler (as we used the term) the reading of
characters happens as an epiphenomena or side effect of reading
higher-level structures, whereas in a Push compiler, the reading of
characters is a separate operation explicitly commanded.


Anyway, the fundamental stuff that's happening is actually the same.
The pull model is a little more functional and streamy, and the push
model is a little more modular and separable -- but it's doing the
same stuff.


Post a followup to this message

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