Jump to content
  • Advertisement
Sign in to follow this  

basic scripting language for learning purposes

This topic is 4887 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote this little scripting language for learning purposes (not mine; to show to someone how some things can be done). The language is very basic, but it is enough for someone to get started. The code looks like:
VAR A;
VAR B;

PRINT "(1 + 2) * 3 / 2 = " EVAL ((1 + 2) * 3 / 2) NEWLINE;
PRINT "A = "; INPUT A;
PRINT "B = "; INPUT B;
PRINT "A + B = " EVAL (A) " + " EVAL (B) " = " EVAL (A + B) NEWLINE;

VAR C;
C = 5;
PRINT "C + 3 + A * B = " EVAL (C + 3 + A * B) NEWLINE;
The package contains a compiler, a virtual machine and source code. The source code is placed in public domain so you can do whatever you want with it. Since the whole thing has been written in around two hours, expect bugs to exist. Nonetheless, i think that it's a nice thing to read if you want to roll your own language. I also think that i wrote the source code in a clean way, so if anyone knows C, he won't have problems understanding -and why not extending?- the code. Get it from here: http://www.slashstone.com/prod.php?id=4 This is mostly for learning purposes. If you want a better, more advanced language, check out NerveBreak: http://nervebreak.sourceforge.net/

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!