how can we make a compiler??

sort by: active | newest | oldest
If you have to ask the question, you need a much longer answer than its possible to write here.

You need some books. One classic is known as the Dragon Book.


And you could study Tiny Pascal and Small-C, both written many years ago.

Modern, optimising, recursive compilers are seriously nasty beasts (worse than dragons) to design, and I wouldn't dream of it for anything like a casual interest.

What, you mean they don't have a program like "visible compiler writer" or something?
There is always one called YACC, Yet another Compiler Compiler.....but I really would call it a visible compiler writer ;-)
Despite its name, YACC is more of a grammar writer than a compiler writer (one stage up from LEX, which is the companion tokenizer). It's still the coder's responsibility to write the actual compilation process driven by that FSM... and for a serious compiler, it's more common to use the grammar to produce an internal program representation which is then operated on (optimized in various ways) before the actual compilation to machine code takes place.

As Steve's other note said, the Dragon Book is a classic starting point for this. Older editions can often be found cheap, and are Good Enough for an amateur.

harry886 years ago
imp to much $ needed and you need to know how to install microprocessors
and memory chips in place with every thing else its almost impossible but you could try
Sorry, between attempting to interpret your abbreviations and trying to bring mental order to the punctuationless mess you call a sentence, I seem to have come to the conclusion that you are trying to say that: One, Money in large amounts is needed for the task (untrue), and Two, that knowledge of installing hardware is needed for the task (although knowledge of assembly and how things like RAM memory works, you'd hardly be working with physical hardware). Sir, I humbly and seriously question your knowledge of both English and Computer programming.
orksecurity6 years ago
What are you actually trying to accomplish? Why do you need a new compiler?
rickharris6 years ago
Why would you want to? If you have a good reason then judging from the low level start of your question you have a STEEP learning curve.

Gotta agree with this too. Doing it right can be a big project even for a team of professionals. Doing it sloppily often isn't worth doing except, perhaps, as a learning exercise.
lemonie6 years ago

Go on then - in what machine-code?

kelseymh6 years ago
Start with a compiler for some programming language. Write a program in that language which translates strings of text into operations on the computer. Compile that program using your compiler. Now feed your new program files containing the strings of text. You've just written yourself a new compiler. How you solve the chicken-and-egg problem is usually termed "assembly language."