re: Decus C and "grinding out compil

7 Jan 86 03:13:00 GMT

          From comp.compilers

Related articles
re: Decus C and "grinding out compil compilers@ima.UUCP (1986-01-07)
| 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: $; site ima.UUCP
From: compilers@ima.UUCP
Newsgroups: mod.compilers
Date: 7 Jan 86 03:13:00 GMT
Article-I.D.: ima.136300023
Posted: Mon Jan 6 22:13:00 1986
Date-Received: 7 Jan 86 10:46:37 GMT
Nf-ID: #N:ima:136300023:000:1164
Nf-From: ima!compilers Jan 6 22:13:00 1986

[from cca!decvax!minow (Martin Minow)]

Decus C is a public-domain compiler for a subset of C that runs on
PDP-11's. It was written about ten years ago in PDP-11 Macro (assembly
language). (The person who wrote Decus C didn't have access to a
C compiler!) It is fairly close to Unix V6 C, with a few extensions.
It is more-or-less a proper subset of current (K&R) C's. Because
it is written in assembler, you would have a tough time porting
it anywhere.

While tools to generate parsers and lexical analysers make part
of the compiler-writing process look easy, code generation is
still a very difficult task. Doing it right requires you to
make use of every assembly-language trick you ever learned.

You should also beware of using your generator tool where it
isn't appropriate: "if your only tool is a hammer, everything
starts looking like a nail." For example, Decus C uses a
hand-crafted recursive-descent parser for statements and
operator-precedence for expressions. A parser-generator
might try to create an lr1 or lalr parser even where it
is inappropriate: it might not be able to switch styles
in mid-parse.

Martin Minow

Post a followup to this message

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