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/
basic scripting language for learning purposes
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:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement