compilers@ima.UUCP (01/07/86)
[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 --------