Compilers digest Vol. 1 Number 2

compilers@ima.UUCP
3 Jan 86 19:39:00 GMT

          From comp.compilers

Related articles
Compilers digest Vol. 1 Number 2 compilers@ima.UUCP (1986-01-03)
Re: Compilers digest Vol. 1 Number 2 compilers@ima.UUCP (1986-01-03)
| List of all articles for this month |

Relay-Version: version B 2.10.2 9/12/84; site mit-hermes.ARPA
Posting-Version: Notesfiles $Revision: 1.6.2.16 $; site ima.UUCP
From: compilers@ima.UUCP
Newsgroups: mod.compilers
Date: 3 Jan 86 19:39:00 GMT
Article-I.D.: ima.136300007
Posted: Fri Jan 3 14:39:00 1986
Date-Received: 4 Jan 86 15:21:27 GMT
Nf-ID: #N:ima:136300007:000:4065
Nf-From: ima!compilers Jan 3 14:39:00 1986



[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)
--------



Post a followup to this message

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