[mod.compilers] Compilers digest Vol. 1 Number 2

compilers@ima.UUCP (01/03/86)

[from compilers-request at IMA]

To: compilers
--------

From cca!decvax!mcnc!ecsv!bet
Subject: Re: any PD C compilers?
From: Bennett Todd (duccpc!bet@ecsvax)

DECUS has one; I don't know how well suited it would be to porting to
anything other than the PDP-11. There is the family of critters along
the lines of Small-C and Tiny-C, PD subsets of C written in themselves.
Those that I have seen have been fairly grungy, not terribly clean or
comprehensible code; I didn't feel like taking the trouble to port one.
Richard Stallman (rms@mit-vax?) has one that is part of GNU; it probably
generates code for 68K right now, but might be the best one to take on
for porting. Any others out there?

Part of the C-KERMIT distribution from Columbia is a program called
Wart, which appears to be pretty much a PD implementation of lex(1).
With that and a PD yacc (anybody got one?) you could crank out a
reasonably clean C compiler without excessive effort.


Bennett Todd -- Duke Computation Center, Durham, NC 27706-7756; (919) 684-3695
UUCP: ...{decvax,seismo,philabs,ihnp4,akgua}!mcnc!ecsvax!duccpc!bet


Subject: Compiler design techniques
From: Bennett Todd (duccpc!bet@ecsvax)

I took a course in compiler construction, a large part of which was
constructing a compiler by hand. We used a hand crafted finite automaton
for the lexical analyzer, and a handmade recursive descent parser. This
is a surprisingly easy way to whip these critters out! The finite
automaton might not be justified for simple tasks, but the discipline of
breaking the task into a separate lexical analyzer and a recursive
descent parser really simplifies parsing even the simplest of languages.
I recently defined a really simple language for a really simple task, in
hopes that I could trivially crank out a brute force parser. Turned out
to be easier to do it right. Anybody else have any especially productive
techniques to recommend?

-Bennett
---

Bennett Todd -- Duke Computation Center, Durham, NC 27706-7756; (919) 684-3695
UUCP: ...{decvax,seismo,philabs,ihnp4,akgua}!mcnc!ecsvax!duccpc!bet

From: peterb@ima
Subject: Compiler Construction Techniques


I took my course on compiler construction at Lehigh. There we used the
dragon book (Aho and Ullman). I wrote a program that read EBNF grammers
and produced a recursive descent parser in pascal. It worked quite well,
and was based on the translation techniques layed out by Wirth in his book
"Algorithyms + Data Structures = Programs". I think it would be quite easy
to write another in C.

In fact, the last chapter of Wirth's book goes through the technique of
stepwise refinement to build pasrsers. It includes ideas about error
recovery, and a simple meta-language for his little pascal like language
PL0.  If anyone has a PC/IX system, I have written it up in C and have it
cranking out assembler with little trouble. The only problem is that the
optimizer is nothing more than a BIG filter, so it can take a while to
optimize the code. It produces code that is almost as fast as its C version.

Peter Barada
peterb@ima

PS - Please folks, send in submissions or this list will be dull at best.


-----------------------------------------------------------------------------

Send submissions to:  ima!compilers
Send requests for additions, deletions, back issues, etc. to:
	ima!compilers-request

ima is reachable as { ucbvax!cbosgd | ihnp4 | cca | bbncca | think |
	uiucdcs | allegra | inmet | yale | harvard }!ima!...

Arpa mail may make it to ima!compilers@CCA-UNIX or ima!compilers@BBNCCA

Peter Barada (editor)	John Levine (mailman)
/* End of text from pbear:peterb */
-----------------------------------------------------------------------------
Send submissions to:  ima!compilers
Send requests for additions, deletions, back issues, etc. to:
	ima!compilers-request

ima is reachable as { ucbvax!cbosgd | ihnp4 | cca | bbncca | think |
	uiucdcs | allegra | inmet | yale | harvard }!ima!...

Arpa mail may make it to ima!compilers@CCA-UNIX or ima!compilers@BBNCCA

Peter Barada (editor)	John Levine (mailman)
--------

compilers@ima.UUCP (01/03/86)

[from darryl at ISM780C (Darryl Richman)]

Has anyone looked at some of the newer, more automated methods of code
generation.  I built a small code generator based on some of the ideas by
Graham and Glanville, supporting Unary *, =, +, and Binary -.  I built it
for the 68k in about 5 hours.  This technique presupposes a linear
intermediate language, which you then parse with, say, a LALR(1) parser,
emitting coe (or not as appropriate) with each reduction.  The productions
represent addressing modes and operations.

Oh, BTW, although YACC itself is owned by AT&T, isn't it the case that
the output from yacc owes nothing to them?  I believe that you owe no
royalties for the use and distributions of /lib/yaccpar.

	    --Darryl Richman, INTERACTIVE Systems Corp.
	    ...!cca!ima!ism780!darryl
	    The views expressed above are my opinions only.

--------