Re: C compiler front end wanted

David Given <dg@cowlark.com>
Sun, 15 Jun 2008 22:09:47 +0100

          From comp.compilers

Related articles
C compiler front end wanted dg@cowlark.com (David Given) (2008-06-15)
Re: C compiler front end wanted rich@pennware.com (Richard Pennington) (2008-06-15)
Re: C compiler front end wanted dg@cowlark.com (David Given) (2008-06-15)
Re: C compiler front end wanted sammyderoy@sympatico.ca (Sammy) (2008-06-15)
Re: C compiler front end wanted torbenm@pc-003.diku.dk (2008-06-16)
Re: C compiler front end wanted DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-06-15)
Re: C compiler front end wanted monnier@iro.umontreal.ca (Stefan Monnier) (2008-06-17)
Re: C compiler front end wanted dg@cowlark.com (David Given) (2008-06-20)
Re: C compiler front end wanted mm.beck@gmx.net (Michael Beck) (2008-06-20)
[2 later articles]
| List of all articles for this month |

From: David Given <dg@cowlark.com>
Newsgroups: comp.compilers
Date: Sun, 15 Jun 2008 22:09:47 +0100
Organization: Disorganised
References: 08-06-027 08-06-028
Keywords: C,parse
Posted-Date: 16 Jun 2008 01:29:40 EDT

Richard Pennington wrote:
[...]
> You may want to take another look at Elsa. I've been successful using
> Elsa as a C front end for LLVM. I can compile most of C (e.g. bzip2,
> etc.) to a running program after a couple of weeks of work.
>
> What sort of problems have you encountered building Elsa? It compiled
> cleanly for me an my Linux box.


I get two problems, possibly related: the Perl script that munges the
output of flex loses a line when inserting a #define, that breaks the
code (it's the closing line of a comment...); and then once fixed, I get
multiple definitions of yyFlexLexer::yywrap() when linking.


This looks to me very much as if the authors are using a different
version of flex than I am (2.5.34), and their Perl script is making
assumptions that aren't valid for my flex's C++ boilerplate.


(Interesting you mention using Elsa as a front end for LLVM. How's Clang
doing these days? What's your front-end like compared to it?)


...


Naturally, about an hour after posting my message, I found a rather
promising library called sparse:


http://www.kernel.org/pub/software/devel/sparse/


This is a full ANSI C frontend that appears to meet my requirements
ideally; it even comes with two example clients that are compilers! It
even breaks down the AST expression trees into 3op pseudoinstructions.
I'm not entirely sure that's what I want, but I'll do some
experimentation. Unfortunately, it's completely undocumented and I don't
actually know if it's complete or not.


Anything else interesting out there?


Post a followup to this message

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