advanced user output
I want to allow user to use advanced output feature with my application. In other words I want to have some simple scripting language inside c++ application so that user could call c++ functions from this simple scripting language.
Is there anything similar available?
I know for boost python, but to embed python interpreter in c++ makes binary for about 1mb bigger. I want to keep my exe as smallest as possible.
User should be able to do something like this (for instance):
And when my c++ aplication would parse this script, it would make the output string:
%c = random(2,5);
%b = "some text";
output = "this is" . %b . "... some random number: " . %c;
"this is some text... some random number: 3"
Thanks for help
You might be able to cobble something together using a stringstream.
The problem as stated is basically the problem of writing a compiler, which is pretty heavy stuff. So, my suggestion...
If you want a lightweight scripting language... LUA might be the one for you.
If you want to roll your own, the simplest way to go about it is to make a stack-based language, aka, one built around Reverse Polish Notation.
I dont want to roll my own since that would take too much time to make something that will actually 'work'.