November 9th, 2007 07:42 PM
Need Help Writing a C compiler...
Alright, I'm writing a C compiler "for the hell of it", and I'm using Flex/Bison as my lexer/parser combo. It works pretty well so far, but I'm rather lost when it comes to the abstract syntax tree implementation.
All I really want to do is have a simple translator from C to MMIX assembly language that has absolutely no optimization. My motivation is because I'd like to: 1) have a C-to-MMIXAL "compiler", 2) have it demonstrate the efficiency of algorithms and code.
That's why I don't want to use the GCC, because even if you write crappy code it will be optimized so you wouldn't notice unless you wrote really crappy code.
Perhaps using Yacc/Bison is too heavy duty for this job, perhaps a simple perl/python/<insert your favorite scripting language> script would do? (It could even use the system's preprocessor that way...) I heard through the grapevine that it would be a "solid day of Perl hacking" to write something like this, so perhaps this would be the way to go?
Thoughts and feedback would be greatly appreciated
"The Texan turned out to be good-natured, generous and likeable. In three days no one could stand him." Catch 22
by Joseph Heller.
Buddies? I have no buddies...
Give the BSD daemon some love (proud FreeBSD user)
By Tiger Shark in forum The Security Tutorials Forum
Last Post: January 18th, 2011, 11:40 PM
By SDK in forum Miscellaneous Security Discussions
Last Post: January 28th, 2005, 04:54 PM
By foxdie in forum AntiVirus Discussions
Last Post: April 4th, 2004, 01:52 AM
By progme in forum Other Tutorials Forum
Last Post: November 2nd, 2003, 03:43 PM
By tampabay420 in forum Programming Security
Last Post: February 14th, 2003, 01:36 PM