Compilers
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives FAQs Compilers

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 15th, 2008, 02:40 PM
David Given
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
C compiler front end wanted

I'm working on a C based tool that needs to operate of a full C AST
basically, it can be thought of as a code generator for a really twisted
CPU architecture.

Does anyone know if there are any clean, standalone libraries for
parsing, verifying and then generating full ASTs, from C source code?

So far, my research has shown up a few tools like ctool, which
generates annotated parse trees but don't do full type analysis and
program verification; things like elsa, which is really designed for
C++ and as such is grotesquely overcomplicated for what I want (and
also, I can't make it build); and compiler frontends that are actually
attached to compilers, such as pcc, sdcc, ack, gcc etc, which are
unfortunately so tightly integrated to the compiler backend that
ripping out the existing
backend and replacing it with mine is a huge amount of work.

I'm sure there *must* be something like this out there, somewhere. Can
anyone suggest anything I should have a look at?

( source, please!)

[Don't hold your breath waiting for free tools here. Sometimes you only
get what you pay for. -John]

Reply With Quote
  #2  
Old June 15th, 2008, 05:20 PM
Richard Pennington
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
C compiler front end wanted

David Given wrote:
I'm working on a C based tool that needs to operate of a full C AST
[snip]
So far, my research has shown up a few tools like ctool, which
generates annotated parse trees but don't do full type analysis and
program verification; things like elsa, which is really designed for
C++ and as such is grotesquely overcomplicated for what I want (and
also, I can't make it build);
[snip]

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.

-Rich

Reply With Quote
  #3  
Old June 16th, 2008, 08:20 PM
Hans-Peter Diettrich
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
C compiler front end wanted

David Given schrieb:

I'm working on a C based tool that needs to operate of a full C AST
basically, it can be thought of as a code generator for a really twisted
CPU architecture.
>

Does anyone know if there are any clean, standalone libraries for
parsing, verifying and then generating full ASTs, from C source code?

I only have ToPas, a C parser written in Delphi. If you are interested,
have a look at SourceForge. Support for an AST could be added

Another chance: TextTransformer. Ask the author for his C++ parser, used
in an C++ to Java translator. TextTransformer can (be made to) create an
AST, and also can produce C++ code for the parser, in the prof version.

DoDi


Reply With Quote
  #4  
Old June 21st, 2008, 12:40 PM
David Given
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
C compiler front end wanted

David Given wrote:
[]
Does anyone know if there are any clean, standalone libraries for
parsing, verifying and then generating full ASTs, from C source code?

Thanks for all the replies; currently, sparse seems to be looking good
it even decomposes the expression trees into pseudo-code using
virtual registers in SSA form with liveness tracking, which means that
all I need to do is to bolt a noddy register allocator on the top and
I'm pretty much good to go. Very convenient.

However, it *is* all under construction and is totally undocumented,
which means I've got no idea if there are any gotchas coming up: but if
so, I've got plenty of other tools to look at. Thanks!


Reply With Quote
Reply

Viewing: Web Development Archives FAQs Compilers > C compiler front end wanted


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT