What do you mean by "make C++ compiler".
I hope for your sake that you are not going to write your own C++ compiler.
So assuming that you want a C++ compiler that works under Linux and Windows,
Windows -Visual C++, DevC++ (google and you will find links to download these )
Linux - GCC ( comes with many linux distributions )
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Yes, I want to write my own C++ compiler
Good luck :) Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Good luck Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it.
Writing a stable production quality compiler single handedly? yes I agree with these setiments. But, we shouldn't put the OP off too readily. Researching and creating a limited compiler that works on a subset of a chosen language is a very beneficial learning excercise for the computer engineer / software developer.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
>Researching and creating a limited compiler that works on a subset of a
>chosen language is a very beneficial learning excercise for the computer
>engineer / software developer.
Writing a compiler is a beneficial learning exercise, but not a C++ compiler. That's like saying that a hand made tool shed is a beneficial learning exercise, and then trying to build a skyscraper. There's levels of difficulty when it comes to compilers, and C++ is right at the top. Even if you restrict yourself to an extremely limited subset of the language, you still have to deal with complicated mess of the language grammar.
>How can i make c++ compiler under windows or Linux.
I'd start by looking at the code for an existing C++ compiler. GCC, for example. That should give you an idea of what's involved.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
what are C compilers written in?
C?
Assembley?
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
>what are C compilers written in?
C compilers tend to also be C++ compilers, and they're generally written primarily in C or C++.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
:D
which came first: the chicken or the egg!!
In case of Borland's compilers, they're written mostly in Pascal.
And that includes their Pascal compilers...
They wrote a compiler stub that could compile a minimal subset of the intended language in machine code or Assembly, used that to compile a compiler that could do a bit more of the language, and so on until they had one that could compile the entire language specification.
When they had that they could use that compiler to compile compilers for other languages like C++ and C#.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
What is machine code written in logic gates?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Don't worry. u r not writing world's *FIRST* compiler. u can use VC++, Dev-C++, Borland, .Net, Java, or any other language that can process text and can call OS API's 2 write ur compiler.
Don't you think it is awkward to write reply for post over 2 years old where discussion died and problem is either solved or forgotten?
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
didn't you bother to read the thread???
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343