943,015 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 384
  • C++ RSS
Sep 2nd, 2010
0

create a simple programming language

Expand Post »
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..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Redhaze46 is offline Offline
12 posts
since Jun 2010
Sep 2nd, 2010
0
Re: create a simple programming language
>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.
Administrator
Reputation Points: 6442
Solved Threads: 1391
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Sep 2nd, 2010
0
Re: create a simple programming language
how hard?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Redhaze46 is offline Offline
12 posts
since Jun 2010
Sep 2nd, 2010
0
Re: create a simple programming language
Click to Expand / Collapse  Quote originally posted by Redhaze46 ...
how hard?
Try making a parser first and then you'll start to see the 'how hard'.
Reputation Points: 499
Solved Threads: 363
Postaholic
gerard4143 is offline Offline
2,189 posts
since Jan 2008
Sep 2nd, 2010
0
Re: create a simple programming language
i have no clue where or how to start, any idea would be immensely helpful..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Redhaze46 is offline Offline
12 posts
since Jun 2010
Sep 2nd, 2010
1
Re: create a simple programming language
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
Reputation Points: 57
Solved Threads: 38
Posting Whiz
myk45 is offline Offline
311 posts
since Sep 2010
Sep 2nd, 2010
1
Re: create a simple programming language
Click to Expand / Collapse  Quote originally posted by Redhaze46 ...
i have no clue where or how to start, any idea would be immensely helpful..
If I was doing this 'but I'm not' I would investigate here

http://epaperpress.com/lexandyacc/
Reputation Points: 499
Solved Threads: 363
Postaholic
gerard4143 is offline Offline
2,189 posts
since Jan 2008
Sep 3rd, 2010
0
Re: create a simple programming language
You might want to do an easier alternative.

For example, say you write a code in a text file like so :
C++ Syntax (Toggle Plain Text)
  1. //code.txt
  2. START_PROGRAM
  3. print "hello world"
  4. 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.
Reputation Points: 840
Solved Threads: 594
Senior Poster
firstPerson is offline Offline
3,859 posts
since Dec 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Practice problem
Next Thread in C++ Forum Timeline: __m128 g++ error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC