'C' Compiler Construction - any good methods?

Johnson <faraday@burgoyne.com>
18 Dec 1998 12:14:20 -0500

          From comp.compilers

Related articles
'C' Compiler Construction - any good methods? faraday@burgoyne.com (Johnson) (1998-12-18)
| List of all articles for this month |

From: Johnson <faraday@burgoyne.com>
Newsgroups: comp.compilers
Date: 18 Dec 1998 12:14:20 -0500
Organization: Burgoyne Computers Inc.
Keywords: C, design, question

Aside from buying an expensive commercial toolset, is there a
preferred method of constructing a 'C' compiler? I had a previous bad
experience with trying to hand code one and am looking for better
methods (on a limited budget). The resulting compiler will be used to
generate code for microcontrollers and may be sold (if all goes well)
so GNU derivative code would probably not work out. I anticipate
having to spend quite a bit of time on the back end for efficiency
reasons so development tool choice needs to take this into
consideration. My development platform choices would be 1) VC++ in
'C' mode for console app, 2) Djgpp, or if necessary 3) Linux (with
which I am not too familiar).

The major question is, do I use tools such as Lex and Yacc (and it's
derivatives) or do I use a more complete tool suite such as Gentle,
Eli, or PCCTS?

If I use Lex and Yacc are there good (i.e. publicly available and
sound) ways to handle issues like the typedef v. identifier problem
and error handling (which I understand is hard to implement with Yacc
generated code).

Is Jim Roskind's 'C' grammar the best one to go with? Or would I be
better off with BtYacc and it's simpler grammer? (I'm not, and
probably don't have time to be a Yacc grammar expert).

Would the use of Gentle, PCCTS, or ?? simplify the project (taken in
it's entirety)? Or would the learning curve outweigh their

I can probably allocate 6 man-months to this project, start to finish.
Any help/advice will be appreciated.

Henry Johnson
[If you only have six man months, either use GCC and live with the rules,
see if you can use lcc, or buy something. Six months is pretty tight just
to do a decent code generator. -John]

Post a followup to this message

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