Advertisement

Compiler

Started by November 21, 2001 01:29 AM
5 comments, last by hemp 22 years, 10 months ago
How do you make a compiler?
The question you asked is ridiculously broad. I think what you''re getting at is how can a compiler be made to be better than the previous if its only built with a previous compiler. Well, compilers are generally programmed in assembly, about the most basic form of computing. Assembly works on the same level as the computer. Nothing is automated. You write directly to the memory and read directly from the memory. Although a compiler CAN be written in other languages, but don''t ask me how that works.
How do you write the assembly compiler? (called an assembler), well assembly is just a frontend if you like for hexadecimal (hex) code. Assembly just makes things slightly easier to think about. This is truly as low as you can go. This, although often helped by the operating system, is as low as you can go, and is interpreted by the computer itself.
At the computing level, its almost mechanical, only using electric currents instead of moving parts.
I''m no expert, but I hope that I have shed some light on the issue. Please, anyone who is smarter than me, feel free to correct me.
Advertisement
why bother... there a zillions lang. outthere..

(always anonymous)
On the seventh day God rested...

Seriously, if you want to know start at google and keep searching - but here''s a couple links to get you started Let''s Build a Compiler

Catalog of Compiler Construction Tools

lcc, A Retargetable Compiler for ANSI C

Miracle C Compiler
And it''s also probably a good thing to learn how to use flex/yacc/bison and related tools
syntax..lexical analyzer..tokenizer..parser..damn

(always anonymous)
read this book several times:

http://www.wiley.co.uk/wileychi/grune/
Advertisement
This is beginning to look like an AP convention - How many AP''s? Raise your hand! I''m good for two now. :-)

This topic is closed to new replies.

Advertisement