Hello all..

is it possible to create my own simple programming language in c++?
complete with the compiler,editor and the libraries..
just a basic model where i can write simple instructions,save it with my own extension
and run atleast a few simple algorithms..

gatwech.gang commented: It really very fantastic +0

Recommended Answers

All 9 Replies

>is it possible to create my own simple programming language in c++?
Of course it's possible. But it's harder than you probably think.

how hard?

how hard?

Try making a parser first and then you'll start to see the 'how hard'.

i have no clue where or how to start, any idea would be immensely helpful..

For a start, try reading about Lexers, Parsers.

Lex and Yacc by John R Levine.

Also, since you are planning on building a compiler too, try reading this book:
Compiler Design by Aho, Ullman, Sethi

commented: thanks +1

You might want to do an easier alternative.

For example, say you write a code in a text file like so :

//code.txt
START_PROGRAM
  print "hello world"
END_PROGRAM

That file contains your new programming language code. Now you can use C++ to read in the file, and parse it accordingly and do proper stuff.

how would this be done, the parsing of a text file

Would you start a new thread for your question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.