Can C++ be used to write programming languages?

  • Thread starter marcoleepetersen
  • Start date
M

marcoleepetersen

Can C++ be used to write programming languages?
I know that C can be used to write other languages, but can C++ do it
too?
 
D

DerTopper

Can C++ be used to write programming languages?
I know that C can be used to write other languages, but can C++ do it
too?

Why don't you try to find an answer on your own? If you already know
that C can be used to write a compiler for another programming
language, you must have some basic knowledge about the C programming
language and its capabilities. Also you may have some understanding of
compilers and how they are implemented.

Or have you just picked up this single fact about C, and now you
should answer one of your homework questions? Either way, you'll most
probably get an answer in this newsgroup.

Stuart
 
A

Allen

Why don't you try to find an answer on your own? If you already know
that C can be used to write a compiler for another programming
language, you must have some basic knowledge about the C programming
language and its capabilities. Also you may have some understanding of
compilers and how they are implemented.

Or have you just picked up this single fact about C, and now you
should answer one of your homework questions? Either way, you'll most
probably get an answer in this newsgroup.

Stuart

Precisely, C++ can be used to write compiler for other language.
For example, Java compiler.

Allen
 
J

Joe Smith

Can C++ be used to write programming languages?
I know that C can be used to write other languages, but can C++ do it
too?

C++ is nearly a strict superset of C. Therefore anything one can do in C can
be done in C++. (There are some minor incompatibilities but they are not
relevent as they have no impact on capability, and C99 has some features not
included in C++, but they are merely convenience features, and have no real
impact on language capability.

However, a programming language is an abstract thing. One does not really
write a programming language. Language documentation or specifications can
be written, but one would not usually use C++ for that. C++ can be used to
write compilers and interpreters for programing languages.
 
A

Anand Hariharan

Can C++ be used to write programming languages?
I know that C can be used to write other languages, but can C++ do it
too?

Google for "Boost Spirit".

- Anand
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,440
Latest member
YoungBorel

Latest Threads

Top