Hi all, I seek your advice on where to start if I want to write a compiler for atoy C-like language I invented (or, rather, am in the process ofinventing). Yes, yes, I know I''m crazy and the very idea isbrain-damaged and all that. Chances are I will lose interest long beforeI reach break-even, but it doesn''t hurt trying, does it? I''m a C addict reluctant to switch to C++, partly because I can''t fullygrok (and accept) the OOP paradigm. Nevertheless I like C++''s arguableimprovements such as overloading of functions and operators, references,const types etc. I also miss Pascal''s way-less-cryptic typedefs andconsistent array types. I suppose that rather than writing my experimental compiler from scratchit might be a better idea to take an existing one and hack it towards mynotion of ''the ideal multi-purpose language''. I had some experiencewith QuakeC (a byte-code compiler for the game Quake) so I know what avery simple compiler looks like, but things like parsing and handling ofcomposite data types and generation of x86 machine code are still beyondmy understanding. I have taken a look at GCC source once and was startled to death.Obviously it''s a highly advanced, extendible and portable compiler andthis implies quite a lot of unnecessary complexity. Is there something like ''The Art of Writing Compilers for Dummies?''? Isthere a simple C compiler somewhere for which source is available undera GPL-compatible license? Any help is appreciated. BR,Anton ''Tonik'' Gavrilov 解决方案 http://google.com/groups?group=comp.compilers ~ Let us linux ~-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!-----== Over 100,000 Newsgroups - 19 Different Servers! =----- Try this: http://compilers.iecc.com/crenshaw/ --Al BalmerBalmer Consulting re************************@att.net 这篇关于请帮助一个n00b写一个编译器:-)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 01:18