Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.16 $; site ima.UUCP Path: utzoo!decvax!cca!ima!compilers From: compilers@ima.UUCP Newsgroups: mod.compilers Subject: re: Decus C and "grinding out compil Message-ID: <136300023@ima.UUCP> Date: Mon, 6-Jan-86 22:13:00 EST Article-I.D.: ima.136300023 Posted: Mon Jan 6 22:13:00 1986 Date-Received: Wed, 8-Jan-86 02:46:13 EST Lines: 28 Approved: compilers@ima.uucp 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 decvax!minow --------