home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.compilers:1388 comp.lang.c:12397
- Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!ogicse!das-news.harvard.edu!spdcc!iecc!compilers-sender
- From: quanstro@stolaf.edu (goon)
- Newsgroups: comp.compilers,comp.lang.c
- Subject: Re: Two-pass C compilers
- Keywords: C, design
- Message-ID: <92-08-087@comp.compilers>
- Date: 16 Aug 92 18:13:56 GMT
- References: <92-08-081@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: quanstro@stolaf.edu (goon)
- Organization: St. Olaf College, Northfield, MN USA
- Lines: 22
- Approved: compilers@iecc.cambridge.ma.us
-
- The moderator comments:
- [Depends on what you mean by pass. Most C compilers I know turn C into
- assembler and only read the source once. Whether you think of the
- assembler as a second pass is a matter of semantics. Some compilers, e.g.
- Turbo C, go directly from C to object code, again only reading the source
- once. ...
-
- It seems to me that the Dragon book is very careful in defining a "pass"
- as "reading an input file and writing an output file." [p. 20] Now in each
- pass you can have as many phases as you want. In theory it would be
- possible to construct a compiler for any compilable language as a one-pass
- compiler with some positive number of phases. For C one needs to do
- lexical analysis, parsing, type checking, and code generation with several
- other phases (such as intermediate code generation and optimization) often
- implemented.
-
- In practice, C compilers have generally (well, at least often) had two
- passes, with the output of the second fed to the assembler. However this
- is mostly an artifact of the memory limitations in the early days of UNIX.
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-